Generating Win32 Crash Dumps

Every Software Engineer knows that most software ends up crashing eventually, when it does it is very useful to have a full crash log to help you determine the cause of the problem, to that end here is a good article that I found on working on what Microsoft calls ‘Minidumps’ on windows.

http://crashrpt.sourceforge.net/docs/html/using_minidump.html

This is some code for catching unhanded exceptions (typically like null pointer references or heap corruption etc.) and writing a crash dump that can later be opened up with visual studio:

You will need to link to DbgHelp.lib.

If you run your program from within visual studio’s debugger (e.g. F5) then the debugger won’t let execution run on to the handler, so to test the handler you will have to run your program without the debugger (e.g. ctrl-F5), bit of an annoyance but there you have it…

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *