Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA]: gdbserver: Provide W_STOPCODE, SIGRTMIN if missing
@ 2009-12-21 21:04 Doug Evans
  2009-12-21 21:48 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2009-12-21 21:04 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFA]: gdbserver: Provide W_STOPCODE, SIGRTMIN if missing
  2009-12-21 21:04 [RFA]: gdbserver: Provide W_STOPCODE, SIGRTMIN if missing Doug Evans
@ 2009-12-21 21:48 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2009-12-21 21:48 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

On Mon, Dec 21, 2009 at 01:04:16PM -0800, Doug Evans wrote:
> 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.

Alternatively, you could disable this code when __SIGRTMIN is not
defined.  I doubt the bionic threading package uses LinuxThreads's
obsolete signals.

If you prefer, this version is fine.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-21 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-21 21:04 [RFA]: gdbserver: Provide W_STOPCODE, SIGRTMIN if missing Doug Evans
2009-12-21 21:48 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox