This is the mail archive of the gdb-patches@sourceware.org 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]

[RFA]: gdbserver: Provide W_STOPCODE, SIGRTMIN if missing


Hi.

android doesn't provide W_STOPCODE, and __SIGRTMIN is named SIGRTMIN.

I could have done something like:

#ifndef __SIGRTMIN
#ifdef SIGRTMIN
#define __SIGRTMIN SIGRTMIN
#else
#error "mumble"
#endif
#endif

or some such,
and then I wouldn't have had to change any of the functions,
but __* is reserved for the toolchain and I didn't want to touch it.

Ok to check in?

2009-12-21  Doug Evans  <dje@google.com>

	* linux-low.c (W_STOPCODE): Provide definition if missing.
	(MY_SIGRTMIN): Define to one of __SIGRTMIN, SIGRTMIN.
	(linux_create_inferior): Use MY_SIGRTMIN instead of __SIGRTMIN.
	(linux_wait_for_event_1, linux_init_signals): Ditto.

Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.117
diff -u -p -r1.117 linux-low.c
--- linux-low.c	21 Dec 2009 17:54:03 -0000	1.117
+++ linux-low.c	21 Dec 2009 20:57:59 -0000
@@ -95,6 +95,18 @@
 #endif
 #endif
 
+#ifndef W_STOPCODE
+#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
+#endif
+
+#if defined (__SIGRTMIN)
+#define MY_SIGRTMIN __SIGRTMIN
+#elif defined (SIGRTMIN)
+#define MY_SIGRTMIN SIGRTMIN
+#else
+#error "no value for SIGRTMIN"
+#endif
+
 /* ``all_threads'' is keyed by the LWP ID, which we use as the GDB protocol
    representation of the thread ID.
 
@@ -497,7 +509,7 @@ linux_create_inferior (char *program, ch
     {
       ptrace (PTRACE_TRACEME, 0, 0, 0);
 
-      signal (__SIGRTMIN + 1, SIG_DFL);
+      signal (MY_SIGRTMIN + 1, SIG_DFL);
 
       setpgid (0, 0);
 
@@ -1203,8 +1215,8 @@ linux_wait_for_event_1 (ptid_t ptid, int
 	  && (
 #ifdef USE_THREAD_DB
 	      (current_process ()->private->thread_db != NULL
-	       && (WSTOPSIG (*wstat) == __SIGRTMIN
-		   || WSTOPSIG (*wstat) == __SIGRTMIN + 1))
+	       && (WSTOPSIG (*wstat) == MY_SIGRTMIN
+		   || WSTOPSIG (*wstat) == MY_SIGRTMIN + 1))
 	      ||
 #endif
 	      (pass_signals[target_signal_from_host (WSTOPSIG (*wstat))]
@@ -3188,7 +3204,7 @@ linux_init_signals ()
 {
   /* FIXME drow/2002-06-09: As above, we should check with LinuxThreads
      to find what the cancel signal actually is.  */
-  signal (__SIGRTMIN+1, SIG_IGN);
+  signal (MY_SIGRTMIN+1, SIG_IGN);
 }
 
 void


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