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