Use WinDbg to Write Contents of Managed Byte[] to File

后端 未结 2 1980
孤城傲影
孤城傲影 2020-12-30 04:03

I have a crash dump from a production server that shows an OutOfMemoryException. The exception itself is not relevant here.

I happened to run a !dso to view the sta

相关标签:
2条回答
  • 2020-12-30 04:26

    This is what worked for me:

    .foreach($str {!DumpHeap /d -mt 00007ff890e96948 -min 0n126500 -short}){r@$t0=  dwo(${$str}+8)*2;.writemem e:\temp\str\${$str}.txt ${$str}+c L? @$t0} 
    
    0 讨论(0)
  • 2020-12-30 04:45

    The L modifier for ranges is limited in size. If you want to get around the limit use the L? range modifier. The following command worked for me:

    0:000> !do 0x04cc1000
    Name:        System.Byte[]
    MethodTable: 68374944
    EEClass:     680aaf1c
    Size:        67108876(0x400000c) bytes
    Array:       Rank 1, Number of elements 67108864, Type Byte
    Element Type:System.Byte
    Content:     ................................................................................................................................
    Fields:
    None
    0:000> .writemem c:\temp\array.bin 0x04cc1000 L?0x400000c
    Writing 400000c bytes
    
    0 讨论(0)
提交回复
热议问题