Search code examples
windowscrashbatch-processingwindbgminidump

core dump files batch processing (Windows)


I have many core dumpe (or minidump) files from customer (.dmp) I can open each in MS Visual Studio and see the callstack. I can do it also with WinDBG. But since there are many of them and I want to categorize the crashes. Is there a way to do batch processing that will get a list of .dmp files as input and give a list of .txt files with the callstack?

I tried WinDBG with commandline, but couldn't see how to create a command that takes .dmp file as input and prints the callstack as output (or save it in text file)


Solution

  • Something like

    for %d in (*.dmp) do C:\fullpath\cdb.exe -c ".logopen %d.log; .exr -1; k; .logclose; q" -z %d
    

    works for me most of the time.

    • for %d in (*.dmp) do is there to process all DMP files
    • C:\fullpath\cdb.exe runs the command line version of WinDbg
    • -c "..." passes a command to CDB
    • -z %d opens the dump file

    As for the commands:

    • .logopen %d.log; makes sure you save the output to different files (%d is replaced by the command line, not by WinDbg)
    • .exr -1; gives you the exception information (since you typically want to sort on exception type)
    • k; gives you the call stack
    • .logclose; closes the output file
    • q makes sure that WinDbg terminates and you're not stuck at some prompt