This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Fix stupid signals thinko


I broke native thread debugging for GNU/Linux this morning; I tested the
patch with a remote target but not a native one.  I was testing
TARGET_SIGNAL_REALTIME_32 against REALTIME_LO and REALTIME_HI - those are
native signal numbers, not enum values.

Sorry to anyone I inconvenienced.  With this the testsuite is happy again.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-03-26  Daniel Jacobowitz  <drow at mvista dot com>

	* signals/signals.c (do_target_signal_to_host): Correct realtime
	signal range test.

Index: signals.c
===================================================================
RCS file: /cvs/src/src/gdb/signals/signals.c,v
retrieving revision 1.7
diff -u -p -r1.7 signals.c
--- signals.c	26 Mar 2003 17:21:16 -0000	1.7
+++ signals.c	26 Mar 2003 20:39:02 -0000
@@ -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_si
 
     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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]