How to create a minidump with stack memory

1.3k views Asked by At

My program creates a minidump on crash (using MiniDumpWriteDump from DBGHELP.DLL) and I would like to keep the size of the dump as low as possible while still having important memory information available. I have gone through the different possible combinations of flags and callback functionalities you can pass to MiniDumpWriteDump (links to debuginfo.com or MSDN).

I think I am limited to these MINIDUMP_TYPE flags, since it has to work on an old WinXP machine:

  • MiniDumpNormal
  • MiniDumpWithDataSegs
  • MiniDumpWithFullMemory
  • MiniDumpWithHandleData
  • MiniDumpFilterMemory
  • MiniDumpScanMemory

I am searching for a way how to combine these flags and the callback function to get a dump with the following requirements:

  • Relative small size (Full memory dump results in ~200MB filesize, I want max. 20MB)
  • Stack trace of the crashed thread, maybe also the stack trace of other threads but without memory info
  • Memory information of the whole stack of the crashed thread. This is where it gets complicated: Including stack memory should be no problem in terms of size but heap memory might be overkill.

The question is how can I limit the memory info to the crashed thread and how to include stack memory (local variables) of the whole call stack? Is it also possible to include parts of the heap memory, like only these parts that are referenced by the current call stack?

0

There are 0 answers