Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org
Subject: [RFA]: gdbserver: Provide W_STOPCODE, SIGRTMIN if missing
Date: Mon, 21 Dec 2009 21:04:00 -0000	[thread overview]
Message-ID: <20091221210416.5B9EB84412@ruffy.mtv.corp.google.com> (raw)

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


             reply	other threads:[~2009-12-21 21:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21 21:04 Doug Evans [this message]
2009-12-21 21:48 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091221210416.5B9EB84412@ruffy.mtv.corp.google.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox