aboutsummaryrefslogtreecommitdiff
path: root/gdb/signals.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-01-13 21:11:38 +0000
committerAndrew Cagney <cagney@redhat.com>2002-01-13 21:11:38 +0000
commit89c49e7acbffd8264cee697abbcaf0bb58bf065c (patch)
tree1046f5ac6114af004851038af747e6f37fa075a3 /gdb/signals.c
parent4daa9f9f3750c86da32cb10ba43ed451b55e6723 (diff)
downloadgdb-89c49e7acbffd8264cee697abbcaf0bb58bf065c.zip
gdb-89c49e7acbffd8264cee697abbcaf0bb58bf065c.tar.gz
gdb-89c49e7acbffd8264cee697abbcaf0bb58bf065c.tar.bz2
From Petr Ledvina <ledvinap@kae.zcu.cz>:
* signals.c (target_signal_to_name): Verify that SIG is within the bounds of the signals array.
Diffstat (limited to 'gdb/signals.c')
-rw-r--r--gdb/signals.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/signals.c b/gdb/signals.c
index abbd7a5..cf0078d 100644
--- a/gdb/signals.c
+++ b/gdb/signals.c
@@ -214,7 +214,10 @@ target_signal_to_name (enum target_signal sig)
/* I think the code which prints this will always print it along with
the string, so no need to be verbose. */
return "?";
- return signals[sig].name;
+ else if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST))
+ return signals[sig].name;
+ else
+ return signals[sig].name;
}
/* Given a name, return its signal. */