dump_syms
, symupload
and minidump_stackwalk
that provide developers with function names, file names, and line numbers in their crash reports. Integrating with Crashpad helps software engineers find and fix program crashes in order to develop more stable applications.depot_tools
and add the tools to your system PATH variable. Be sure to change /path/to/depot_tools
to the path where you cloned depot_tools.gclient
instead of git submodules, so it is best to use fetch
to get the source code.gn
to generate ninja
build files.gn
generates a configuration for building static libraries. If you would like to build dynamic libraries see this post on Stack Overflow.out/Default/obj/client/libcommon.a
, out/Default/obj/client/libclient.a
, out/Default/obj/util/libutil.a
, and out/Default/obj/third_party/mini_chromium/mini_chromium/base/libbase.a
.out/Default/obj/out/Default/gen/util/mach
as well.libbase.a
needs to be the last Crashpad file specified in the build arguments or the application will not build.~/crashpad/crashpad
and ~/crashpad/crashpad/third_party/mini_chromium/mini_chromium
need to be added as include directories.out/Default/crashpad_handler
needs to be deployed with the application and accessible at runtime.out\Default\obj\client\common.lib
, out\Default\obj\client\client.lib
, out\Default\obj\util\util.lib
, and out\Default\obj\third_party\mini_chromium\mini_chromium\base\base.lib.
out\Default\crashpad_handler.exe
needs to be deployed with the application and accessible at runtime.StringType
, add using statements for the base
, crashpad
and std
namespace and declare the following methods at the top of the entry point of the application.initializeCrashpad
method replacing the file paths with valid values.getExecutableDir
method.initializeCrashpad
method at the entry point of the application.src/src/tools/mac/dump_syms/dump_syms.xcodeproj
. Switch the configuration to dump_syms and build the project. The report navigator tab (icon looks like a chat bubble in Xcode 11) will show the file system location with the compiled executable. Run the dump_syms executable.clang
this means building with the -g
and -Wl,--build-id
arguments../configure && make
in the Breakpad directory. This will generate dump_syms
, symupload
and minidump_stackwalk
.symupload
utility and can be skipped if the application will be symbolicated remotely. Run dump_syms
only if the application will be symbolicated locally or the sym file will be uploaded to a remote server via some means other than symupload.dump_syms.exe
to generate the correct output, applications must be built with symbolic information so that each exe and dll file generates a corresponding pdb file. Generated pdb files must contain full debug information. With Visual Studio, full debug information can be generated with the /Zi
compiler argument and the /DEBUG:FULL
linker argument. Failure to specify either the /Zi
or /DEBUG:FULL
arguments will result in dump_syms outputting incorrect sym file data. Additionally the output pdb file must be in the same folder as the corresponding exe or dll file otherwise dump_syms.exe will fail.msdia140.dll
must be placed in the same folder. If Visual Studio is installed this file can be found at [VisualStudioFolder]\DIA SDK\bin\amd64\msdia140.dll
. Copy msdia140.dll into the same folder as dump_syms.exe and run dump_syms.exe.dump_syms
clone the gyp repository and run python setup.py install
. Next, run gyp ~\breakpad\src\tools\windows\dump_syms\dump_syms.gyp
and use Visual Studio to build the sln file generated by gyp. If the build fails with an error that unique_pointer is not part of std add #include <memory>
to the top of the file that contains the error and rebuild.symupload
tool is also part of the Breakpad repository and can be used to upload sym files to your server. Symbols need to be uploaded to a server in order for it to correctly symbolicate a minidump file.src/src/tools/mac/symupload/symupload.xcodeproj
. The report navigator tab (icon looks like a chat bubble in Xcode 11) will show you the file system location with the compiled executable. Copy the symupload file into your project and run the executable wrapping the arguments to symupload in quotes./Zi
compiler argument and the /DEBUG:FULL
linker argument. Failure to specify either the /Zi
or /DEBUG:FULL
arguments will result in symupload failing entirely. The output pdb file must be in the same folder as the corresponding exe or dll file.msdia140.dll
must be placed in the same folder. If Visual Studio is installed this file can be found at [VisualStudioFolder]\DIA SDK\bin\amd64\msdia140.dll
. Copy msdia140.dll into the same folder as symupload.exe and run symupload.exe.python setup.py install
. Next, run gyp ~\breakpad\src\tools\windows\symupload\symupload.gyp
and use Visual Studio to build the sln file generated by gyp. If the build fails with an error that unique_pointer is not part of std add #include <memory>
to the top of the file that contains the error and rebuild.Minidump_stackwalk
is another tool in the Breakpad repository that is responsible for the symbolication of minidump files. In order to correctly symbolicate minidumps, sym files need to be nested at least 2 folders deep. The topmost parent folderโs name must equal the sym files module name. The first child folderโs name must equal the module id. Additionally, the sym file name must also match the module name. The module id and module name can be found in the module record of the sym file.myApp
with the module id 1A67F3DEAACA3B209D9992871B2620AA0
must be located at /path/to/symbols/myApp/1A67F3DEAACA3B209D9992871B2620AA0/myApp.sym
.minidump_stackwalk
passing it a path to a dmp file and a path to a symbols directory. The folders in the symbols directory need to be laid out following the pattern module_name/module_id/module_name.sym
:processor
sln which is generated by gyp
processor.sln
file will not build on Windows 10 with Visual Studio 2019. However, minidumps generated on the Windows platform can be symbolicated on macOS or by a 3rd party service such as BugSplat. Additionally, minidumps generated by the Crashpad library can also be symbolicated via Debugging Tools for Windows given the .exe
, .dll
and .pdb
files are made available to WinDBG.dump_syms
and symupload
are run. Every time an executable is modified dump_syms
and symupload
need to be re-run. The name and id of the module loaded at runtime can be found in the minidump_stackwalk
output. The module name and id must match the module name and id of the generated sym file in order for minidump_stackwalk
to correctly symbolicate the minidump file.