180814287SRaphael Isemann //===-- GDBRemoteSignals.cpp ----------------------------------------------===//
298d0a4b3SChaoren Lin //
32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
698d0a4b3SChaoren Lin //
798d0a4b3SChaoren Lin //===----------------------------------------------------------------------===//
898d0a4b3SChaoren Lin 
998d0a4b3SChaoren Lin #include "GDBRemoteSignals.h"
1098d0a4b3SChaoren Lin 
1198d0a4b3SChaoren Lin using namespace lldb_private;
1298d0a4b3SChaoren Lin 
GDBRemoteSignals()13b9c1b51eSKate Stone GDBRemoteSignals::GDBRemoteSignals() : UnixSignals() { Reset(); }
1498d0a4b3SChaoren Lin 
GDBRemoteSignals(const lldb::UnixSignalsSP & rhs)1598d0a4b3SChaoren Lin GDBRemoteSignals::GDBRemoteSignals(const lldb::UnixSignalsSP &rhs)
16b9c1b51eSKate Stone     : UnixSignals(*rhs) {}
1798d0a4b3SChaoren Lin 
Reset()18*3f137236SMichał Górny void GDBRemoteSignals::Reset() {
19*3f137236SMichał Górny   m_signals.clear();
20*3f137236SMichał Górny   // clang-format off
21*3f137236SMichał Górny   //        SIGNO   NAME            SUPPRESS  STOP    NOTIFY  DESCRIPTION
22*3f137236SMichał Górny   //        ======  ==============  ========  ======  ======  ===================================================
23*3f137236SMichał Górny   AddSignal(1,      "SIGHUP",       false,    true,   true,   "hangup");
24*3f137236SMichał Górny   AddSignal(2,      "SIGINT",       true,     true,   true,   "interrupt");
25*3f137236SMichał Górny   AddSignal(3,      "SIGQUIT",      false,    true,   true,   "quit");
26*3f137236SMichał Górny   AddSignal(4,      "SIGILL",       false,    true,   true,   "illegal instruction");
27*3f137236SMichał Górny   AddSignal(5,      "SIGTRAP",      true,     true,   true,   "trace trap (not reset when caught)");
28*3f137236SMichał Górny   AddSignal(6,      "SIGABRT",      false,    true,   true,   "abort()/IOT trap", "SIGIOT");
29*3f137236SMichał Górny   AddSignal(7,      "SIGEMT",       false,    true,   true,   "emulation trap");
30*3f137236SMichał Górny   AddSignal(8,      "SIGFPE",       false,    true,   true,   "floating point exception");
31*3f137236SMichał Górny   AddSignal(9,      "SIGKILL",      false,    true,   true,   "kill");
32*3f137236SMichał Górny   AddSignal(10,     "SIGBUS",       false,    true,   true,   "bus error");
33*3f137236SMichał Górny   AddSignal(11,     "SIGSEGV",      false,    true,   true,   "segmentation violation");
34*3f137236SMichał Górny   AddSignal(12,     "SIGSYS",       false,    true,   true,   "invalid system call");
35*3f137236SMichał Górny   AddSignal(13,     "SIGPIPE",      false,    true,   true,   "write to pipe with reading end closed");
36*3f137236SMichał Górny   AddSignal(14,     "SIGALRM",      false,    false,  false,  "alarm");
37*3f137236SMichał Górny   AddSignal(15,     "SIGTERM",      false,    true,   true,   "termination requested");
38*3f137236SMichał Górny   AddSignal(16,     "SIGURG",       false,    true,   true,   "urgent data on socket");
39*3f137236SMichał Górny   AddSignal(17,     "SIGSTOP",      true,     true,   true,   "process stop");
40*3f137236SMichał Górny   AddSignal(18,     "SIGTSTP",      false,    true,   true,   "tty stop");
41*3f137236SMichał Górny   AddSignal(19,     "SIGCONT",      false,    false,  true,   "process continue");
42*3f137236SMichał Górny   AddSignal(20,     "SIGCHLD",      false,    false,  true,   "child status has changed", "SIGCLD");
43*3f137236SMichał Górny   AddSignal(21,     "SIGTTIN",      false,    true,   true,   "background tty read");
44*3f137236SMichał Górny   AddSignal(22,     "SIGTTOU",      false,    true,   true,   "background tty write");
45*3f137236SMichał Górny   AddSignal(23,     "SIGIO",        false,    true,   true,   "input/output ready/Pollable event");
46*3f137236SMichał Górny   AddSignal(24,     "SIGXCPU",      false,    true,   true,   "CPU resource exceeded");
47*3f137236SMichał Górny   AddSignal(25,     "SIGXFSZ",      false,    true,   true,   "file size limit exceeded");
48*3f137236SMichał Górny   AddSignal(26,     "SIGVTALRM",    false,    true,   true,   "virtual time alarm");
49*3f137236SMichał Górny   AddSignal(27,     "SIGPROF",      false,    false,  false,  "profiling time alarm");
50*3f137236SMichał Górny   AddSignal(28,     "SIGWINCH",     false,    true,   true,   "window size changes");
51*3f137236SMichał Górny   AddSignal(29,     "SIGLOST",      false,    true,   true,   "resource lost");
52*3f137236SMichał Górny   AddSignal(30,     "SIGUSR1",      false,    true,   true,   "user defined signal 1");
53*3f137236SMichał Górny   AddSignal(31,     "SIGUSR2",      false,    true,   true,   "user defined signal 2");
54*3f137236SMichał Górny   AddSignal(32,     "SIGPWR",       false,    true,   true,   "power failure");
55*3f137236SMichał Górny   AddSignal(33,     "SIGPOLL",      false,    true,   true,   "pollable event");
56*3f137236SMichał Górny   AddSignal(34,     "SIGWIND",      false,    true,   true,   "SIGWIND");
57*3f137236SMichał Górny   AddSignal(35,    "SIGPHONE",      false,    true,   true,   "SIGPHONE");
58*3f137236SMichał Górny   AddSignal(36,  "SIGWAITING",      false,    true,   true,   "process's LWPs are blocked");
59*3f137236SMichał Górny   AddSignal(37,      "SIGLWP",      false,    true,   true,   "signal LWP");
60*3f137236SMichał Górny   AddSignal(38,   "SIGDANGER",      false,    true,   true,   "swap space dangerously low");
61*3f137236SMichał Górny   AddSignal(39,    "SIGGRANT",      false,    true,   true,   "monitor mode granted");
62*3f137236SMichał Górny   AddSignal(40,  "SIGRETRACT",      false,    true,   true,   "need to relinquish monitor mode");
63*3f137236SMichał Górny   AddSignal(41,      "SIGMSG",      false,    true,   true,   "monitor mode data available");
64*3f137236SMichał Górny   AddSignal(42,    "SIGSOUND",      false,    true,   true,   "sound completed");
65*3f137236SMichał Górny   AddSignal(43,      "SIGSAK",      false,    true,   true,   "secure attention");
66*3f137236SMichał Górny   AddSignal(44,     "SIGPRIO",      false,    true,   true,   "SIGPRIO");
67*3f137236SMichał Górny 
68*3f137236SMichał Górny   AddSignal(45,       "SIG33",      false,    false,  false,  "real-time event 33");
69*3f137236SMichał Górny   AddSignal(46,       "SIG34",      false,    false,  false,  "real-time event 34");
70*3f137236SMichał Górny   AddSignal(47,       "SIG35",      false,    false,  false,  "real-time event 35");
71*3f137236SMichał Górny   AddSignal(48,       "SIG36",      false,    false,  false,  "real-time event 36");
72*3f137236SMichał Górny   AddSignal(49,       "SIG37",      false,    false,  false,  "real-time event 37");
73*3f137236SMichał Górny   AddSignal(50,       "SIG38",      false,    false,  false,  "real-time event 38");
74*3f137236SMichał Górny   AddSignal(51,       "SIG39",      false,    false,  false,  "real-time event 39");
75*3f137236SMichał Górny   AddSignal(52,       "SIG40",      false,    false,  false,  "real-time event 40");
76*3f137236SMichał Górny   AddSignal(53,       "SIG41",      false,    false,  false,  "real-time event 41");
77*3f137236SMichał Górny   AddSignal(54,       "SIG42",      false,    false,  false,  "real-time event 42");
78*3f137236SMichał Górny   AddSignal(55,       "SIG43",      false,    false,  false,  "real-time event 43");
79*3f137236SMichał Górny   AddSignal(56,       "SIG44",      false,    false,  false,  "real-time event 44");
80*3f137236SMichał Górny   AddSignal(57,       "SIG45",      false,    false,  false,  "real-time event 45");
81*3f137236SMichał Górny   AddSignal(58,       "SIG46",      false,    false,  false,  "real-time event 46");
82*3f137236SMichał Górny   AddSignal(59,       "SIG47",      false,    false,  false,  "real-time event 47");
83*3f137236SMichał Górny   AddSignal(60,       "SIG48",      false,    false,  false,  "real-time event 48");
84*3f137236SMichał Górny   AddSignal(61,       "SIG49",      false,    false,  false,  "real-time event 49");
85*3f137236SMichał Górny   AddSignal(62,       "SIG50",      false,    false,  false,  "real-time event 50");
86*3f137236SMichał Górny   AddSignal(63,       "SIG51",      false,    false,  false,  "real-time event 51");
87*3f137236SMichał Górny   AddSignal(64,       "SIG52",      false,    false,  false,  "real-time event 52");
88*3f137236SMichał Górny   AddSignal(65,       "SIG53",      false,    false,  false,  "real-time event 53");
89*3f137236SMichał Górny   AddSignal(66,       "SIG54",      false,    false,  false,  "real-time event 54");
90*3f137236SMichał Górny   AddSignal(67,       "SIG55",      false,    false,  false,  "real-time event 55");
91*3f137236SMichał Górny   AddSignal(68,       "SIG56",      false,    false,  false,  "real-time event 56");
92*3f137236SMichał Górny   AddSignal(69,       "SIG57",      false,    false,  false,  "real-time event 57");
93*3f137236SMichał Górny   AddSignal(70,       "SIG58",      false,    false,  false,  "real-time event 58");
94*3f137236SMichał Górny   AddSignal(71,       "SIG59",      false,    false,  false,  "real-time event 59");
95*3f137236SMichał Górny   AddSignal(72,       "SIG60",      false,    false,  false,  "real-time event 60");
96*3f137236SMichał Górny   AddSignal(73,       "SIG61",      false,    false,  false,  "real-time event 61");
97*3f137236SMichał Górny   AddSignal(74,       "SIG62",      false,    false,  false,  "real-time event 62");
98*3f137236SMichał Górny   AddSignal(75,       "SIG63",      false,    false,  false,  "real-time event 63");
99*3f137236SMichał Górny 
100*3f137236SMichał Górny   AddSignal(76,   "SIGCANCEL",      false,    true,   true,   "LWP internal signal");
101*3f137236SMichał Górny 
102*3f137236SMichał Górny   AddSignal(77,       "SIG32",      false,    false,  false,  "real-time event 32");
103*3f137236SMichał Górny   AddSignal(78,       "SIG64",      false,    false,  false,  "real-time event 64");
104*3f137236SMichał Górny   AddSignal(79,       "SIG65",      false,    false,  false,  "real-time event 65");
105*3f137236SMichał Górny   AddSignal(80,       "SIG66",      false,    false,  false,  "real-time event 66");
106*3f137236SMichał Górny   AddSignal(81,       "SIG67",      false,    false,  false,  "real-time event 67");
107*3f137236SMichał Górny   AddSignal(82,       "SIG68",      false,    false,  false,  "real-time event 68");
108*3f137236SMichał Górny   AddSignal(83,       "SIG69",      false,    false,  false,  "real-time event 69");
109*3f137236SMichał Górny   AddSignal(84,       "SIG70",      false,    false,  false,  "real-time event 70");
110*3f137236SMichał Górny   AddSignal(85,       "SIG71",      false,    false,  false,  "real-time event 71");
111*3f137236SMichał Górny   AddSignal(86,       "SIG72",      false,    false,  false,  "real-time event 72");
112*3f137236SMichał Górny   AddSignal(87,       "SIG73",      false,    false,  false,  "real-time event 73");
113*3f137236SMichał Górny   AddSignal(88,       "SIG74",      false,    false,  false,  "real-time event 74");
114*3f137236SMichał Górny   AddSignal(89,       "SIG75",      false,    false,  false,  "real-time event 75");
115*3f137236SMichał Górny   AddSignal(90,       "SIG76",      false,    false,  false,  "real-time event 76");
116*3f137236SMichał Górny   AddSignal(91,       "SIG77",      false,    false,  false,  "real-time event 77");
117*3f137236SMichał Górny   AddSignal(92,       "SIG78",      false,    false,  false,  "real-time event 78");
118*3f137236SMichał Górny   AddSignal(93,       "SIG79",      false,    false,  false,  "real-time event 79");
119*3f137236SMichał Górny   AddSignal(94,       "SIG80",      false,    false,  false,  "real-time event 80");
120*3f137236SMichał Górny   AddSignal(95,       "SIG81",      false,    false,  false,  "real-time event 81");
121*3f137236SMichał Górny   AddSignal(96,       "SIG82",      false,    false,  false,  "real-time event 82");
122*3f137236SMichał Górny   AddSignal(97,       "SIG83",      false,    false,  false,  "real-time event 83");
123*3f137236SMichał Górny   AddSignal(98,       "SIG84",      false,    false,  false,  "real-time event 84");
124*3f137236SMichał Górny   AddSignal(99,       "SIG85",      false,    false,  false,  "real-time event 85");
125*3f137236SMichał Górny   AddSignal(100,      "SIG86",      false,    false,  false,  "real-time event 86");
126*3f137236SMichał Górny   AddSignal(101,      "SIG87",      false,    false,  false,  "real-time event 87");
127*3f137236SMichał Górny   AddSignal(102,      "SIG88",      false,    false,  false,  "real-time event 88");
128*3f137236SMichał Górny   AddSignal(103,      "SIG89",      false,    false,  false,  "real-time event 89");
129*3f137236SMichał Górny   AddSignal(104,      "SIG90",      false,    false,  false,  "real-time event 90");
130*3f137236SMichał Górny   AddSignal(105,      "SIG91",      false,    false,  false,  "real-time event 91");
131*3f137236SMichał Górny   AddSignal(106,      "SIG92",      false,    false,  false,  "real-time event 92");
132*3f137236SMichał Górny   AddSignal(107,      "SIG93",      false,    false,  false,  "real-time event 93");
133*3f137236SMichał Górny   AddSignal(108,      "SIG94",      false,    false,  false,  "real-time event 94");
134*3f137236SMichał Górny   AddSignal(109,      "SIG95",      false,    false,  false,  "real-time event 95");
135*3f137236SMichał Górny   AddSignal(110,      "SIG96",      false,    false,  false,  "real-time event 96");
136*3f137236SMichał Górny   AddSignal(111,      "SIG97",      false,    false,  false,  "real-time event 97");
137*3f137236SMichał Górny   AddSignal(112,      "SIG98",      false,    false,  false,  "real-time event 98");
138*3f137236SMichał Górny   AddSignal(113,      "SIG99",      false,    false,  false,  "real-time event 99");
139*3f137236SMichał Górny   AddSignal(114,     "SIG100",      false,    false,  false,  "real-time event 100");
140*3f137236SMichał Górny   AddSignal(115,     "SIG101",      false,    false,  false,  "real-time event 101");
141*3f137236SMichał Górny   AddSignal(116,     "SIG102",      false,    false,  false,  "real-time event 102");
142*3f137236SMichał Górny   AddSignal(117,     "SIG103",      false,    false,  false,  "real-time event 103");
143*3f137236SMichał Górny   AddSignal(118,     "SIG104",      false,    false,  false,  "real-time event 104");
144*3f137236SMichał Górny   AddSignal(119,     "SIG105",      false,    false,  false,  "real-time event 105");
145*3f137236SMichał Górny   AddSignal(120,     "SIG106",      false,    false,  false,  "real-time event 106");
146*3f137236SMichał Górny   AddSignal(121,     "SIG107",      false,    false,  false,  "real-time event 107");
147*3f137236SMichał Górny   AddSignal(122,     "SIG108",      false,    false,  false,  "real-time event 108");
148*3f137236SMichał Górny   AddSignal(123,     "SIG109",      false,    false,  false,  "real-time event 109");
149*3f137236SMichał Górny   AddSignal(124,     "SIG110",      false,    false,  false,  "real-time event 110");
150*3f137236SMichał Górny   AddSignal(125,     "SIG111",      false,    false,  false,  "real-time event 111");
151*3f137236SMichał Górny   AddSignal(126,     "SIG112",      false,    false,  false,  "real-time event 112");
152*3f137236SMichał Górny   AddSignal(127,     "SIG113",      false,    false,  false,  "real-time event 113");
153*3f137236SMichał Górny   AddSignal(128,     "SIG114",      false,    false,  false,  "real-time event 114");
154*3f137236SMichał Górny   AddSignal(129,     "SIG115",      false,    false,  false,  "real-time event 115");
155*3f137236SMichał Górny   AddSignal(130,     "SIG116",      false,    false,  false,  "real-time event 116");
156*3f137236SMichał Górny   AddSignal(131,     "SIG117",      false,    false,  false,  "real-time event 117");
157*3f137236SMichał Górny   AddSignal(132,     "SIG118",      false,    false,  false,  "real-time event 118");
158*3f137236SMichał Górny   AddSignal(133,     "SIG119",      false,    false,  false,  "real-time event 119");
159*3f137236SMichał Górny   AddSignal(134,     "SIG120",      false,    false,  false,  "real-time event 120");
160*3f137236SMichał Górny   AddSignal(135,     "SIG121",      false,    false,  false,  "real-time event 121");
161*3f137236SMichał Górny   AddSignal(136,     "SIG122",      false,    false,  false,  "real-time event 122");
162*3f137236SMichał Górny   AddSignal(137,     "SIG123",      false,    false,  false,  "real-time event 123");
163*3f137236SMichał Górny   AddSignal(138,     "SIG124",      false,    false,  false,  "real-time event 124");
164*3f137236SMichał Górny   AddSignal(139,     "SIG125",      false,    false,  false,  "real-time event 125");
165*3f137236SMichał Górny   AddSignal(140,     "SIG126",      false,    false,  false,  "real-time event 126");
166*3f137236SMichał Górny   AddSignal(141,     "SIG127",      false,    false,  false,  "real-time event 127");
167*3f137236SMichał Górny 
168*3f137236SMichał Górny   AddSignal(142,    "SIGINFO",      false,    true,   true,   "information request");
169*3f137236SMichał Górny   AddSignal(143,    "unknown",      false,    true,   true,   "unknown signal");
170*3f137236SMichał Górny 
171*3f137236SMichał Górny   AddSignal(145,      "EXC_BAD_ACCESS",       false,  true,   true,   "could not access memory");
172*3f137236SMichał Górny   AddSignal(146, "EXC_BAD_INSTRUCTION",       false,  true,   true,   "illegal instruction/operand");
173*3f137236SMichał Górny   AddSignal(147,      "EXC_ARITHMETIC",       false,  true,   true,   "arithmetic exception");
174*3f137236SMichał Górny   AddSignal(148,       "EXC_EMULATION",       false,  true,   true,   "emulation instruction");
175*3f137236SMichał Górny   AddSignal(149,        "EXC_SOFTWARE",       false,  true,   true,   "software generated exception");
176*3f137236SMichał Górny   AddSignal(150,      "EXC_BREAKPOINT",       false,  true,   true,   "breakpoint");
177*3f137236SMichał Górny 
178*3f137236SMichał Górny   AddSignal(151,   "SIGLIBRT",      false,    true,   true,   "librt internal signal");
179*3f137236SMichał Górny 
180*3f137236SMichał Górny   // clang-format on
181*3f137236SMichał Górny }
182