1 /* Target signal translation functions for GDB.
2 Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 2000, 2001, 2002, 2011 Free Software Foundation, Inc.
4 Contributed by Cygnus Support.
6 This file is part of GDB.
7 It has been modified to integrate it in valgrind
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA. */
26 #if defined(VGO_darwin)
27 // ???? darwin signal.h defines SIGPOLL conditionnally ????
33 enum target_signal target_signal_from_name (char *name);
34 enum target_signal target_signal_from_command (int num);
36 /* This table must match in order and size the signals in enum target_signal
46 {"SIGINT", "Interrupt"},
48 {"SIGILL", "Illegal instruction"},
49 {"SIGTRAP", "Trace/breakpoint trap"},
50 {"SIGABRT", "Aborted"},
51 {"SIGEMT", "Emulation trap"},
52 {"SIGFPE", "Arithmetic exception"},
53 {"SIGKILL", "Killed"},
54 {"SIGBUS", "Bus error"},
55 {"SIGSEGV", "Segmentation fault"},
56 {"SIGSYS", "Bad system call"},
57 {"SIGPIPE", "Broken pipe"},
58 {"SIGALRM", "Alarm clock"},
59 {"SIGTERM", "Terminated"},
60 {"SIGURG", "Urgent I/O condition"},
61 {"SIGSTOP", "Stopped (signal)"},
62 {"SIGTSTP", "Stopped (user)"},
63 {"SIGCONT", "Continued"},
64 {"SIGCHLD", "Child status changed"},
65 {"SIGTTIN", "Stopped (tty input)"},
66 {"SIGTTOU", "Stopped (tty output)"},
67 {"SIGIO", "I/O possible"},
68 {"SIGXCPU", "CPU time limit exceeded"},
69 {"SIGXFSZ", "File size limit exceeded"},
70 {"SIGVTALRM", "Virtual timer expired"},
71 {"SIGPROF", "Profiling timer expired"},
72 {"SIGWINCH", "Window size changed"},
73 {"SIGLOST", "Resource lost"},
74 {"SIGUSR1", "User defined signal 1"},
75 {"SIGUSR2", "User defined signal 2"},
76 {"SIGPWR", "Power fail/restart"},
77 {"SIGPOLL", "Pollable event occurred"},
78 {"SIGWIND", "SIGWIND"},
79 {"SIGPHONE", "SIGPHONE"},
80 {"SIGWAITING", "Process's LWPs are blocked"},
81 {"SIGLWP", "Signal LWP"},
82 {"SIGDANGER", "Swap space dangerously low"},
83 {"SIGGRANT", "Monitor mode granted"},
84 {"SIGRETRACT", "Need to relinquish monitor mode"},
85 {"SIGMSG", "Monitor mode data available"},
86 {"SIGSOUND", "Sound completed"},
87 {"SIGSAK", "Secure attention"},
88 {"SIGPRIO", "SIGPRIO"},
89 {"SIG33", "Real-time event 33"},
90 {"SIG34", "Real-time event 34"},
91 {"SIG35", "Real-time event 35"},
92 {"SIG36", "Real-time event 36"},
93 {"SIG37", "Real-time event 37"},
94 {"SIG38", "Real-time event 38"},
95 {"SIG39", "Real-time event 39"},
96 {"SIG40", "Real-time event 40"},
97 {"SIG41", "Real-time event 41"},
98 {"SIG42", "Real-time event 42"},
99 {"SIG43", "Real-time event 43"},
100 {"SIG44", "Real-time event 44"},
101 {"SIG45", "Real-time event 45"},
102 {"SIG46", "Real-time event 46"},
103 {"SIG47", "Real-time event 47"},
104 {"SIG48", "Real-time event 48"},
105 {"SIG49", "Real-time event 49"},
106 {"SIG50", "Real-time event 50"},
107 {"SIG51", "Real-time event 51"},
108 {"SIG52", "Real-time event 52"},
109 {"SIG53", "Real-time event 53"},
110 {"SIG54", "Real-time event 54"},
111 {"SIG55", "Real-time event 55"},
112 {"SIG56", "Real-time event 56"},
113 {"SIG57", "Real-time event 57"},
114 {"SIG58", "Real-time event 58"},
115 {"SIG59", "Real-time event 59"},
116 {"SIG60", "Real-time event 60"},
117 {"SIG61", "Real-time event 61"},
118 {"SIG62", "Real-time event 62"},
119 {"SIG63", "Real-time event 63"},
120 {"SIGCANCEL", "LWP internal signal"},
121 {"SIG32", "Real-time event 32"},
122 {"SIG64", "Real-time event 64"},
123 {"SIG65", "Real-time event 65"},
124 {"SIG66", "Real-time event 66"},
125 {"SIG67", "Real-time event 67"},
126 {"SIG68", "Real-time event 68"},
127 {"SIG69", "Real-time event 69"},
128 {"SIG70", "Real-time event 70"},
129 {"SIG71", "Real-time event 71"},
130 {"SIG72", "Real-time event 72"},
131 {"SIG73", "Real-time event 73"},
132 {"SIG74", "Real-time event 74"},
133 {"SIG75", "Real-time event 75"},
134 {"SIG76", "Real-time event 76"},
135 {"SIG77", "Real-time event 77"},
136 {"SIG78", "Real-time event 78"},
137 {"SIG79", "Real-time event 79"},
138 {"SIG80", "Real-time event 80"},
139 {"SIG81", "Real-time event 81"},
140 {"SIG82", "Real-time event 82"},
141 {"SIG83", "Real-time event 83"},
142 {"SIG84", "Real-time event 84"},
143 {"SIG85", "Real-time event 85"},
144 {"SIG86", "Real-time event 86"},
145 {"SIG87", "Real-time event 87"},
146 {"SIG88", "Real-time event 88"},
147 {"SIG89", "Real-time event 89"},
148 {"SIG90", "Real-time event 90"},
149 {"SIG91", "Real-time event 91"},
150 {"SIG92", "Real-time event 92"},
151 {"SIG93", "Real-time event 93"},
152 {"SIG94", "Real-time event 94"},
153 {"SIG95", "Real-time event 95"},
154 {"SIG96", "Real-time event 96"},
155 {"SIG97", "Real-time event 97"},
156 {"SIG98", "Real-time event 98"},
157 {"SIG99", "Real-time event 99"},
158 {"SIG100", "Real-time event 100"},
159 {"SIG101", "Real-time event 101"},
160 {"SIG102", "Real-time event 102"},
161 {"SIG103", "Real-time event 103"},
162 {"SIG104", "Real-time event 104"},
163 {"SIG105", "Real-time event 105"},
164 {"SIG106", "Real-time event 106"},
165 {"SIG107", "Real-time event 107"},
166 {"SIG108", "Real-time event 108"},
167 {"SIG109", "Real-time event 109"},
168 {"SIG110", "Real-time event 110"},
169 {"SIG111", "Real-time event 111"},
170 {"SIG112", "Real-time event 112"},
171 {"SIG113", "Real-time event 113"},
172 {"SIG114", "Real-time event 114"},
173 {"SIG115", "Real-time event 115"},
174 {"SIG116", "Real-time event 116"},
175 {"SIG117", "Real-time event 117"},
176 {"SIG118", "Real-time event 118"},
177 {"SIG119", "Real-time event 119"},
178 {"SIG120", "Real-time event 120"},
179 {"SIG121", "Real-time event 121"},
180 {"SIG122", "Real-time event 122"},
181 {"SIG123", "Real-time event 123"},
182 {"SIG124", "Real-time event 124"},
183 {"SIG125", "Real-time event 125"},
184 {"SIG126", "Real-time event 126"},
185 {"SIG127", "Real-time event 127"},
187 {"SIGINFO", "Information request"},
189 {NULL, "Unknown signal"},
190 {NULL, "Internal error: printing TARGET_SIGNAL_DEFAULT"},
192 /* Mach exceptions */
193 {"EXC_BAD_ACCESS", "Could not access memory"},
194 {"EXC_BAD_INSTRUCTION", "Illegal instruction/operand"},
195 {"EXC_ARITHMETIC", "Arithmetic exception"},
196 {"EXC_EMULATION", "Emulation instruction"},
197 {"EXC_SOFTWARE", "Software generated exception"},
198 {"EXC_BREAKPOINT", "Breakpoint"},
200 /* Last entry, used to check whether the table is the right size. */
201 {NULL, "TARGET_SIGNAL_MAGIC"}
207 /* Return the name for a signal. */
208 char *target_signal_to_name (enum target_signal sig)
210 if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)
211 && signals[sig].name != NULL)
212 return signals[sig].name;
214 /* I think the code which prints this will always print it along
215 with the string, so no need to be verbose (very old comment). */
219 /* Given a name, return its signal. */
220 enum target_signal target_signal_from_name (char *name)
222 enum target_signal sig;
224 /* It's possible we also should allow "SIGCLD" as well as "SIGCHLD"
225 for TARGET_SIGNAL_SIGCHLD. SIGIOT, on the other hand, is more
226 questionable; seems like by now people should call it SIGABRT
229 /* This ugly cast brought to you by the native VAX compiler. */
230 for (sig = TARGET_SIGNAL_HUP;
231 sig < TARGET_SIGNAL_LAST;
232 sig = (enum target_signal) ((int) sig + 1))
233 if (signals[sig].name != NULL
234 && strcmp (name, signals[sig].name) == 0)
236 return TARGET_SIGNAL_UNKNOWN;
240 /* The following functions are to help certain targets deal
241 with the signal/waitstatus stuff. They could just as well be in
242 a file called native-utils.c or unixwaitstatus-utils.c or whatever. */
244 /* Convert host signal to our signals. */
245 enum target_signal target_signal_from_host (int hostsig)
247 /* A switch statement would make sense but would require special kludges
248 to deal with the cases where more than one signal has the same number. */
251 return TARGET_SIGNAL_0;
253 #if defined (VKI_SIGHUP)
254 if (hostsig == VKI_SIGHUP)
255 return TARGET_SIGNAL_HUP;
257 #if defined (VKI_SIGINT)
258 if (hostsig == VKI_SIGINT)
259 return TARGET_SIGNAL_INT;
261 #if defined (VKI_SIGQUIT)
262 if (hostsig == VKI_SIGQUIT)
263 return TARGET_SIGNAL_QUIT;
265 #if defined (VKI_SIGILL)
266 if (hostsig == VKI_SIGILL)
267 return TARGET_SIGNAL_ILL;
269 #if defined (VKI_SIGTRAP)
270 if (hostsig == VKI_SIGTRAP)
271 return TARGET_SIGNAL_TRAP;
273 #if defined (VKI_SIGABRT)
274 if (hostsig == VKI_SIGABRT)
275 return TARGET_SIGNAL_ABRT;
277 #if defined (VKI_SIGEMT)
278 if (hostsig == VKI_SIGEMT)
279 return TARGET_SIGNAL_EMT;
281 #if defined (VKI_SIGFPE)
282 if (hostsig == VKI_SIGFPE)
283 return TARGET_SIGNAL_FPE;
285 #if defined (VKI_SIGKILL)
286 if (hostsig == VKI_SIGKILL)
287 return TARGET_SIGNAL_KILL;
289 #if defined (VKI_SIGBUS)
290 if (hostsig == VKI_SIGBUS)
291 return TARGET_SIGNAL_BUS;
293 #if defined (VKI_SIGSEGV)
294 if (hostsig == VKI_SIGSEGV)
295 return TARGET_SIGNAL_SEGV;
297 #if defined (VKI_SIGSYS)
298 if (hostsig == VKI_SIGSYS)
299 return TARGET_SIGNAL_SYS;
301 #if defined (VKI_SIGPIPE)
302 if (hostsig == VKI_SIGPIPE)
303 return TARGET_SIGNAL_PIPE;
305 #if defined (VKI_SIGALRM)
306 if (hostsig == VKI_SIGALRM)
307 return TARGET_SIGNAL_ALRM;
309 #if defined (VKI_SIGTERM)
310 if (hostsig == VKI_SIGTERM)
311 return TARGET_SIGNAL_TERM;
313 #if defined (VKI_SIGUSR1)
314 if (hostsig == VKI_SIGUSR1)
315 return TARGET_SIGNAL_USR1;
317 #if defined (VKI_SIGUSR2)
318 if (hostsig == VKI_SIGUSR2)
319 return TARGET_SIGNAL_USR2;
321 #if defined (VKI_SIGCLD)
322 if (hostsig == VKI_SIGCLD)
323 return TARGET_SIGNAL_CHLD;
325 #if defined (VKI_SIGCHLD)
326 if (hostsig == VKI_SIGCHLD)
327 return TARGET_SIGNAL_CHLD;
329 #if defined (VKI_SIGPWR)
330 if (hostsig == VKI_SIGPWR)
331 return TARGET_SIGNAL_PWR;
333 #if defined (VKI_SIGWINCH)
334 if (hostsig == VKI_SIGWINCH)
335 return TARGET_SIGNAL_WINCH;
337 #if defined (VKI_SIGURG)
338 if (hostsig == VKI_SIGURG)
339 return TARGET_SIGNAL_URG;
341 #if defined (VKI_SIGIO)
342 if (hostsig == VKI_SIGIO)
343 return TARGET_SIGNAL_IO;
345 #if defined (VKI_SIGPOLL)
346 if (hostsig == VKI_SIGPOLL)
347 return TARGET_SIGNAL_POLL;
349 #if defined (VKI_SIGSTOP)
350 if (hostsig == VKI_SIGSTOP)
351 return TARGET_SIGNAL_STOP;
353 #if defined (VKI_SIGTSTP)
354 if (hostsig == VKI_SIGTSTP)
355 return TARGET_SIGNAL_TSTP;
357 #if defined (VKI_SIGCONT)
358 if (hostsig == VKI_SIGCONT)
359 return TARGET_SIGNAL_CONT;
361 #if defined (VKI_SIGTTIN)
362 if (hostsig == VKI_SIGTTIN)
363 return TARGET_SIGNAL_TTIN;
365 #if defined (VKI_SIGTTOU)
366 if (hostsig == VKI_SIGTTOU)
367 return TARGET_SIGNAL_TTOU;
369 #if defined (VKI_SIGVTALRM)
370 if (hostsig == VKI_SIGVTALRM)
371 return TARGET_SIGNAL_VTALRM;
373 #if defined (VKI_SIGPROF)
374 if (hostsig == VKI_SIGPROF)
375 return TARGET_SIGNAL_PROF;
377 #if defined (VKI_SIGXCPU)
378 if (hostsig == VKI_SIGXCPU)
379 return TARGET_SIGNAL_XCPU;
381 #if defined (VKI_SIGXFSZ)
382 if (hostsig == VKI_SIGXFSZ)
383 return TARGET_SIGNAL_XFSZ;
385 #if defined (VKI_SIGWIND)
386 if (hostsig == VKI_SIGWIND)
387 return TARGET_SIGNAL_WIND;
389 #if defined (VKI_SIGPHONE)
390 if (hostsig == VKI_SIGPHONE)
391 return TARGET_SIGNAL_PHONE;
393 #if defined (VKI_SIGLOST)
394 if (hostsig == VKI_SIGLOST)
395 return TARGET_SIGNAL_LOST;
397 #if defined (VKI_SIGWAITING)
398 if (hostsig == VKI_SIGWAITING)
399 return TARGET_SIGNAL_WAITING;
401 #if defined (VKI_SIGCANCEL)
402 if (hostsig == VKI_SIGCANCEL)
403 return TARGET_SIGNAL_CANCEL;
405 #if defined (VKI_SIGLWP)
406 if (hostsig == VKI_SIGLWP)
407 return TARGET_SIGNAL_LWP;
409 #if defined (VKI_SIGDANGER)
410 if (hostsig == VKI_SIGDANGER)
411 return TARGET_SIGNAL_DANGER;
413 #if defined (VKI_SIGGRANT)
414 if (hostsig == VKI_SIGGRANT)
415 return TARGET_SIGNAL_GRANT;
417 #if defined (VKI_SIGRETRACT)
418 if (hostsig == VKI_SIGRETRACT)
419 return TARGET_SIGNAL_RETRACT;
421 #if defined (VKI_SIGMSG)
422 if (hostsig == VKI_SIGMSG)
423 return TARGET_SIGNAL_MSG;
425 #if defined (VKI_SIGSOUND)
426 if (hostsig == VKI_SIGSOUND)
427 return TARGET_SIGNAL_SOUND;
429 #if defined (VKI_SIGSAK)
430 if (hostsig == VKI_SIGSAK)
431 return TARGET_SIGNAL_SAK;
433 #if defined (VKI_SIGPRIO)
434 if (hostsig == VKI_SIGPRIO)
435 return TARGET_SIGNAL_PRIO;
438 /* Mach exceptions. Assumes that the values for EXC_ are positive! */
439 #if defined (EXC_BAD_ACCESS) && defined (_NSIG)
440 if (hostsig == _NSIG + EXC_BAD_ACCESS)
441 return TARGET_EXC_BAD_ACCESS;
443 #if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
444 if (hostsig == _NSIG + EXC_BAD_INSTRUCTION)
445 return TARGET_EXC_BAD_INSTRUCTION;
447 #if defined (EXC_ARITHMETIC) && defined (_NSIG)
448 if (hostsig == _NSIG + EXC_ARITHMETIC)
449 return TARGET_EXC_ARITHMETIC;
451 #if defined (EXC_EMULATION) && defined (_NSIG)
452 if (hostsig == _NSIG + EXC_EMULATION)
453 return TARGET_EXC_EMULATION;
455 #if defined (EXC_SOFTWARE) && defined (_NSIG)
456 if (hostsig == _NSIG + EXC_SOFTWARE)
457 return TARGET_EXC_SOFTWARE;
459 #if defined (EXC_BREAKPOINT) && defined (_NSIG)
460 if (hostsig == _NSIG + EXC_BREAKPOINT)
461 return TARGET_EXC_BREAKPOINT;
464 #if defined (VKI_SIGINFO)
465 if (hostsig == VKI_SIGINFO)
466 return TARGET_SIGNAL_INFO;
469 return TARGET_SIGNAL_UNKNOWN;
472 /* Convert a OURSIG (an enum target_signal) to the form used by the
473 target operating system (refered to as the ``host'') or zero if the
474 equivalent host signal is not available. Set/clear OURSIG_OK
478 int do_target_signal_to_host (enum target_signal oursig,
483 case TARGET_SIGNAL_0:
486 #if defined (VKI_SIGHUP)
487 case TARGET_SIGNAL_HUP:
490 #if defined (VKI_SIGINT)
491 case TARGET_SIGNAL_INT:
494 #if defined (VKI_SIGQUIT)
495 case TARGET_SIGNAL_QUIT:
498 #if defined (VKI_SIGILL)
499 case TARGET_SIGNAL_ILL:
502 #if defined (VKI_SIGTRAP)
503 case TARGET_SIGNAL_TRAP:
506 #if defined (VKI_SIGABRT)
507 case TARGET_SIGNAL_ABRT:
510 #if defined (VKI_SIGEMT)
511 case TARGET_SIGNAL_EMT:
514 #if defined (VKI_SIGFPE)
515 case TARGET_SIGNAL_FPE:
518 #if defined (VKI_SIGKILL)
519 case TARGET_SIGNAL_KILL:
522 #if defined (VKI_SIGBUS)
523 case TARGET_SIGNAL_BUS:
526 #if defined (VKI_SIGSEGV)
527 case TARGET_SIGNAL_SEGV:
530 #if defined (VKI_SIGSYS)
531 case TARGET_SIGNAL_SYS:
534 #if defined (VKI_SIGPIPE)
535 case TARGET_SIGNAL_PIPE:
538 #if defined (VKI_SIGALRM)
539 case TARGET_SIGNAL_ALRM:
542 #if defined (VKI_SIGTERM)
543 case TARGET_SIGNAL_TERM:
546 #if defined (VKI_SIGUSR1)
547 case TARGET_SIGNAL_USR1:
550 #if defined (VKI_SIGUSR2)
551 case TARGET_SIGNAL_USR2:
554 #if defined (VKI_SIGCHLD) || defined (VKI_SIGCLD)
555 case TARGET_SIGNAL_CHLD:
556 #if defined (VKI_SIGCHLD)
561 #endif /* SIGCLD or SIGCHLD */
562 #if defined (VKI_SIGPWR)
563 case TARGET_SIGNAL_PWR:
566 #if defined (VKI_SIGWINCH)
567 case TARGET_SIGNAL_WINCH:
570 #if defined (VKI_SIGURG)
571 case TARGET_SIGNAL_URG:
574 #if defined (VKI_SIGIO)
575 case TARGET_SIGNAL_IO:
578 #if defined (VKI_SIGPOLL)
579 case TARGET_SIGNAL_POLL:
582 #if defined (VKI_SIGSTOP)
583 case TARGET_SIGNAL_STOP:
586 #if defined (VKI_SIGTSTP)
587 case TARGET_SIGNAL_TSTP:
590 #if defined (VKI_SIGCONT)
591 case TARGET_SIGNAL_CONT:
594 #if defined (VKI_SIGTTIN)
595 case TARGET_SIGNAL_TTIN:
598 #if defined (VKI_SIGTTOU)
599 case TARGET_SIGNAL_TTOU:
602 #if defined (VKI_SIGVTALRM)
603 case TARGET_SIGNAL_VTALRM:
604 return VKI_SIGVTALRM;
606 #if defined (VKI_SIGPROF)
607 case TARGET_SIGNAL_PROF:
610 #if defined (VKI_SIGXCPU)
611 case TARGET_SIGNAL_XCPU:
614 #if defined (VKI_SIGXFSZ)
615 case TARGET_SIGNAL_XFSZ:
618 #if defined (VKI_SIGWIND)
619 case TARGET_SIGNAL_WIND:
622 #if defined (VKI_SIGPHONE)
623 case TARGET_SIGNAL_PHONE:
626 #if defined (VKI_SIGLOST)
627 case TARGET_SIGNAL_LOST:
630 #if defined (VKI_SIGWAITING)
631 case TARGET_SIGNAL_WAITING:
632 return VKI_SIGWAITING;
634 #if defined (VKI_SIGCANCEL)
635 case TARGET_SIGNAL_CANCEL:
636 return VKI_SIGCANCEL;
638 #if defined (VKI_SIGLWP)
639 case TARGET_SIGNAL_LWP:
642 #if defined (VKI_SIGDANGER)
643 case TARGET_SIGNAL_DANGER:
644 return VKI_SIGDANGER;
646 #if defined (VKI_SIGGRANT)
647 case TARGET_SIGNAL_GRANT:
650 #if defined (VKI_SIGRETRACT)
651 case TARGET_SIGNAL_RETRACT:
652 return VKI_SIGRETRACT;
654 #if defined (VKI_SIGMSG)
655 case TARGET_SIGNAL_MSG:
658 #if defined (VKI_SIGSOUND)
659 case TARGET_SIGNAL_SOUND:
662 #if defined (VKI_SIGSAK)
663 case TARGET_SIGNAL_SAK:
666 #if defined (VKI_SIGPRIO)
667 case TARGET_SIGNAL_PRIO:
671 /* Mach exceptions. Assumes that the values for EXC_ are positive! */
672 #if defined (EXC_BAD_ACCESS) && defined (_NSIG)
673 case TARGET_EXC_BAD_ACCESS:
674 return _NSIG + EXC_BAD_ACCESS;
676 #if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
677 case TARGET_EXC_BAD_INSTRUCTION:
678 return _NSIG + EXC_BAD_INSTRUCTION;
680 #if defined (EXC_ARITHMETIC) && defined (_NSIG)
681 case TARGET_EXC_ARITHMETIC:
682 return _NSIG + EXC_ARITHMETIC;
684 #if defined (EXC_EMULATION) && defined (_NSIG)
685 case TARGET_EXC_EMULATION:
686 return _NSIG + EXC_EMULATION;
688 #if defined (EXC_SOFTWARE) && defined (_NSIG)
689 case TARGET_EXC_SOFTWARE:
690 return _NSIG + EXC_SOFTWARE;
692 #if defined (EXC_BREAKPOINT) && defined (_NSIG)
693 case TARGET_EXC_BREAKPOINT:
694 return _NSIG + EXC_BREAKPOINT;
697 #if defined (VKI_SIGINFO)
698 case TARGET_SIGNAL_INFO:
708 int target_signal_to_host_p (enum target_signal oursig)
711 do_target_signal_to_host (oursig, &oursig_ok);
715 int target_signal_to_host (enum target_signal oursig)
718 int targ_signo = do_target_signal_to_host (oursig, &oursig_ok);
720 /* The user might be trying to do "signal SIGSAK" where this system
721 doesn't have SIGSAK. */
722 warning ("Signal %s does not exist on this system.\n",
723 target_signal_to_name (oursig));
730 /* In some circumstances we allow a command to specify a numeric
731 signal. The idea is to keep these circumstances limited so that
732 users (and scripts) develop portable habits. For comparison,
733 POSIX.2 `kill' requires that 1,2,3,6,9,14, and 15 work (and using a
734 numeric signal at all is obsolescent. We are slightly more
735 lenient and allow 1-15 which should match host signal numbers on
736 most systems. Use of symbolic signal names is strongly encouraged. */
738 enum target_signal target_signal_from_command (int num)
740 if (num >= 1 && num <= 15)
741 return (enum target_signal) num;
742 error ("Only signals 1-15 are valid as numeric signals.\n\
743 Use \"info signals\" for a list of symbolic signals.\n");