question

slipbits-2359 avatar image
0 Votes"
slipbits-2359 asked ·

MSVS 2019 v16.9.2 Debug shows incorrect string value.

The string in question is:
string pattern = ".*" + fs + ')' + '"'; // fs = ':'
Debug shows pattern = " ENDFILE\n".

Same for string pattern(".*" + fs + ')' + '"');

Same for string& pattern = *(new string(".*" + fs + ')' + '"'));

ENDFILE is the name of a method in an included header file:

 class Callback {
 public:
    virtual void PROCESS() = 0;   //!< callback function called for each line
    virtual void BEGIN() = 0;       //!< callback function called before any processing
    virtual void END() = 0;         //!< callback function called when processing complete
    virtual void BEGINFILE() = 0; //!< callback function called before file processing
    virtual void ENDFILE() = 0;   //!< callback function called after file end
    virtual void NULLFUNC() = 0;  //!< callback function does nothing
 }; // class Callback

This code is in a constructor. Anyone know how to fix it?






c++
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Make sure to step past that line, and then inspect the variable. When the current instruction (an arrow in the left margin) points to a line of code, that line has not executed yet. You may be looking at a variable before it has been initialized.

0 Votes 0 ·

0 Answers