1

When I debug a c++ application, I am unable to see the value of the variable
If you see below,

std::string s = "a";

The debugger only shows the value as {...}, even if I extend the value.

What I have tried

  • Deleted the symbol cache, (Tools > Options ... > Debugging > Symbols.
  • Unchecked "Use Managed Compatibility mode"
  • Checked "Use Managed Compatibility Mode"
  • Unchecked "Use Native Compatibility Mode"
  • Checked "Use Native Compatibility Mode"
  • I have tried to export the settings from the working environment and then import them into the other one, with no luck.

Any suggestions? ...

VS2015 debugger

I get the same issue with std::vector<std::string> ... or any other type, I cannot expand the data.

Edit: Added a picture of what it is supposed to look like ...

What it should look like

Edit 2: I have tried to export the settings from the working environment and then import them into the other one, with no luck.

FFMG
  • 1,208
  • 1
  • 10
  • 24
  • It's there on the line you highlight. You need to expand the `_Myval2` node a few levels. – Richard Critten Apr 01 '17 at 10:33
  • Yes, but that's not the way it is supposed to work. If you have a `std::vector ...` you have to expand about 10 levels per values, (as an example). The debugger does not normally work that way. – FFMG Apr 01 '17 at 10:39
  • How did you get the "supposed to look like" picture? From a release build? I'm guessing that the debug version of the CRT has a bunch of complexity in it to help you catch bugs, and that's messing up the debugger visualizer. I can't remember which view I see in Visual Studio; I'm not near a computer with it installed at the moment. – Cody Gray - on strike Apr 01 '17 at 11:35
  • This was taken from another dev machine. Neither versions are release build, both are running the exact same code in debug, (same breakpoint, same steps followed), hence the reason I think it must be an environment setting rather than a project setting. – FFMG Apr 01 '17 at 12:33
  • @FFMG, I test it in my side, it works well in VS2015 with update 3 in windows 10:https://1drv.ms/i/s!Auvjmr9ZOuhVhwpUEA18h9fHrdoo. I just use the default VS settings(C#), if the same app works well in other VS machine, I suggest you repair your VS. Please also install the latest update 3. Actually I didn't select two options "Use Managed/Native Compatibility mode", in project property I select the "Auto" debugging type. Actually I met this issue before which was related to the VS setup up: http://stackoverflow.com/questions/32656222/inspecting-stl-containers-in-visual-studio-2015. – Jack Zhai Apr 03 '17 at 05:40
  • @FFMG, Does it still have this issue now? – Jack Zhai Apr 11 '17 at 10:10
  • I fixed it by un-installing and re-installing vs2015, but I cannot say what was the actual issue to start with, all I know is that it was fixed after a re-install. The only thing I know is that I had the early release of VS2015 so maybe the subsequent updates that did fix the debug issues, (Update 3?), did not fix it if you had an early release. – FFMG Apr 18 '17 at 07:25

1 Answers1

0

To fix the issue I un-installed VS2015 completely, (including all the updates and other "vs2015" tools that were installed over the months.

I then ran ccleaner a couple of times to remove dead registry settings left behind, (not sure if that helped, but it doesn't hurt).

I than re-ran the install, it picked up that update 3 was needed.

A couple of things were not removed as I didn't need to re-register and enter my credentials.
But it seems it wasn't the problem as the re-install did the trick.

Also:

  • Unchecked "Use Managed Compatibility mode"
  • Unchecked "Use Native Compatibility Mode"
FFMG
  • 1,208
  • 1
  • 10
  • 24