What is minimum MINIDUMP_TYPE set to dump native C++ process that hosts .net component to be able to use !clrstack in windbg

烂漫一生 提交于 2019-12-17 19:26:24

问题


There is native C++ application that hosts several .net components. When some error occurs this application creates mini dump using MiniDumpWriteDump function. Question here what is minimum set of

[Flags ]enum MINIDUMP_TYPE {
MiniDumpNormal = 0x00000000,
MiniDumpWithDataSegs = 0x00000001,
MiniDumpWithFullMemory = 0x00000002,
MiniDumpWithHandleData = 0x00000004,
MiniDumpFilterMemory = 0x00000008,
MiniDumpScanMemory = 0x00000010,
MiniDumpWithUnloadedModules = 0x00000020,
MiniDumpWithIndirectlyReferencedMemory = 0x00000040,
MiniDumpFilterModulePaths = 0x00000080,
MiniDumpWithProcessThreadData = 0x00000100,
MiniDumpWithPrivateReadWriteMemory = 0x00000200,
MiniDumpWithoutOptionalData = 0x00000400,
MiniDumpWithFullMemoryInfo = 0x00000800,
MiniDumpWithThreadInfo = 0x00001000,
MiniDumpWithCodeSegs = 0x00002000,
MiniDumpWithoutManagedState = 0x00004000,
};

that should be passed to MiniDumpWriteDump to produce small dump file but with ability to see clr stack)? Sure, full memory dump will work but how to get only bearable minimum?


回答1:


In fact, it is enough to specify these options (to make dump small and be able to extract managed callstacks):

  1. MiniDumpNormal (default)
  2. MiniDumpWithProcessThreadData
  3. MiniDumpWithThreadInfo
  4. MiniDumpWithUnloadedModules

Thanks a lot to Oleg Starodumov form http://debuginfo.com/




回答2:


As far as I know, you need a full dump. The reason is that to decode the stack contents you need memory that's privately allocated by the CLR (such as JITted methods).

It is theoretically possible to add these memory regions by hand to a smaller dump, but of the enum values you listed above, I'm afraid only the full dump will contain that information.



来源:https://stackoverflow.com/questions/4851538/what-is-minimum-minidump-type-set-to-dump-native-c-process-that-hosts-net-com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!