From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6054 invoked by alias); 21 Dec 2009 21:04:23 -0000 Received: (qmail 6045 invoked by uid 22791); 21 Dec 2009 21:04:22 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Dec 2009 21:04:19 +0000 Received: from wpaz5.hot.corp.google.com (wpaz5.hot.corp.google.com [172.24.198.69]) by smtp-out.google.com with ESMTP id nBLL4HHw001909 for ; Mon, 21 Dec 2009 13:04:17 -0800 Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by wpaz5.hot.corp.google.com with ESMTP id nBLL4GAs021306 for ; Mon, 21 Dec 2009 13:04:17 -0800 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id 5B9EB84412; Mon, 21 Dec 2009 13:04:16 -0800 (PST) To: gdb-patches@sourceware.org Subject: [RFA]: gdbserver: Provide W_STOPCODE, SIGRTMIN if missing Message-Id: <20091221210416.5B9EB84412@ruffy.mtv.corp.google.com> Date: Mon, 21 Dec 2009 21:04:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-12/txt/msg00326.txt.bz2 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 * 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