I have a strange feeling like this is a recent issue and happens on two separate computers.
When I'm debugging and trying to look at the value of an std::string from STL, it shows as the value. It says its size is 15 and capacity is some garbled huge number.
The array values themselves all say CXX0030: Error: expressions cannot be evaluated.
This is extremely frustrating and I can still access the string values while debugging if I call c_str on the string and assign it to a char * or use watch expressions if I need to, but it's very tedious and makes life very hard when debugging complicated problems for 3 days straight.
The contents other STL containers show up just fine.
This happens on multiple projects on two different computers, and I'm pretty sure I have all debugging options set for the project. No optimizations, and generating debugging info for sure.
Had the same problem and fixed it by changing the visualizer in autoexp.dat. It's found here: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\autoexp.dat" or somewhere similar depending on your Visual Studio and Windows version.
Changes for "std::basic_string":
replace $e._BUF_SIZE
by sizeof($e._Bx._Buf)/sizeof(char)
or sizeof($e._Bx._Buf)/sizeof(wchar_t)
https://connect.microsoft.com/VisualStudio/feedback/details/677683/std-string-incorrectly-displayed-in-debugger
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With