This article was previously published under Q326616
The debugger may not display values appropriately for the following strings:
std::string variables, if the length of the string is greater than 15 characters.
std::wstring variables, if the length of the string is less than 15 characters.
The std::string or std::wstring variable is stored as static buffer if the length is less than 15 characters. If the length of the string is greater than 15 characters, the string is stored as a pointer to memory.
You can modify the Autoexp.dat file to control the debugger display of std::string variable. The _Bx._Buf member is used to specify the std::string stored as static buffer. The _Bx._Ptr member is used to specify that std::string is stored as a pointer to memory. When the _Bx._Ptr member is not specified for std::string in autoexp.dat file, the debugger does not display the std::string variables that have length greater than 15 characters. When _Bx._Buf member is not specified for std::wstring in autoexp.dat file, the debugger does not display the std::wstring variables that have length less than 15 characters.
The Debugger component that displays variable values is known as Expression Evaluator (EE). One instance of EE handles the native code, and the other instance handles the managed code. The Autoexp.dat file provides customization for the native EE, and the Mcee_mc.dat file provides customization of managed EE. To resolve this problem, modify the Autoexp.dat file.
To modify the Autoexp.dat file, follow these steps:
Open Notepad or any other text editor.
Open the Autoexp.dat file from the c:\Program Files\Microsoft Visual Studio .NET\Common7\Packages\Debugger folder.
In the Autoexp.dat file, locate the following lines: