21#include "client/mac/handler/exception_handler.h"
23#include "client/linux/handler/exception_handler.h"
39 fprintf(stderr,
"Failed to start handler: %s\n", strerror(errno));
52 std::stringstream stream;
54 std::size_t parameterIndex = 0;
55 std::size_t parametersCount = parameters.size();
56 for (
auto& pair : parameters)
58 stream << pair.first.c_str() <<
"=\"" << pair.second.c_str() <<
"\"";
60 if (parameterIndex < parametersCount)
70 if(src.length() < destsz)
72 memcpy(dest, src.c_str(), src.length());
73 dest[src.length()] =
'\0';
81 static constexpr size_t MaxDumpPathLength{ 4096 };
82 static char DumpPath[MaxDumpPathLength];
84 bool DumpCallback(
const char* dump_dir,
const char* minidump_id,
void* context,
bool succeeded)
88 const int PathDumpLength = strlen(dump_dir) + strlen(
"/") + strlen(minidump_id) + strlen(
".dmp");
89 if(PathDumpLength < MaxDumpPathLength)
91 strcpy(DumpPath, dump_dir);
92 strcat(DumpPath,
"/");
93 strcat(DumpPath, minidump_id);
94 strcat(DumpPath,
".dmp");
96 return SendReport(crashReportContext, DumpPath);
103 bool DumpCallback(
const google_breakpad::MinidumpDescriptor& descriptor,
void* context,
bool succeeded)
108 return SendReport(crashReportContext, descriptor.path());
136 static auto handler =
new google_breakpad::ExceptionHandler(
145 google_breakpad::MinidumpDescriptor descriptor(databasePath);
146 static auto handler =
new google_breakpad::ExceptionHandler(
This object is for internal usage.
char mParameters[MaxBufferLength]
bool SetParameters(const std::map< std::string, std::string > &p)
bool SetReportURL(const std::string &url)
char mSenderPath[MaxBufferLength]
bool SetSenderPathUTF8(const std::string &path)
char mReportURL[MaxBufferLength]
static constexpr size_t MaxBufferLength
void StartHandler(const std::string &databasePath)
std::string StringifyParameters(const std::map< std::string, std::string > ¶meters)
bool DumpCallback(const google_breakpad::MinidumpDescriptor &descriptor, void *context, bool succeeded)
bool StrcpyChecked(char *dest, size_t destsz, const std::string &src)
AuthorizationHandler handler
bool SendReport(CrashReportContext *c, const char *minidumpPath)