Sigh, should have updated the copyright date in the
[deliverable/binutils-gdb.git] / gdb / signals.c
index abbd7a56c926a0291dcb48a081b4dbd3718c33b6..d37ec06ee9ae4858d91a8af0f2b796b784877d6e 100644 (file)
@@ -210,11 +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.  */
+  if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)
+      && signals[sig].name != NULL)
+    return signals[sig].name;
+  else
+    /* 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 "?";
-  return signals[sig].name;
 }
 
 /* Given a name, return its signal.  */
This page took 0.023874 seconds and 4 git commands to generate.