Skip to content

Commit f1b1e03

Browse files
chenx97jiegec
authored andcommitted
[mips] Fix build of LinuxSignals on Mips
But only the build, not the functionality because lldb won't work anyway.
1 parent 814b32f commit f1b1e03

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

lldb/source/Plugins/Process/Utility/LinuxSignals.cpp

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ void LinuxSignals::Reset() {
5757

5858
AddSignal(5, "SIGTRAP", true, true, true, "trace trap (not reset when caught)");
5959
AddSignal(6, "SIGABRT", false, true, true, "abort()/IOT trap", "SIGIOT");
60-
60+
#if defined (__mips__)
61+
AddSignal(7, "SIGEMT", false, true, true, "emulator trap");
62+
#else
6163
AddSignal(7, "SIGBUS", false, true, true, "bus error");
6264
ADD_SIGCODE(SIGBUS, 7, BUS_ADRALN, 1, "illegal alignment");
6365
ADD_SIGCODE(SIGBUS, 7, BUS_ADRERR, 2, "illegal address");
6466
ADD_SIGCODE(SIGBUS, 7, BUS_OBJERR, 3, "hardware error");
65-
67+
#endif
6668
AddSignal(8, "SIGFPE", false, true, true, "floating point exception");
6769
ADD_SIGCODE(SIGFPE, 8, FPE_INTDIV, 1, "integer divide by zero");
6870
ADD_SIGCODE(SIGFPE, 8, FPE_INTOVF, 2, "integer overflow");
@@ -74,8 +76,14 @@ void LinuxSignals::Reset() {
7476
ADD_SIGCODE(SIGFPE, 8, FPE_FLTSUB, 8, "subscript out of range");
7577

7678
AddSignal(9, "SIGKILL", false, true, true, "kill");
79+
#if defined (__mips__)
80+
AddSignal(10, "SIGBUS", false, true, true, "bus error");
81+
ADD_SIGCODE(SIGBUS, 10, BUS_ADRALN, 1, "illegal alignment");
82+
ADD_SIGCODE(SIGBUS, 10, BUS_ADRERR, 2, "illegal address");
83+
ADD_SIGCODE(SIGBUS, 10, BUS_OBJERR, 3, "hardware error");
84+
#else
7785
AddSignal(10, "SIGUSR1", false, true, true, "user defined signal 1");
78-
86+
#endif
7987
AddSignal(11, "SIGSEGV", false, true, true, "segmentation violation");
8088
ADD_SIGCODE(SIGSEGV, 11, SEGV_MAPERR, 1, "address not mapped to object", SignalCodePrintOption::Address);
8189
ADD_SIGCODE(SIGSEGV, 11, SEGV_ACCERR, 2, "invalid permissions for mapped object", SignalCodePrintOption::Address);
@@ -85,11 +93,32 @@ void LinuxSignals::Reset() {
8593
// Some platforms will occasionally send nonstandard spurious SI_KERNEL
8694
// codes. One way to get this is via unaligned SIMD loads. Treat it as invalid address.
8795
ADD_SIGCODE(SIGSEGV, 11, SI_KERNEL, 0x80, "invalid address", SignalCodePrintOption::Address);
88-
96+
#if defined (__mips__)
97+
AddSignal(12, "SIGSYS", false, true, true, "invalid system call");
98+
#else
8999
AddSignal(12, "SIGUSR2", false, true, true, "user defined signal 2");
100+
#endif
90101
AddSignal(13, "SIGPIPE", false, true, true, "write to pipe with reading end closed");
91102
AddSignal(14, "SIGALRM", false, false, false, "alarm");
92103
AddSignal(15, "SIGTERM", false, true, true, "termination requested");
104+
#if defined (__mips__)
105+
AddSignal(16, "SIGUSR1", false, true, true, "user defined signal 1");
106+
AddSignal(17, "SIGUSR2", false, true, true, "user defined signal 2");
107+
AddSignal(18, "SIGCHLD", false, false, true, "child status has changed", "SIGCLD");
108+
AddSignal(19, "SIGPWR", false, true, true, "power failure");
109+
AddSignal(20, "SIGWINCH", false, true, true, "window size changes");
110+
AddSignal(21, "SIGURG", false, true, true, "urgent data on socket");
111+
AddSignal(22, "SIGIO", false, true, true, "input/output ready/Pollable event", "SIGPOLL");
112+
AddSignal(23, "SIGSTOP", true, true, true, "process stop");
113+
AddSignal(24, "SIGTSTP", false, true, true, "tty stop");
114+
AddSignal(25, "SIGCONT", false, false, true, "process continue");
115+
AddSignal(26, "SIGTTIN", false, true, true, "background tty read");
116+
AddSignal(27, "SIGTTOU", false, true, true, "background tty write");
117+
AddSignal(28, "SIGVTALRM", false, true, true, "virtual time alarm");
118+
AddSignal(29, "SIGPROF", false, false, false, "profiling time alarm");
119+
AddSignal(30, "SIGXCPU", false, true, true, "CPU resource exceeded");
120+
AddSignal(31, "SIGXFSZ", false, true, true, "file size limit exceeded");
121+
#else
93122
AddSignal(16, "SIGSTKFLT", false, true, true, "stack fault");
94123
AddSignal(17, "SIGCHLD", false, false, true, "child status has changed", "SIGCLD");
95124
AddSignal(18, "SIGCONT", false, false, true, "process continue");
@@ -106,6 +135,7 @@ void LinuxSignals::Reset() {
106135
AddSignal(29, "SIGIO", false, true, true, "input/output ready/Pollable event", "SIGPOLL");
107136
AddSignal(30, "SIGPWR", false, true, true, "power failure");
108137
AddSignal(31, "SIGSYS", false, true, true, "invalid system call");
138+
#endif
109139
AddSignal(32, "SIG32", false, false, false, "threading library internal signal 1");
110140
AddSignal(33, "SIG33", false, false, false, "threading library internal signal 2");
111141
AddSignal(34, "SIGRTMIN", false, false, false, "real time signal 0");

0 commit comments

Comments
 (0)