diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-01-13 21:58:16 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-01-13 21:58:16 +0000 |
commit | ade8f45eafa16fa00f3b47aeebedd8cb2b9deb23 (patch) | |
tree | 2fd883c79dc133a669fef5b9e07fef3ccbbba929 /gdb/signals.c | |
parent | 89c49e7acbffd8264cee697abbcaf0bb58bf065c (diff) | |
download | gdb-ade8f45eafa16fa00f3b47aeebedd8cb2b9deb23.zip gdb-ade8f45eafa16fa00f3b47aeebedd8cb2b9deb23.tar.gz gdb-ade8f45eafa16fa00f3b47aeebedd8cb2b9deb23.tar.bz2 |
Rewrite target_signal_to_name().
Diffstat (limited to 'gdb/signals.c')
-rw-r--r-- | gdb/signals.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/signals.c b/gdb/signals.c index cf0078d..d37ec06 100644 --- a/gdb/signals.c +++ b/gdb/signals.c @@ -210,14 +210,13 @@ target_signal_to_string (enum target_signal sig) char * target_signal_to_name (enum target_signal sig) { - if (sig == TARGET_SIGNAL_UNKNOWN) - /* I think the code which prints this will always print it along with - the string, so no need to be verbose. */ - return "?"; - else if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)) + if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST) + && signals[sig].name != NULL) return signals[sig].name; else - return signals[sig].name; + /* I think the code which prints this will always print it along + with the string, so no need to be verbose (very old comment). */ + return "?"; } /* Given a name, return its signal. */ |