src/crashCatcher.cc

changeset 779
23130cafe95e
parent 778
0ed96169b8c0
child 789
4b7306f52bb5
equal deleted inserted replaced
778:0ed96169b8c0 779:23130cafe95e
21 #include <QProcess> 21 #include <QProcess>
22 #include <QTemporaryFile> 22 #include <QTemporaryFile>
23 #include <unistd.h> 23 #include <unistd.h>
24 #include <signal.h> 24 #include <signal.h>
25 #include "crashCatcher.h" 25 #include "crashCatcher.h"
26 #include "basics.h"
27 #include "dialogs.h"
28 26
29 #ifdef Q_OS_LINUX 27 #ifdef Q_OS_LINUX
30 # include <sys/prctl.h> 28 # include <sys/prctl.h>
31 #endif 29 #endif
32 30
150 // signal handler, which will cause the usual bomb box with GDB diagnostics. 148 // signal handler, which will cause the usual bomb box with GDB diagnostics.
151 // Said prompt will embed the assertion failure information. 149 // Said prompt will embed the assertion failure information.
152 // 150 //
153 void assertionFailure (const char* file, int line, const char* funcname, const char* expr) 151 void assertionFailure (const char* file, int line, const char* funcname, const char* expr)
154 { 152 {
155 String errmsg = format ( 153 #ifdef __unix__
154 g_assertionFailure = format ("%1:%2: %3: %4", file, line, funcname, expr);
155 #else
156 bombBox (format (
156 "<p><b>File</b>: <tt>%1</tt><br />" 157 "<p><b>File</b>: <tt>%1</tt><br />"
157 "<b>Line</b>: <tt>%2</tt><br />" 158 "<b>Line</b>: <tt>%2</tt><br />"
158 "<b>Function:</b> <tt>%3</tt></p>" 159 "<b>Function:</b> <tt>%3</tt></p>"
159 "<p>Assertion <b><tt>`%4'</tt></b> failed.</p>", 160 "<p>Assertion <b><tt>`%4'</tt></b> failed.</p>",
160 file, line, funcname, expr); 161 file, line, funcname, expr));
161
162 g_assertionFailure = errmsg;
163
164 #ifndef __unix__
165 bombBox (errmsg);
166 #endif 162 #endif
167 163
168 abort(); 164 abort();
169 } 165 }

mercurial