|
Lines 210-220
QStringList backtrace_symbols_win(void**, int){
Link Here
|
| 210 |
|
210 |
|
| 211 |
void print_backtrace(const SimulatedCPU& state, const QString& message){ |
211 |
void print_backtrace(const SimulatedCPU& state, const QString& message){ |
| 212 |
#ifdef Q_WS_WIN |
212 |
#ifdef Q_WS_WIN |
| 213 |
qDebug(qPrintable(message)); |
213 |
qDebug("%s", qPrintable(message)); |
| 214 |
#define PRINT(...) do { qDebug(__VA_ARGS__); if (logFile) fprintf(logFile, __VA_ARGS__); } while (0) |
214 |
#define PRINT(...) do { qDebug(__VA_ARGS__); if (logFile) fprintf(logFile, __VA_ARGS__); } while (0) |
| 215 |
#else |
215 |
#else |
| 216 |
fprintf(stderr, "%s\n", qPrintable(message)); |
216 |
fprintf(stderr, "%s\n", qPrintable(message)); |
| 217 |
qDebug(qPrintable(message)); |
217 |
qDebug("%s", qPrintable(message)); |
| 218 |
#define PRINT(...) do { fprintf(stderr, __VA_ARGS__); qDebug(__VA_ARGS__); if (logFile) fprintf(logFile, __VA_ARGS__); } while (0) |
218 |
#define PRINT(...) do { fprintf(stderr, __VA_ARGS__); qDebug(__VA_ARGS__); if (logFile) fprintf(logFile, __VA_ARGS__); } while (0) |
| 219 |
#endif |
219 |
#endif |
| 220 |
static int count = 0; |
220 |
static int count = 0; |
|
Lines 1077-1083
void Guardian::run(){
Link Here
|
| 1077 |
while (running) { |
1077 |
while (running) { |
| 1078 |
int slowOperationWait = slowOperations * 15; |
1078 |
int slowOperationWait = slowOperations * 15; |
| 1079 |
do { |
1079 |
do { |
| 1080 |
sleep(4); |
1080 |
sleep(10); |
| 1081 |
slowOperationWait -= 1; |
1081 |
slowOperationWait -= 1; |
| 1082 |
} while (slowOperationWait >= 0); |
1082 |
} while (slowOperationWait >= 0); |
| 1083 |
|
1083 |
|
|
Lines 1091-1097
void Guardian::run(){
Link Here
|
| 1091 |
if (lastTick == mainEventLoopTicks) errors++; |
1091 |
if (lastTick == mainEventLoopTicks) errors++; |
| 1092 |
else errors = 0; |
1092 |
else errors = 0; |
| 1093 |
lastTick = mainEventLoopTicks; |
1093 |
lastTick = mainEventLoopTicks; |
| 1094 |
if (errors >= 10) { |
1094 |
if (errors >= 60) { |
| 1095 |
fprintf(stderr, "Main thread in trouble\n"); |
1095 |
fprintf(stderr, "Main thread in trouble\n"); |
| 1096 |
#ifdef HAS_DEBUGGER_PRESENT |
1096 |
#ifdef HAS_DEBUGGER_PRESENT |
| 1097 |
if (IsDebuggerPresent()) return; |
1097 |
if (IsDebuggerPresent()) return; |
|
Lines 1103-1109
void Guardian::run(){
Link Here
|
| 1103 |
if (repetitions > 50) break; //give up for now |
1103 |
if (repetitions > 50) break; //give up for now |
| 1104 |
} |
1104 |
} |
| 1105 |
if (repetitions < 50) //recovered |
1105 |
if (repetitions < 50) //recovered |
| 1106 |
errors = 0; |
1106 |
errors -= 6 ; //wait 1 min now |
| 1107 |
//if (repetitions < 50) return; the crash handler can't be debugged, if this thread continues calling it |
1107 |
//if (repetitions < 50) return; the crash handler can't be debugged, if this thread continues calling it |
| 1108 |
} |
1108 |
} |
| 1109 |
} |
1109 |
} |