13

I want my app to create a mini dump to help debug unhanded exceptions.

I may not know what type of mini dump I will want until after the dump has been created, so what combinations of MINIDUMP_TYPE flags should I use to give me the most complete dump possible?

sackoverflow
  • 767
  • 1
  • 6
  • 16

2 Answers2

14

I came up with the following list with the help of the DebugInfo.com link (thanks David) and the MSDN page. Not all flags are covered in the DebugInfo.com link.

Using these flags should create a comprehensive, but big mini dump.

Include:

MiniDumpWithFullMemory                  -       the contents of every readable page in the process address space is included in the dump.      
MiniDumpWithHandleData                  -       includes info about all handles in the process handle table. 
MiniDumpWithThreadInfo                  -       includes thread times, start address and affinity. 
MiniDumpWithProcessThreadData           -       includes contents of process and thread environment blocks. 
MiniDumpWithFullMemoryInfo              -       includes info on virtual memory layout. 
MiniDumpWithUnloadedModules             -       includes info from recently unloaded modules if supported by OS. 
MiniDumpWithFullAuxiliaryState           -       requests that aux data providers include their state in the dump. 
MiniDumpIgnoreInaccessibleMemory        -       ignore memory read failures. 
MiniDumpWithTokenInformation            -       includes security token related data.

Exclude:

MiniDumpNormal                          -       value is 0 so always implicitly present, unless excluded by a callback (which I won't be doing).
MiniDumpWithPrivateReadWriteMemory      -       excludes contents of shared memory. 
MiniDumpWithIndirectlyReferencedMemory  -       includes memory pages referenced by pointers on the stack, but assuming MiniDumpWithFullMemory already includes all pages in the process address space anyway.
MiniDumpWithDataSegs                    -       contents of writable data sections are already included by specifying MiniDumpWithFullMemory
MiniDumpWithCodeSegs                    -       assuming MiniDumpWithFullMemory includes this. 
MiniDumpWihtoutOptionalData             -       suppresses all memory operations other that MiniDumpNormal. 
MiniDumpFilterMemory                    -       filters out contents of stack memory (also has no effect if MiniDumpWithFullMemory used).
MiniDumpFilterModulePaths               -       removes module paths from the dump. 
MiniDumpScanMemory                      -       used to exclude memory for specific modules via callbacks. 
MiniDumpWithPrivateWriteCopyMemory      -       assume MiniDumpWithFullMemory already includes this.
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207
sackoverflow
  • 767
  • 1
  • 6
  • 16
4

Have a read of Effective minidumps at DebugInfo.com looks like it would guide you to a solution.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • I considered that, but some of the descriptions would then seem to conflict. For example; MiniDumpFilterModulePaths description says only use in special situations and MiniDumpNormal says it includes *just* the information necessary to capture stack trace - will including that override other flags or vice-versa. – sackoverflow Feb 18 '11 at 12:31