c++ - Incorrect watch values in Visual Studio 2010 Professional -
I am having a very strange problem where the clock window values for some variables do not match their "real world" "The value debugger appears to be just off in space here, the smallest snippet is shown here:
printf ("% d ", pNodes [nNode] .nColumn); // clock "4" indicates printf ("% d", nColumn); // clock shows "1" if (pNodes [nNode] .nColumn! = NColumn) Continue; // It is not called So here's the behavior:
- If I add a clock to
pNodes [nNode] NColumn , it shows the value of 4 . - If I add a clock to
nColumn , then it shows the value of 1 . - If I type expression
pNodes [nNode] .nColumn! = NColumn in the viewing window, it evaluates for the true . -
Continue statement is omitted! - I asked to see
printf () what was happening, and printf () values to 1 And 1 , which calls the code "flow" (i.e. no if statement inside continue . < I can see the memory on the and pNodes (NNode) .nColumn , and the memory shows the value "wrong" which is showing me the clock window. So it seems that the debugger is completely "disconnected" I have also run a debug build optimization. I have also checked that pNodes do not fit in some global variables or other variables in scope - it seems that there is only local version. < P> This is totally disturbing me! I do not even know where to go before trying to find out the problem. If you have any ideas, then I would love to hear them! money Thanks!
So I think I have torn the matter: guilty member The structure of the alignment was that I had a group of projects mixed and some of them were different values for this area within the projects. I have removed the settings on them so that they can choose VS to go wrong and the problem has disappeared. The values applied in some projects were between 4 bytes , default in some projects, and others have completely blank values configuration properties / C / C ++ / Code Generation / Structure is the member alignment . Again, I completely eliminated the values for the projects. I think it was established on some time ago to deal with the issue of some cross-platform issue, but at least this I am now doing what is fixed for the work! Thanks for all your help!
Comments
Post a Comment