title: WinDbg and SoS, how do I print/dump a large string?
body: <p>I am debugging a hangdump coming from a production server using WinDbg with the SoS extension.</p>
  
  <p>There is a string parameter in one of the stacks, that I need to know the value of. However, it is a rather large string, and WinDbg won't print it when I am using <code>DumpObj</code>. This is the output from <code>DumpObj</code>:</p>
  
  <pre><code>0:036&gt; !do 00000001b30d8668
  Name: System.String
  MethodTable: 0000064278436728
  EEClass: 000006427803e520
  Size: 5125300(0x4e34b4) bytes
   (C:\WINDOWS\assembly\GAC_64\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
  String: &lt;String is invalid or too large to print&gt;
  
  Fields:
                MT    Field   Offset                 Type VT     Attr            Value Name
  000006427843d998  4000096        8         System.Int32  1 instance          2562638 m_arrayLength
  000006427843d998  4000097        c         System.Int32  1 instance          2562637 m_stringLength
  0000064278438170  4000098       10          System.Char  1 instance               3c m_firstChar
  0000064278436728  4000099       20        System.String  0   shared           static Empty
                                   &gt;&gt; Domain:Value  0000000000163260:000000007fff0370 00000000001a6760:000000007fff0370 &lt;&lt;
  0000064278438020  400009a       28        System.Char[]  0   shared           static WhitespaceChars
                                   &gt;&gt; Domain:Value  0000000000163260:000000007fff0b60 00000000001a6760:000000007fff89f0 &lt;&lt;
  </code></pre>
  
  <p>How can I get the value of this string instance ? Preferably dumped to a file.</p>