I can’t dump STL strings with WinDbg anymore – I used to be able to dump an STL string using the command: dt -r (MSVCP90!string) address, or for wide strings, dt -r (MSVCP90!wstring) address. Unfortunately I can’t do this anymore – I have a symbol path, and when I list modules it shows that symbols are loaded for MSVCP90:
74110000 7419e000 MSVCP90 (pdb symbols) x:\symbols\msvcp90.i386.pdb\A23D796E66BB430B891568A6EF0C750C1\msvcp90.i386.pdb
When I execute the command, the output I get is this:
0:025> dt -r (MSVCP90!string)
*************************************************************************
*** ***
*** ***
*** Your debugger is not using the correct symbols ***
*** ***
*** In order for this command to work properly, your symbol path ***
*** must point to .pdb files that have full type information. ***
*** ***
*** Certain .pdb files (such as the public OS symbols) do not ***
*** contain the required information. Contact the group that ***
*** provided you with these symbols if you need this command to ***
*** work. ***
*** ***
*** Type referenced: MSVCP90!string ***
*** ***
*************************************************************************
Symbol MSVCP90!string not found.
My symbol path is set like so:
0:025> .sympath
Symbol search path is: srv*X:\Symbols*http://msdl.microsoft.com/download/symbols
Expanded Symbol search path is: srv*x:\symbols*http://msdl.microsoft.com/download/symbols
I have found the SDbgExt extension, but from what I read it was for the 7.0 version of the runtime – this is 9.0.
Does anyone have an idea on why this feature has ceased to work? I really can’t live without it!
Thanks!
EDIT: For good measure, I also tried enabling noisy symbol mode. I got this output:
0:025> .reload /f MSVCP90.dll
DBGHELP: MSVCP90 - public symbols
x:\symbols\msvcp90.i386.pdb\A23D796E66BB430B891568A6EF0C750C1\msvcp90.i386.pdb
So it really looks like my symbols are fine.
If it is just for STL strings, than you can dump the string manually. It is very easy. The only slight complication is due to the fact that STL string could keep short strings inside the structure (and longer are always in the heap). STL string starts with either the sting itself (very short one) or pointer to the string. These two commands will dump the single-byte string:
Remember that only one of the commands will actually show the string — you can usually figure out by the output. If unsure,
dd <address> + 0x10 l1is the lenght of the string.Similarly for wide character strings: