• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2006, Google Inc.
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  *     * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *     * Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following disclaimer
12  * in the documentation and/or other materials provided with the
13  * distribution.
14  *     * Neither the name of Google Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
29 
30 /* minidump_exception_linux.h: A definition of exception codes for
31  * Linux
32  *
33  * (This is C99 source, please don't corrupt it with C++.)
34  *
35  * Author: Mark Mentovai
36  * Split into its own file: Neal Sidhwaney */
37 
38 
39 #ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__
40 #define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__
41 
42 #include <stddef.h>
43 
44 #include "google_breakpad/common/breakpad_types.h"
45 
46 
47 /* For (MDException).exception_code.  These values come from bits/signum.h.
48  */
49 typedef enum {
50   MD_EXCEPTION_CODE_LIN_SIGHUP = 1,      /* Hangup (POSIX) */
51   MD_EXCEPTION_CODE_LIN_SIGINT = 2,      /* Interrupt (ANSI) */
52   MD_EXCEPTION_CODE_LIN_SIGQUIT = 3,     /* Quit (POSIX) */
53   MD_EXCEPTION_CODE_LIN_SIGILL = 4,      /* Illegal instruction (ANSI) */
54   MD_EXCEPTION_CODE_LIN_SIGTRAP = 5,     /* Trace trap (POSIX) */
55   MD_EXCEPTION_CODE_LIN_SIGABRT = 6,     /* Abort (ANSI) */
56   MD_EXCEPTION_CODE_LIN_SIGBUS = 7,      /* BUS error (4.2 BSD) */
57   MD_EXCEPTION_CODE_LIN_SIGFPE = 8,      /* Floating-point exception (ANSI) */
58   MD_EXCEPTION_CODE_LIN_SIGKILL = 9,     /* Kill, unblockable (POSIX) */
59   MD_EXCEPTION_CODE_LIN_SIGUSR1 = 10,    /* User-defined signal 1 (POSIX).  */
60   MD_EXCEPTION_CODE_LIN_SIGSEGV = 11,    /* Segmentation violation (ANSI) */
61   MD_EXCEPTION_CODE_LIN_SIGUSR2 = 12,    /* User-defined signal 2 (POSIX) */
62   MD_EXCEPTION_CODE_LIN_SIGPIPE = 13,    /* Broken pipe (POSIX) */
63   MD_EXCEPTION_CODE_LIN_SIGALRM = 14,    /* Alarm clock (POSIX) */
64   MD_EXCEPTION_CODE_LIN_SIGTERM = 15,    /* Termination (ANSI) */
65   MD_EXCEPTION_CODE_LIN_SIGSTKFLT = 16,  /* Stack faultd */
66   MD_EXCEPTION_CODE_LIN_SIGCHLD = 17,    /* Child status has changed (POSIX) */
67   MD_EXCEPTION_CODE_LIN_SIGCONT = 18,    /* Continue (POSIX) */
68   MD_EXCEPTION_CODE_LIN_SIGSTOP = 19,    /* Stop, unblockable (POSIX) */
69   MD_EXCEPTION_CODE_LIN_SIGTSTP = 20,    /* Keyboard stop (POSIX) */
70   MD_EXCEPTION_CODE_LIN_SIGTTIN = 21,    /* Background read from tty (POSIX) */
71   MD_EXCEPTION_CODE_LIN_SIGTTOU = 22,    /* Background write to tty (POSIX) */
72   MD_EXCEPTION_CODE_LIN_SIGURG = 23,
73     /* Urgent condition on socket (4.2 BSD) */
74   MD_EXCEPTION_CODE_LIN_SIGXCPU = 24,    /* CPU limit exceeded (4.2 BSD) */
75   MD_EXCEPTION_CODE_LIN_SIGXFSZ = 25,
76     /* File size limit exceeded (4.2 BSD) */
77   MD_EXCEPTION_CODE_LIN_SIGVTALRM = 26,  /* Virtual alarm clock (4.2 BSD) */
78   MD_EXCEPTION_CODE_LIN_SIGPROF = 27,    /* Profiling alarm clock (4.2 BSD) */
79   MD_EXCEPTION_CODE_LIN_SIGWINCH = 28,   /* Window size change (4.3 BSD, Sun) */
80   MD_EXCEPTION_CODE_LIN_SIGIO = 29,      /* I/O now possible (4.2 BSD) */
81   MD_EXCEPTION_CODE_LIN_SIGPWR = 30,     /* Power failure restart (System V) */
82   MD_EXCEPTION_CODE_LIN_SIGSYS = 31,     /* Bad system call */
83   MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED = 0xFFFFFFFF /* No exception,
84                                                        dump requested. */
85 } MDExceptionCodeLinux;
86 
87 /* For (MDException).exception_flags.  These values come from
88  * asm-generic/siginfo.h.
89  */
90 typedef enum {
91   /* SIGILL */
92   MD_EXCEPTION_FLAG_LIN_ILL_ILLOPC = 1,
93   MD_EXCEPTION_FLAG_LIN_ILL_ILLOPN = 2,
94   MD_EXCEPTION_FLAG_LIN_ILL_ILLADR = 3,
95   MD_EXCEPTION_FLAG_LIN_ILL_ILLTRP = 4,
96   MD_EXCEPTION_FLAG_LIN_ILL_PRVOPC = 5,
97   MD_EXCEPTION_FLAG_LIN_ILL_PRVREG = 6,
98   MD_EXCEPTION_FLAG_LIN_ILL_COPROC = 7,
99   MD_EXCEPTION_FLAG_LIN_ILL_BADSTK = 8,
100 
101   /* SIGFPE */
102   MD_EXCEPTION_FLAG_LIN_FPE_INTDIV = 1,
103   MD_EXCEPTION_FLAG_LIN_FPE_INTOVF = 2,
104   MD_EXCEPTION_FLAG_LIN_FPE_FLTDIV = 3,
105   MD_EXCEPTION_FLAG_LIN_FPE_FLTOVF = 4,
106   MD_EXCEPTION_FLAG_LIN_FPE_FLTUND = 5,
107   MD_EXCEPTION_FLAG_LIN_FPE_FLTRES = 6,
108   MD_EXCEPTION_FLAG_LIN_FPE_FLTINV = 7,
109   MD_EXCEPTION_FLAG_LIN_FPE_FLTSUB = 8,
110 
111   /* SIGSEGV */
112   MD_EXCEPTION_FLAG_LIN_SEGV_MAPERR = 1,
113   MD_EXCEPTION_FLAG_LIN_SEGV_ACCERR = 2,
114   MD_EXCEPTION_FLAG_LIN_SEGV_BNDERR = 3,
115   MD_EXCEPTION_FLAG_LIN_SEGV_PKUERR = 4,
116 
117   /* SIGBUS */
118   MD_EXCEPTION_FLAG_LIN_BUS_ADRALN = 1,
119   MD_EXCEPTION_FLAG_LIN_BUS_ADRERR = 2,
120   MD_EXCEPTION_FLAG_LIN_BUS_OBJERR = 3,
121   MD_EXCEPTION_FLAG_LIN_BUS_MCEERR_AR = 4,
122   MD_EXCEPTION_FLAG_LIN_BUS_MCEERR_AO = 5,
123 } MDExceptionFlagLinux;
124 
125 #endif  /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ */
126