mirror of
https://github.com/Fishwaldo/qt-openzwave.git
synced 2025-07-06 21:28:18 +00:00
tidy up error output
This commit is contained in:
parent
6cb3c1e338
commit
4424fcfa08
1 changed files with 12 additions and 7 deletions
|
@ -28,6 +28,10 @@ void backtrace(int sig = 0)
|
||||||
unw_cursor_t cursor;
|
unw_cursor_t cursor;
|
||||||
unw_context_t context;
|
unw_context_t context;
|
||||||
|
|
||||||
|
qWarning() << "=============================";
|
||||||
|
qWarning() << "CRASH!!! - Dumping Backtrace:";
|
||||||
|
qWarning() << "=============================";
|
||||||
|
|
||||||
unw_getcontext(&context);
|
unw_getcontext(&context);
|
||||||
unw_init_local(&cursor, &context);
|
unw_init_local(&cursor, &context);
|
||||||
|
|
||||||
|
@ -46,14 +50,14 @@ void backtrace(int sig = 0)
|
||||||
if ( (name = abi::__cxa_demangle(symbol, NULL, NULL, &status)) == 0 )
|
if ( (name = abi::__cxa_demangle(symbol, NULL, NULL, &status)) == 0 )
|
||||||
name = symbol;
|
name = symbol;
|
||||||
}
|
}
|
||||||
|
char message[1024];
|
||||||
printf("#%-2d 0x%016" PRIxPTR " sp=0x%016" PRIxPTR " %s + 0x%" PRIxPTR "\n",
|
snprintf(message, sizeof(message), "#%-2d 0x%016" PRIxPTR " sp=0x%016" PRIxPTR " %s + 0x%" PRIxPTR,
|
||||||
++n,
|
++n,
|
||||||
static_cast<uintptr_t>(ip),
|
static_cast<uintptr_t>(ip),
|
||||||
static_cast<uintptr_t>(sp),
|
static_cast<uintptr_t>(sp),
|
||||||
name,
|
name,
|
||||||
static_cast<uintptr_t>(off));
|
static_cast<uintptr_t>(off));
|
||||||
|
qWarning() << message;
|
||||||
if ( name != symbol )
|
if ( name != symbol )
|
||||||
free(name);
|
free(name);
|
||||||
}
|
}
|
||||||
|
@ -67,8 +71,7 @@ void crash() { volatile int* a = (int*)(NULL); *a = 1; }
|
||||||
#ifdef HAVE_BP
|
#ifdef HAVE_BP
|
||||||
static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
|
static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
|
||||||
void* context, bool succeeded) {
|
void* context, bool succeeded) {
|
||||||
Q_UNUSED(context);
|
backtrace();
|
||||||
printf("Dump path: %s\n", descriptor.path());
|
|
||||||
if (succeeded == true) {
|
if (succeeded == true) {
|
||||||
std::map<string, string> parameters;
|
std::map<string, string> parameters;
|
||||||
std::map<string, string> files;
|
std::map<string, string> files;
|
||||||
|
@ -89,9 +92,11 @@ void* context, bool succeeded) {
|
||||||
|
|
||||||
std::string response, error;
|
std::string response, error;
|
||||||
bool success = google_breakpad::HTTPUpload::SendRequest(url, parameters, files, proxy_host, proxy_userpasswd, "", &response, NULL, &error);
|
bool success = google_breakpad::HTTPUpload::SendRequest(url, parameters, files, proxy_host, proxy_userpasswd, "", &response, NULL, &error);
|
||||||
printf("%d - %s\n", success, response.c_str());
|
if (success)
|
||||||
|
qWarning() << "Uploaded Crash minidump With ID: " << response.c_str();
|
||||||
|
else
|
||||||
|
qWarning() << "Failed to Upload Crash MiniDump in " << descriptor.path();
|
||||||
}
|
}
|
||||||
backtrace();
|
|
||||||
return succeeded;
|
return succeeded;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue