forked from Green-Sky/tomato
windows breakpad
This commit is contained in:
@@ -1,10 +1,38 @@
|
||||
#include "./breakpad_client.hpp"
|
||||
|
||||
// if linux
|
||||
#ifdef WIN32
|
||||
|
||||
bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void*, bool succeeded) {
|
||||
fprintf(stderr, "Crash detected, MiniDump written to: %s\n", descriptor.path());
|
||||
bool dumpCallback(const wchar_t* dump_path, const wchar_t* minidump_id, void* context, EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion, bool succeeded) {
|
||||
//TCHAR* text = new TCHAR[kMaximumLineLength];
|
||||
//text[0] = _T('\0');
|
||||
//int result = swprintf_s(text,
|
||||
// kMaximumLineLength,
|
||||
// TEXT("Dump generation request %s\r\n"),
|
||||
// succeeded ? TEXT("succeeded") : TEXT("failed"));
|
||||
//if (result == -1) {
|
||||
// delete [] text;
|
||||
//}
|
||||
|
||||
//QueueUserWorkItem(AppendTextWorker, text, WT_EXECUTEDEFAULT);
|
||||
|
||||
if (succeeded) {
|
||||
fprintf(stderr, "Crash detected, MiniDump written to: %ls\n", dump_path);
|
||||
} else {
|
||||
fprintf(stderr, "Crash detected, failed to write MiniDump. (path: %ls)\n", dump_path);
|
||||
}
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
// endif linux
|
||||
#else
|
||||
// linux
|
||||
|
||||
bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void*, bool succeeded) {
|
||||
if (succeeded) {
|
||||
fprintf(stderr, "Crash detected, MiniDump written to: %s\n", descriptor.path());
|
||||
} else {
|
||||
fprintf(stderr, "Crash detected, failed to write MiniDump. (path: %s)\n", descriptor.path());
|
||||
}
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user