Get C++ error and crash reporting with Raygun using Google Breakpad.
Breakpad is a library and tool suite that allows you to distribute an application to users with compiler-provided debugging information removed, record crashes in compact “minidump” files, send them back to your server, and produce C and C++ stack traces from these minidumps.
See the Git repository for more information on Google Breakpad
Clone the GitHub repository https://github.com/google/breakpad and link the following directories for your platform to your project:
You'll then need to enable Breakpad in your application by instantiating the ExceptionHandler object and passing it the directory path (
_dump_path_) where minidump files will be written to.
google_breakpad::ExceptionHandler *pHandler = new google_breakpad::ExceptionHandler(L"_dump_path_", 0, minidump_callback, 0, google_breakpad::ExceptionHandler::HANDLER_ALL, MiniDumpNormal, L"", 0);
The define a callback for when minidumps have been written and use the CrashReportSender class to post minidumps files to Raygun.
bool minidump_callback(const wchar_t* dump_path, const wchar_t* minidump_id, void* context, EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion, bool succeeded)
std::wstring filename = L"_dump_path_";
filename += L"\\";
filename += minidump_id;
filename += L".dmp";
std::map<std::wstring, std::wstring> files;
// At this point you may include custom data to be part of the crash report.
std::map<std::wstring, std::wstring> userCustomData;
userCustomData.insert(std::make_pair(L"desc", L"Hello World"));
sender.SendCrashReport(L"https://api.raygun.com/entries/breakpad?apikey=paste_your_api_key_here", userCustomData, files, 0);
We recommend raising a test exception from your application right now to test that everything is wired up correctly.
Upload your application symbols for Breakpad
We provide the ability to for you to upload your application symbols in the form of PDB files or Breakpad’s SYM files. After you have uploaded the symbols, any minidumps processed will use these symbols for symbolicating their stack trace.
- Inside your Raygun dashboard, navigate to the ‘Application settings’ dropdown and select ‘Breakpad center’:
- Drag and drop a “Release” mode PDB or previous generated Breakpad symbol file, or select a file to import to the Breakpad center. You can use the Breakpad tooling as part of your build toolchain to generate the symbol files yourself.