Reputation: 10353
Visual Studio 2010 doesn't display debug info for local variables. I have no problem seeing my class variables though. Is there some setting that I'm missing?
This is a "debug" build.
I tried going to Project Properties -> C++ -> Optimizations and disable all optimizations.
Upvotes: 4
Views: 14261
Reputation: 1852
I was able to fix this problem in VS2015 by enabling Options > Debugging > General > Use Native Compatibility Mode.
MSDN says that "when this option is selected, the debugger uses the Visual Studio 2010 native debugger instead of the new native debugger." We build with Intel C++ 12.1, which is based on VC10, so that makes sense!
Upvotes: 0
Reputation: 197
If you are experiencing it with within a switch-case statement just add a conditioned empty command like
if(true)
;
for testing purposes. It seems that some older versions of Visual Studio suffered from a bug where a missing conditioning of any kind (while, if...) in one case rendered Locals during debugging in following cases invisible.
Upvotes: 1
Reputation: 957
For those who have any problem regarding this issue...
and most probably everything will be good then....
Upvotes: 1
Reputation: 1
Always include just the compatible debug libraries:
I came here because Visual Studio 2010 didn't display debug info for some local variables within the opencv 2.4.2 library. In Mat _InputArray::getMat(int i) const
I got to see several variables but k and vv were missing. (and I got an exception in cv::_interlockedExchangeAdd
when getMat would (wrongly) return only empty matrices.)
Anyway, the problem was: I had included (as library, in the PATH for the dlls and as #pragma comment
) both the debug and the release libraries. This seemed to have caused the problem. Everything worked well after included just the debug libraries.
Upvotes: 0
Reputation: 4014
If you're using Visual Studio 2010 Express (like I was) this is fixed by getting Service Pack 1, which you can get by running Windows Update.
Upvotes: 0
Reputation: 1981
This can help. http://support.microsoft.com/kb/2452649
This is the main entry http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/6133b9d0-81c6-4e30-bfe5-5b3d6e104300
Upvotes: 4
Reputation: 10939
check to make sure you're project is setup to export debug symbols. These should be .pdb files. They contain debug information for your code. I believe the setting is under project->Linker->generate debug info.
Upvotes: 2