issue 185 - Need constants / stringification for Linux exception codes. r=mento

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@189 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ted.mielczarek 2007-06-11 17:03:30 +00:00
parent 21d58c7281
commit b5c78cc8d1
2 changed files with 140 additions and 1 deletions

View File

@ -665,7 +665,8 @@ static const size_t MDRawMemoryList_minsize = offsetof(MDRawMemoryList,
typedef struct {
u_int32_t exception_code; /* Windows: MDExceptionCodeWin,
* Mac OS X: MDExceptionMac. */
* Mac OS X: MDExceptionMac,
* Linux: MDExceptionCodeLinux. */
u_int32_t exception_flags; /* Windows: 1 if noncontinuable,
Mac OS X: MDExceptionCodeMac. */
u_int64_t exception_record; /* Address (in the minidump-producing host's
@ -881,6 +882,43 @@ typedef enum {
/* EXC_I386_ENDPERR = 33: should not occur */
} MDExceptionCodeMac;
/* For (MDException).exception_code. These values come from bits/signum.h.
*/
typedef enum {
MD_EXCEPTION_CODE_LIN_SIGHUP = 1, /* Hangup (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGINT = 2, /* Interrupt (ANSI) */
MD_EXCEPTION_CODE_LIN_SIGQUIT = 3, /* Quit (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGILL = 4, /* Illegal instruction (ANSI) */
MD_EXCEPTION_CODE_LIN_SIGTRAP = 5, /* Trace trap (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGABRT = 6, /* Abort (ANSI) */
MD_EXCEPTION_CODE_LIN_SIGBUS = 7, /* BUS error (4.2 BSD) */
MD_EXCEPTION_CODE_LIN_SIGFPE = 8, /* Floating-point exception (ANSI) */
MD_EXCEPTION_CODE_LIN_SIGKILL = 9, /* Kill, unblockable (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGUSR1 = 10, /* User-defined signal 1 (POSIX). */
MD_EXCEPTION_CODE_LIN_SIGSEGV = 11, /* Segmentation violation (ANSI) */
MD_EXCEPTION_CODE_LIN_SIGUSR2 = 12, /* User-defined signal 2 (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGPIPE = 13, /* Broken pipe (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGALRM = 14, /* Alarm clock (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGTERM = 15, /* Termination (ANSI) */
MD_EXCEPTION_CODE_LIN_SIGSTKFLT = 16, /* Stack faultd */
MD_EXCEPTION_CODE_LIN_SIGCHLD = 17, /* Child status has changed (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGCONT = 18, /* Continue (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGSTOP = 19, /* Stop, unblockable (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGTSTP = 20, /* Keyboard stop (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGTTIN = 21, /* Background read from tty (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGTTOU = 22, /* Background write to tty (POSIX) */
MD_EXCEPTION_CODE_LIN_SIGURG = 23,
/* Urgent condition on socket (4.2 BSD) */
MD_EXCEPTION_CODE_LIN_SIGXCPU = 24, /* CPU limit exceeded (4.2 BSD) */
MD_EXCEPTION_CODE_LIN_SIGXFSZ = 25,
/* File size limit exceeded (4.2 BSD) */
MD_EXCEPTION_CODE_LIN_SIGVTALRM = 26, /* Virtual alarm clock (4.2 BSD) */
MD_EXCEPTION_CODE_LIN_SIGPROF = 27, /* Profiling alarm clock (4.2 BSD) */
MD_EXCEPTION_CODE_LIN_SIGWINCH = 28, /* Window size change (4.3 BSD, Sun) */
MD_EXCEPTION_CODE_LIN_SIGIO = 29, /* I/O now possible (4.2 BSD) */
MD_EXCEPTION_CODE_LIN_SIGPWR = 30, /* Power failure restart (System V) */
MD_EXCEPTION_CODE_LIN_SIGSYS = 31 /* Bad system call */
} MDExceptionCodeLinux;
typedef struct {
u_int32_t thread_id; /* Thread in which the exception

View File

@ -731,6 +731,107 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, u_int64_t *address) {
break;
}
break;
case MD_OS_LINUX:
switch (exception_code) {
case MD_EXCEPTION_CODE_LIN_SIGHUP:
reason = "SIGHUP";
break;
case MD_EXCEPTION_CODE_LIN_SIGINT:
reason = "SIGINT";
break;
case MD_EXCEPTION_CODE_LIN_SIGQUIT:
reason = "SIGQUIT";
break;
case MD_EXCEPTION_CODE_LIN_SIGILL:
reason = "SIGILL";
break;
case MD_EXCEPTION_CODE_LIN_SIGTRAP:
reason = "SIGTRAP";
break;
case MD_EXCEPTION_CODE_LIN_SIGABRT:
reason = "SIGABRT";
break;
case MD_EXCEPTION_CODE_LIN_SIGBUS:
reason = "SIGBUS";
break;
case MD_EXCEPTION_CODE_LIN_SIGFPE:
reason = "SIGFPE";
break;
case MD_EXCEPTION_CODE_LIN_SIGKILL:
reason = "SIGKILL";
break;
case MD_EXCEPTION_CODE_LIN_SIGUSR1:
reason = "SIGUSR1";
break;
case MD_EXCEPTION_CODE_LIN_SIGSEGV:
reason = "SIGSEGV";
break;
case MD_EXCEPTION_CODE_LIN_SIGUSR2:
reason = "SIGUSR2";
break;
case MD_EXCEPTION_CODE_LIN_SIGPIPE:
reason = "SIGPIPE";
break;
case MD_EXCEPTION_CODE_LIN_SIGALRM:
reason = "SIGALRM";
break;
case MD_EXCEPTION_CODE_LIN_SIGTERM:
reason = "SIGTERM";
break;
case MD_EXCEPTION_CODE_LIN_SIGSTKFLT:
reason = "SIGSTKFLT";
break;
case MD_EXCEPTION_CODE_LIN_SIGCHLD:
reason = "SIGCHLD";
break;
case MD_EXCEPTION_CODE_LIN_SIGCONT:
reason = "SIGCONT";
break;
case MD_EXCEPTION_CODE_LIN_SIGSTOP:
reason = "SIGSTOP";
break;
case MD_EXCEPTION_CODE_LIN_SIGTSTP:
reason = "SIGTSTP";
break;
case MD_EXCEPTION_CODE_LIN_SIGTTIN:
reason = "SIGTTIN";
break;
case MD_EXCEPTION_CODE_LIN_SIGTTOU:
reason = "SIGTTOU";
break;
case MD_EXCEPTION_CODE_LIN_SIGURG:
reason = "SIGURG";
break;
case MD_EXCEPTION_CODE_LIN_SIGXCPU:
reason = "SIGXCPU";
break;
case MD_EXCEPTION_CODE_LIN_SIGXFSZ:
reason = "SIGXFSZ";
break;
case MD_EXCEPTION_CODE_LIN_SIGVTALRM:
reason = "SIGVTALRM";
break;
case MD_EXCEPTION_CODE_LIN_SIGPROF:
reason = "SIGPROF";
break;
case MD_EXCEPTION_CODE_LIN_SIGWINCH:
reason = "SIGWINCH";
break;
case MD_EXCEPTION_CODE_LIN_SIGIO:
reason = "SIGIO";
break;
case MD_EXCEPTION_CODE_LIN_SIGPWR:
reason = "SIGPWR";
break;
case MD_EXCEPTION_CODE_LIN_SIGSYS:
reason = "SIGSYS";
break;
default:
BPLOG(INFO) << "Unknown exception reason " << reason;
break;
}
break;
}
default: {