1 //===-- OpenBSDSignals.cpp ------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "OpenBSDSignals.h"
14 #define ADD_SIGCODE(signal_name, signal_value, code_name, code_value, ...) \
15 static_assert(signal_name == signal_value, \
16 "Value mismatch for signal number " #signal_name); \
17 static_assert(code_name == code_value, \
18 "Value mismatch for signal code " #code_name); \
19 AddSignalCode(signal_value, code_value, __VA_ARGS__)
21 #define ADD_SIGCODE(signal_name, signal_value, code_name, code_value, ...) \
22 AddSignalCode(signal_value, code_value, __VA_ARGS__)
23 #endif /* ifdef __OpenBSD */
25 using namespace lldb_private
;
27 OpenBSDSignals::OpenBSDSignals() : UnixSignals() { Reset(); }
29 void OpenBSDSignals::Reset() {
34 ADD_SIGCODE(SIGILL
, 4, ILL_ILLOPC
, 1, "illegal opcode");
35 ADD_SIGCODE(SIGILL
, 4, ILL_ILLOPN
, 2, "illegal operand");
36 ADD_SIGCODE(SIGILL
, 4, ILL_ILLADR
, 3, "illegal addressing mode");
37 ADD_SIGCODE(SIGILL
, 4, ILL_ILLTRP
, 4, "illegal trap");
38 ADD_SIGCODE(SIGILL
, 4, ILL_PRVOPC
, 5, "privileged opcode");
39 ADD_SIGCODE(SIGILL
, 4, ILL_PRVREG
, 6, "privileged register");
40 ADD_SIGCODE(SIGILL
, 4, ILL_COPROC
, 7, "coprocessor error");
41 ADD_SIGCODE(SIGILL
, 4, ILL_BADSTK
, 8, "internal stack error");
42 ADD_SIGCODE(SIGILL
, 4, ILL_BTCFI
, 9, "IBT missing on indirect call");
45 ADD_SIGCODE(SIGFPE
, 8, FPE_INTDIV
, 1, "integer divide by zero");
46 ADD_SIGCODE(SIGFPE
, 8, FPE_INTOVF
, 2, "integer overflow");
47 ADD_SIGCODE(SIGFPE
, 8, FPE_FLTDIV
, 3, "floating point divide by zero");
48 ADD_SIGCODE(SIGFPE
, 8, FPE_FLTOVF
, 4, "floating point overflow");
49 ADD_SIGCODE(SIGFPE
, 8, FPE_FLTUND
, 5, "floating point underflow");
50 ADD_SIGCODE(SIGFPE
, 8, FPE_FLTRES
, 6, "floating point inexact result");
51 ADD_SIGCODE(SIGFPE
, 8, FPE_FLTINV
, 7, "invalid floating point operation");
52 ADD_SIGCODE(SIGFPE
, 8, FPE_FLTSUB
, 8, "subscript out of range");
55 ADD_SIGCODE(SIGBUS
, 10, BUS_ADRALN
, 1, "invalid address alignment");
56 ADD_SIGCODE(SIGBUS
, 10, BUS_ADRERR
, 2, "non-existent physical address");
57 ADD_SIGCODE(SIGBUS
, 10, BUS_OBJERR
, 3, "object specific hardware error");
60 ADD_SIGCODE(SIGSEGV
, 11, SEGV_MAPERR
, 1, "address not mapped to object",
61 SignalCodePrintOption::Address
);
62 ADD_SIGCODE(SIGSEGV
, 11, SEGV_ACCERR
, 2, "invalid permissions for mapped object",
63 SignalCodePrintOption::Address
);
65 // SIGNO NAME SUPPRESS STOP NOTIFY DESCRIPTION
66 // ===== ============== ======== ====== ====== ========================
67 AddSignal(32, "SIGTHR", false, false, false, "thread library AST");