aboutsummaryrefslogtreecommitdiff
path: root/gdb/proc-events.c
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2014-06-09 10:34:33 +0100
committerGary Benson <gbenson@redhat.com>2014-06-09 10:34:33 +0100
commit3657956bf8aa891be280a38bdb59bbcd99edd21b (patch)
treefccd1fb8788e5b90f0ea471fb5b07de729d13d5a /gdb/proc-events.c
parentc2610907652d508a532df68ba9911149b4fb39f9 (diff)
downloadgdb-3657956bf8aa891be280a38bdb59bbcd99edd21b.zip
gdb-3657956bf8aa891be280a38bdb59bbcd99edd21b.tar.gz
gdb-3657956bf8aa891be280a38bdb59bbcd99edd21b.tar.bz2
Separate out ANSI-standard signals
This commit reorders various pieces of code to separate ANSI-standard signals from other signals that need checking. Comments are added to document this, and to document the ordering of the signals. gdb/ 2014-06-09 Gary Benson <gbenson@redhat.com> * common/signals.c (gdb_signal_from_host): Reorder to separate the always-available ANSI-standard signals from the signals that require checking. (do_gdb_signal_to_host): Likewise. * proc-events.c (signal_table): Likewise. gdb/testsuite/ 2014-06-09 Gary Benson <gbenson@redhat.com> * gdb.base/sigall.c [Functions to send signals]: Reorder to separate the always-available ANSI-standard signals from the signals that require checking. (main): Likewise. * gdb.reverse/sigall-reverse.c [Functions to send signals]: Likewise. (main): Likewise.
Diffstat (limited to 'gdb/proc-events.c')
-rw-r--r--gdb/proc-events.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/gdb/proc-events.c b/gdb/proc-events.c
index 9bd7b31..68f004f 100644
--- a/gdb/proc-events.c
+++ b/gdb/proc-events.c
@@ -1396,37 +1396,47 @@ proc_prettyprint_syscalls (sysset_t *sysset, int verbose)
/* Prettyprint signals. */
-/* Signal translation table. */
+/* Signal translation table, ordered ANSI-standard signals first,
+ other signals second, with signals in each block ordered by their
+ numerical values on a typical POSIX platform. */
static struct trans signal_table[] =
{
{ 0, "<no signal>", "no signal" },
+
+ /* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM
+ are ANSI-standard signals and are always available. */
+
+ { SIGINT, "SIGINT", "Interrupt (rubout)" },
+ { SIGILL, "SIGILL", "Illegal instruction" }, /* not reset when caught */
+ { SIGABRT, "SIGABRT", "used by abort()" }, /* replaces SIGIOT */
+ { SIGFPE, "SIGFPE", "Floating point exception" },
+ { SIGSEGV, "SIGSEGV", "Segmentation violation" },
+ { SIGTERM, "SIGTERM", "Software termination signal from kill" },
+
+ /* All other signals need preprocessor conditionals. */
+
#ifdef SIGHUP
{ SIGHUP, "SIGHUP", "Hangup" },
#endif
- { SIGINT, "SIGINT", "Interrupt (rubout)" },
#ifdef SIGQUIT
{ SIGQUIT, "SIGQUIT", "Quit (ASCII FS)" },
#endif
- { SIGILL, "SIGILL", "Illegal instruction" }, /* not reset when caught */
#ifdef SIGTRAP
{ SIGTRAP, "SIGTRAP", "Trace trap" }, /* not reset when caught */
#endif
- { SIGABRT, "SIGABRT", "used by abort()" }, /* replaces SIGIOT */
#ifdef SIGIOT
{ SIGIOT, "SIGIOT", "IOT instruction" },
#endif
#ifdef SIGEMT
{ SIGEMT, "SIGEMT", "EMT instruction" },
#endif
- { SIGFPE, "SIGFPE", "Floating point exception" },
#ifdef SIGKILL
{ SIGKILL, "SIGKILL", "Kill" }, /* Solaris: cannot be caught/ignored */
#endif
#ifdef SIGBUS
{ SIGBUS, "SIGBUS", "Bus error" },
#endif
- { SIGSEGV, "SIGSEGV", "Segmentation violation" },
#ifdef SIGSYS
{ SIGSYS, "SIGSYS", "Bad argument to system call" },
#endif
@@ -1436,7 +1446,6 @@ static struct trans signal_table[] =
#ifdef SIGALRM
{ SIGALRM, "SIGALRM", "Alarm clock" },
#endif
- { SIGTERM, "SIGTERM", "Software termination signal from kill" },
#ifdef SIGUSR1
{ SIGUSR1, "SIGUSR1", "User defined signal 1" },
#endif