#include "qplatformdefs.h"
#include "private/qcrashhandler_p.h"
#include "qbytearray.h"
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
Go to the source code of this file.
◆ backtrace_command()
static bool backtrace_command |
( |
FILE * |
outb, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
|
static |
Definition at line 114 of file qcrashhandler.cpp.
Referenced by print_backtrace().
136 if(FILE *inb = popen(foo,
"r")) {
138 int len = fread(buffer, 1,
sizeof(buffer), inb);
142 fwrite(
"Output from ", 1, strlen(
"Output from "), outb);
144 fwrite(cmd, 1, strlen(cmd), outb);
145 fwrite(
"\n", 1, 1, outb);
148 fwrite(buffer, 1, len, outb);
int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap)
A portable vsnprintf() function.
◆ init_backtrace()
static void init_backtrace |
( |
char ** |
argv, |
|
|
int |
argc |
|
) |
| |
|
static |
◆ print_backtrace()
static void print_backtrace |
( |
FILE * |
outb | ) |
|
|
static |
Definition at line 161 of file qcrashhandler.cpp.
Referenced by qt_signal_handler().
168 #if defined(Q_OS_AIX) 183 #elif defined(Q_OS_FREEBSD) 193 "shell kill -CONT %d\n" 198 #elif defined(Q_OS_HPUX) 224 #elif defined(Q_OS_IRIX) 232 #
if !defined(__GNUC__)
241 # if defined(USE_LIBEXC) 242 if(trace_back_stack_and_print())
262 #elif defined(Q_OS_OSF) 278 #elif defined(Q_OS_SCO) 303 #elif defined(Q_OS_SOLARIS) 342 #elif defined(Q_OS_INTEGRITY) 344 CheckSuccess(Failure);
350 # if !defined(__GNUC__) 378 const char debug_err[] =
"No debugger found\n";
379 fwrite(debug_err, strlen(debug_err), 1, outb);
static char * globalProgName
static bool backtrace_command(FILE *outb, const char *format,...)
◆ qt_signal_handler()
void qt_signal_handler |
( |
int |
sig | ) |
|
Definition at line 385 of file qcrashhandler.cpp.
387 signal(sig, SIG_DFL);
389 (*QSegfaultHandler::callback)();
393 if(
char *crash_loc = ::getenv(
"QT_CRASH_OUTPUT")) {
394 if(FILE *new_outb = fopen(crash_loc,
"w")) {
395 fprintf(stderr,
"Crash (backtrace written to %s)!!!\n", crash_loc);
399 fprintf(outb,
"Crash!!!\n");
static QtCrashHandler callback
static void print_backtrace(FILE *outb)
◆ globalProgName
char* globalProgName = NULL |
|
static |