Visual Studio 2010 does not display debug information for local variables

Visual Studio 2010 does not display debugging information for local variables. However, I have no problem viewing class variables. Are there any settings that I am missing?

This is a "debug" assembly.

I tried to go to Project Properties -> C ++ -> Optimization and disable all optimizations.

+4
source share
7 answers

check to make sure the project is configured to export debugging symbols. These must be .pdb files. They contain debugging information for your code. I believe the setup is in the project-> Linker-> generate debug file.

+2
source

For those who have problems with this problem ...

and, most likely, everything will be fine then ....

+1
source

If you experience this with the switch-case statement, just add a conditional empty command, like

if(true) ; 

for testing purposes. It seems that some older versions of Visual Studio suffered from an error in which a missing setting of any kind (at that time, if ...) in one case displayed locales during debugging in the following cases, invisible.

+1
source

If you are using Visual Studio 2010 Express (for example, I was), this fix is ​​by getting Service Pack 1, which you can get by running Windows Update.

0
source

Always include only compatible debug libraries:

I came here because Visual Studio 2010 did not display debugging information for some local variables in the opensv 2.4.2 library. In Mat _InputArray::getMat(int i) const I had to see several variables, but k and vv were missing. (and I got an exception in cv::_interlockedExchangeAdd when getMat (mistakenly) returns only empty matrices.) In any case, the problem was that I included (as a library in PATH for DLLs and as #pragma comment ) as debug libraries , and release libraries. This seems to have caused the problem. Everything worked well after including only debug libraries.

0
source

I was able to fix this problem in VS2015 by turning on the option> Debugging> General> Use native compatibility mode.

MSDN says that "when this option is selected, the debugger uses its own Visual Studio 2010 native debugger instead of a new native debugger." We are building with Intel C ++ 12.1, which is based on VC10, so it makes sense!

0
source

Source: https://habr.com/ru/post/1345128/


All Articles