* signals/signals.c (do_target_signal_to_host): Correct realtime
authorDaniel Jacobowitz <drow@false.org>
Wed, 26 Mar 2003 20:44:39 +0000 (20:44 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 26 Mar 2003 20:44:39 +0000 (20:44 +0000)
signal range test.

gdb/ChangeLog
gdb/signals/signals.c

index 24f5b8a0752659298e63442b1dc1acea16c4b0c2..8220a0ec99ff9f6b311c9fe60ba8d76605b9744c 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
+
+       * signals/signals.c (do_target_signal_to_host): Correct realtime
+       signal range test.
+
 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
 
        * breakpoint.c (handle_gnu_4_16_catch_command, get_catch_sals)
index ba5e7eac59aef9a129b3dec56b7daf1972d477d4..ca46a9ed1c714fcfb1f093904751414c19f6a2d9 100644 (file)
@@ -518,6 +518,8 @@ static int
 do_target_signal_to_host (enum target_signal oursig,
                          int *oursig_ok)
 {
+  int retsig;
+
   *oursig_ok = 1;
   switch (oursig)
     {
@@ -742,36 +744,31 @@ do_target_signal_to_host (enum target_signal oursig,
 
     default:
 #if defined (REALTIME_LO)
-      if (oursig < REALTIME_LO || oursig >= REALTIME_HI)
-       {
-         *oursig_ok = 0;
-         return 0;
-       }
+      retsig = 0;
 
       if (oursig >= TARGET_SIGNAL_REALTIME_33
          && oursig <= TARGET_SIGNAL_REALTIME_63)
        {
          /* This block of signals is continuous, and
              TARGET_SIGNAL_REALTIME_33 is 33 by definition.  */
-         int retsig =
-           (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
-         return retsig;
+         retsig = (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
        }
       else if (oursig == TARGET_SIGNAL_REALTIME_32)
        {
          /* TARGET_SIGNAL_REALTIME_32 isn't contiguous with
              TARGET_SIGNAL_REALTIME_33.  It is 32 by definition.  */
-         return 32;
+         retsig = 32;
        }
       else if (oursig >= TARGET_SIGNAL_REALTIME_64
          && oursig <= TARGET_SIGNAL_REALTIME_127)
        {
          /* This block of signals is continuous, and
              TARGET_SIGNAL_REALTIME_64 is 64 by definition.  */
-         int retsig =
-           (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64;
-         return retsig;
+         retsig = (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64;
        }
+
+      if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
+       return retsig;
 #endif
 
       *oursig_ok = 0;