   What on earth is wrong with my debugger? (VC++ 2010)
  So I've been using VC++ 2010 for a while now, and would consider myself pretty comfortable around the debugger. Up until tonight I've never had any problems with it. Although now I'm trying to debug a block of code and it is telling me that all of my symbols are not found. I've stripped this down to barebones and I can't for the life of me figure out what is wrong.1) I'm using debug mode (says "Debug" next to the green arrow in the toolbar on top.2) Optimization is turned off under Properties/C++3) I've closed/reopened visual studio, also cleaned and rebuilt the entire program and it still doesn't work.I've posted an image of two very similar cases, one that exhibits the problem. The case on top works properly, when I uncomment one line in the second case the debugger stops working.Anybody have any ideas?
  I just typed that code into a brand new console app I created, and the debugger works correctly in both cases.There must be more to it than just that code causing the problem. Are there other definitions for x and y anywhere?   ;  Are those screenshots differenct versions of visual studio?Maybe its not generating code for these two variables as theyre never referenced (this could be a compiler option)Also check Properties>Linker>Debugging>"Generate Debug Symbols" or something similar   ;  does it ever enter the block were x and y are declared, if not then they don't exist, so they won't be found by the debugger.   ;  What does it say, when you don't use the "watch" view, but the "locals" or "auto" one?   ;  Its probably getting removed by the compiler (since their pointless variables). If I ever need to stick somehting in (for a break point) I do:int stop = 0;stop = 1;Doesn't get removed then. Sometimes the variables won't come up untill you step over but that steps you out of the loop. Try adding some code that actually does soemthign after the variable declarations.   ;Quote:Are there other definitions for x and y anywhere?No, even if I change the variable names it still doesn't work. I'm really testing this inside this function with no other code:void CModelViewer::Render(const Matrix4D& projMatrix){if(0){float Atestfloat = 0.5f;} else {int Xtestvalue12345 = 5;int Ytestvalue6789 = 0;}}When I break on the same line as before it still doesn't show the new variables.Quote: Are those screenshots differenct versions of visual studio?Yes they are the same version. The output window looks different because I clicked it in one case so it was selected.Quote:does it ever enter the block were x and y are declared, if not then they don't exist, so they won't be found by the debugger.Yes, you can see in the image that it is currently stopped on the line "int y =0;"Quote:Its probably getting removed by the compiler (since their pointless variables).Well it is in debug mode so I would think that it would not remove them, and I've never seen this happen before in months of heavy usage. Before I stripped the block down to this simple test the variables were definitely being used and still exhibited the same problem.Sigh, maybe I'll just try to reinstall the program later or something. Really frustrating :(;Quote:Well it is in debug mode so I would think that it would not remove them,"Debug mode" doesn't exist. Project configurations exist, and by default projects come with "debug" and "release" configurations that are set up with some default options. However, you can change these options. Among those options are values for configuring and tweaking the debug information generated during the build. You may have inadvertently adjusted some of these settings without knowing it. You could read the documentation on the various settings, but a quicker way would be to create a new project from scratch and copy your code into the new project.I find it disingenuous to refer to "debug mode" because it can easily be ambiguous in terms of what settings are actually active.   ;  Sorry yes I realize that "debug mode" on it's own is meaningless, but I thought it would get my point across. I didn't think I changed any of the optimization settings and everything looked normal when I looked at the configuration (though I don't every option in the configuration).I'll try to build a new project later when I get a chance.   ;  Its has not been one or two "peformance tests" I have done that have been bollocked by the "optimizing" compiler that decides to ignore "useless lines". But running the thing as debug build is hardly an option since more often than not Im comparing my results against standard / known fast implementations. And those tend to reap great benefits from optimizations available.You could potentially get past the code elimiation issue bye adding a comparison statement into the block that results in a function call with side-effects ( cout printf, whatever?).I don't the the compiler can really leave stuff like that out, unless its trivially unreachable.  Such as in case:Xtestvalue12345 = 5;   if( !Xtestvalue12345 ){ blah..}But, as it has become apparent, just changing the project settings or creating a new one might be a better thing in this case.   