Mendeley's additions to breakpad include:
A CMake-based build system for the crash capturing client library, debug symbol extraction and stacktrace output (minidump_stackwalk) tools.
Support in minidump_stackwalk for fetching debug symbols from arbitrary sources by invoking a user-provided command instead of looking in a specific local filesystem directory. We use this to fetch debug symbols on-demand from an archive hosted in S3.
A python script which fetches debug symbols from a symbol server with a given HTTP URL
A simple multi-platform end-to-end test that builds a buggy app with the crash capturing library installed, extracts debug symbols from it, runs the test app and symbolizes the resulting crash dump.
Compatibility with C++11
git clone https://github.com/Mendeley/breakpad.git mkdir breakpad-build cd breakpad-build cmake ../breakpad/mendeley make
The overall flow for capturing crashes and debugging them as follows:
- Build the breakpad tools and libraries
- Link the breakpad library with your application
- Early in your app's startup code, create an instance of
google_breakpad::ExceptionHandler. This is defined separately for each platform in
- When the app crashes, it will write a .dmp file to the directory specified when the
ExceptionHandlerobject was created.
- When building a release build of your app, run the dump_syms tool on the generated DLLs and binaries to produce .sym files which contain mappings from program locations to source locations.
- Upload the .sym files to a location which is accessible via a HTTP URL. See this StackOverflow comment for details of the expected structure of the symbol server
- When your app crashes on a user's system, get the .dmp file and use minidump_stackwalk to produce a stacktrace from the .dmp file.
You can also debug the .dmp files in Visual Studio on Windows.
Getting a stacktrace from a minidump
When you have a .dmp file captured by the breakpad library after an application crashes and have uploaded it to a location accessible via a HTTP URL, you can use the minidump_stackwalk tool to extract a stack trace from the minidump.
./minidump_stackwalk -m <path to .dmp file> -e '../breakpad/mendeley/fetch-symbols.py -s <URL of your symbol server>'