Debugging Minidumps on Windows

From Sirikata Wiki
Revision as of 05:13, 17 June 2011 by Ewencp (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

To facilitate debugging of crashes for users, we use Breakpad to collect crash reports. Breakpad uses Microsoft's minidump format. Minidumps are small compared to core dumps, but require additional information to debug.

We've built a very simple service for collecting these dumps (found in tools/crashcollector) which also collects the necessary information when a build is generated. The crashcollector is able to generate backtraces based on byproducts from the build process. However, sometimes it is useful to load up a crash from Windows in Visual Studio because it can sometimes do a better job of generating a stack trace and frequently gives more detailed information about local variables.

Debugging a Minidump

You need three things to debug a minidump:

  • The minidump itself. Grab it from wherever you store crash reports, or for Sirikata releases find the minidump you're trying to debug on crashes.sirikata.com.
  • The original binaries. For a Sirikata release you just need the regular release package found at http://sirikata.com/releases/win32/
  • PDB files for the original binaries. These are found in the dbg files associated with each release. They are also at http://sirikata.com/releases/win32/ and for sirikata-x.y.z-win32.zip they will be in sirikata-x.y.z-win32.dbg.zip

The pdb files contain the debugging information -- instead of requiring you to strip the binaries, Visual Studio stores debug information in a separate file from the actual executable.

Next, setup Visual Studio to find the binaries and pdb files:

  • For the binaries, it seems like you might need them in the same location as the originals...
  • For pdb files, go to Tools -> Options ... and select the Debugging -> Symbols items from the tree on the left. Add a new item to the list and fill it in with the path to the pdb files extracted from the dbg zip files acquired in the above steps.

Finally, open the minidump file in Visual Studio and 'Run' the dump file. It should start a debugging session, associate the loaded modules with the binaries and debug symbols you just setup, and then look just as if you hit an error when debugging normally.