Possible workaround for Visual Studio 2012/2013 debugger not displaying std :: string values

I also posted this on the MSDN forum here: MSDN forum post

When using the / clr option with a Visual Studio C ++ project, the debug renderer for std :: string and other types doesn't seem to work. Here are the steps:

  • Running VS2012 or 2013
  • Creating a New Visual C ++ / Win32 Console Application
  • In your main .CPP file add: #include <string>

  • In the main method add: std::string s = "abc";

  • Debugging the program and checking the 's' variable. Notice how it shows the string "abc". This is what we want.
  • Open project properties / General. Set "Common Language Runtime Support" = "Common Language Runtime Support (/ clr)"
  • Debugging the program and checking the 's' variable. Now the string "abc" is not displayed.

Additional Information:

I can see the definitions of the debug renderer for std :: basic_string in both autoexp.dat and stl.natvis files for Visual Studio. However, this seems to be ignored when using / clr. One way to confirm that he actually ignores these definitions is to add additional text to them. When / clr is not used, VS shows the text in preview mode; with / clr on, it is not.

There are other similar streams such as:

  • Visual Studio 2013 C ++: STL container items show up in debugger
  • Other links in MSDN post; stackoverflow hasn't given me a post yet.

However, all of these streams seem to indicate that the autoexp.dat and / or natvis files are in use and subject to change. In my case, I find that these files are completely ignored when using / clr.

Does anyone know about work?

+3
c ++ clr visual-studio visual-studio-2012


source to share


No one has answered this question yet

See similar questions:

eleven
Visual Studio 2013 C ++: STL container items show up in debugger

or similar:

505
Error "LINK: fatal error LNK1123: failed to convert to COFF: file is invalid or corrupted" after installing Visual Studio 2012 Release Preview
382
How to switch themes in Visual Studio 2012
271
Visual Studio 2012/2013 one click opens file
255
How do I cancel the "Scope of this" in Visual Studio 2012?
190
Viewing an array in the Visual Studio debugger?
18
How can I skip debugging the entire std namespace in Visual C ++ 2013?
five
How do I compile and link Google tests in a C ++ project in Visual Studio 2013 but with Gtest installed by the NuGet package manager?
2
Confused about Microsoft C ++ Suggestions and Terminology
1
Using C ++ / CLI in Visual Studio 2013
0
openssl link to visual studio 2013 LNK2019



All Articles
Loading...
X
Show
Funny
Dev
Pics