Using visual-studio: Possible break point issue with Visual Studio 2012 RC? on newest questions tagged visual-studio – Stack Overflow
While debugging some C++ code using Visual Studio 2012 RC, I noticed a strange behavior with break points on class member functions and values of member variables.
When I set the break point on a class member function, VS 2012 puts the break point on the function curly bracket. Now, when hovering over a member variable used by the function, the value is always “uninitialized”. However, pressing F10 to step to next line (first line in the function), the member variable is now changed to the correct value.
This looks like that values of member variables of a class is not loaded until stepping into the first line in the member function. But this is very confusing – what would be the point of breaking on the curly bracket then? (As is the default when setting break points on functions.)
Breaking on class member function:
active is said to be
true (which it really is not!)
Stepping to next line with F10:
active is now said to be
false (which is correct.)
Am I missing something here or is this an actual bug in Visual Studio 2012 RC?
Edit: I found my copy of Visual Studio 2010 and tried this out. The behavior in regards to break points is the same. The difference lies in how IntelliSense handles the situation. In VS 2010, IntelliSense does not popup a tooltip at all when breaking on the curly brace, and in VS 2012 the tooltip is always displayed. I think the VS 2010 behavior is a lot better to avoid confusion.
Using visual-studio: using-visual-studio