summaryrefslogtreecommitdiff
path: root/bfd/minidump-format/minidump_exception_linux.h
blob: 132d23f6a84b0e676d76eebceb65cd52a3510000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/* Header file for the format of Windows minidumps.
   Copyright (C) 2020 Free Software Foundation, Inc.
   Written by Google LLC.
   Relicensed with permission, original at:
   https://source.chromium.org/chromium/chromium/src/+/master:third_party/breakpad/breakpad/src/google_breakpad/common

   This file is part of BFD, the Binary File Descriptor library.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */

/* minidump_exception_linux.h: A definition of exception codes for
 * Linux
 *
 * (This is C99 source, please don't corrupt it with C++.)
 *
 * Author: Mark Mentovai
 * Split into its own file: Neal Sidhwaney */
 

#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__
#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__

#include <stddef.h>

#include "breakpad_types.h"


/* 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 */
  MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED = 0xFFFFFFFF /* No exception,
                                                       dump requested. */
} MDExceptionCodeLinux;

/* For (MDException).exception_flags.  These values come from
 * asm-generic/siginfo.h.
 */
typedef enum {
  /* SIGILL */
  MD_EXCEPTION_FLAG_LIN_ILL_ILLOPC = 1,
  MD_EXCEPTION_FLAG_LIN_ILL_ILLOPN = 2,
  MD_EXCEPTION_FLAG_LIN_ILL_ILLADR = 3,
  MD_EXCEPTION_FLAG_LIN_ILL_ILLTRP = 4,
  MD_EXCEPTION_FLAG_LIN_ILL_PRVOPC = 5,
  MD_EXCEPTION_FLAG_LIN_ILL_PRVREG = 6,
  MD_EXCEPTION_FLAG_LIN_ILL_COPROC = 7,
  MD_EXCEPTION_FLAG_LIN_ILL_BADSTK = 8,

  /* SIGFPE */
  MD_EXCEPTION_FLAG_LIN_FPE_INTDIV = 1,
  MD_EXCEPTION_FLAG_LIN_FPE_INTOVF = 2,
  MD_EXCEPTION_FLAG_LIN_FPE_FLTDIV = 3,
  MD_EXCEPTION_FLAG_LIN_FPE_FLTOVF = 4,
  MD_EXCEPTION_FLAG_LIN_FPE_FLTUND = 5,
  MD_EXCEPTION_FLAG_LIN_FPE_FLTRES = 6,
  MD_EXCEPTION_FLAG_LIN_FPE_FLTINV = 7,
  MD_EXCEPTION_FLAG_LIN_FPE_FLTSUB = 8,

  /* SIGSEGV */
  MD_EXCEPTION_FLAG_LIN_SEGV_MAPERR = 1,
  MD_EXCEPTION_FLAG_LIN_SEGV_ACCERR = 2,
  MD_EXCEPTION_FLAG_LIN_SEGV_BNDERR = 3,
  MD_EXCEPTION_FLAG_LIN_SEGV_PKUERR = 4,

  /* SIGBUS */
  MD_EXCEPTION_FLAG_LIN_BUS_ADRALN = 1,
  MD_EXCEPTION_FLAG_LIN_BUS_ADRERR = 2,
  MD_EXCEPTION_FLAG_LIN_BUS_OBJERR = 3,
  MD_EXCEPTION_FLAG_LIN_BUS_MCEERR_AR = 4,
  MD_EXCEPTION_FLAG_LIN_BUS_MCEERR_AO = 5,
} MDExceptionFlagLinux;

#endif  /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ */