dumpstring – windbg
Viewing strings inside the debugger has never been pretty, especially if you are using sos extension. Here is a sample !dumpobj on a string
0:000> !do 00000000025f2280
Name: System.String
MethodTable: 000007fef6e26960
EEClass: 000007fef69aeec8
Size: 32(0×20) bytes
String: Foo
Fields:
MT Field Offset Type VT Attr Value Name
000007fef6e2c848 40000ed 8 System.Int32 1 instance 3 m_stringLength
000007fef6e2b388 40000ee c System.Char 1 instance 46 m_firstChar
000007fef6e26960 40000ef 10 System.String 0 shared static Empty
>> Domain:Value 00000000002ae900:00000000025e1420 <<
Some of the devs like to use the du command
du 00000000025f2280+c
0:000> du 00000000025f2280+c
00000000`025f228c “Foo”
My choice is to use the .printf command and here is my alias for printing string
as !ds .printf "%mu \n", c+
0:000> !ds 00000000025f2280
Foo
I prefer .printf over du because I am not interested in looking at the memory address often especially dumping strings within a script.
dumpstring – windbg…
Thank you for submitting this cool story – Trackback from DotNetShoutout…
DotNetShoutout
June 30, 2010 at 12:35 pm
Your site is excelent.
Thanks.
Tal
January 26, 2011 at 7:10 am
Thanks.
Naveen
January 26, 2011 at 8:41 am
Thanks a lot even i was looking for the same
Lavanya
November 10, 2012 at 11:05 pm