From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22049 invoked by alias); 30 May 2012 19:27:07 -0000 Received: (qmail 22033 invoked by uid 22791); 30 May 2012 19:27:06 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-vc0-f169.google.com (HELO mail-vc0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 May 2012 19:26:52 +0000 Received: by vcbfl10 with SMTP id fl10so147105vcb.0 for ; Wed, 30 May 2012 12:26:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :organization:content-type:x-mailer:content-transfer-encoding :mime-version:x-gm-message-state; bh=3y214zODcYc3nraYyIx4THpiI2SrCqQcsTGTY/MKCA0=; b=SdVhHqp8bT00FKzleOTLys3HoY4ZF1jg0D/GnvlCZYUvajoRat0rbNuuZJ6kte/+Kz l0L3+yug54ZSEGJJTta2jQ45qW8k5CJ1ZWhoISQF7AgLQjF8OjP4Q/LyCs6Jj2YoXVof /eB3HSCPQz3ZZstaY46mgulnQQUgXx3EyZjNmhmImKxN2SGu1/za8UfMPbW4lcFa1wKv ijozlPVhXT4IrjMnVJwHvBVL6jUOTm24ieCL1+dzdce7YQpFY7vVXK8VITWfoJumbORx sxIDXR6MmjXg6r+Jz8AXJCnPiPrD0oMqL7ABP0FUF40gyayyxhqx6LAdKc1OWFLj+aCz STrA== Received: by 10.52.69.200 with SMTP id g8mr3740147vdu.113.1338406011888; Wed, 30 May 2012 12:26:51 -0700 (PDT) Received: from [192.168.1.50] ([177.16.42.188]) by mx.google.com with ESMTPS id k4sm948424vdi.6.2012.05.30.12.26.49 (version=SSLv3 cipher=OTHER); Wed, 30 May 2012 12:26:50 -0700 (PDT) Message-ID: <1338406007.22894.14.camel@hactar> Subject: Re: [RFA] Define DT_MIPS_RLD_MAP if not already defined. From: Thiago Jung Bauermann To: Pedro Alves Cc: gdb-patches ml Date: Wed, 30 May 2012 19:27:00 -0000 In-Reply-To: <4FC66BDC.1030200@redhat.com> References: <1338352816.3618.5.camel@hactar> <4FC660E6.9010904@redhat.com> <1338402935.22894.12.camel@hactar> <4FC66BDC.1030200@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Gm-Message-State: ALoCoQkrMn4VrEBAgjIwDTfkmLx8UYKiuAq3cdkXL2xbq9Hrce8oUTWBjf+60rdT+bc00wCdRSgn 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: 2012-05/txt/msg01049.txt.bz2 On Wed, 2012-05-30 at 19:50 +0100, Pedro Alves wrote: > On 05/30/2012 07:35 PM, Thiago Jung Bauermann wrote: > > > On Wed, 2012-05-30 at 19:03 +0100, Pedro Alves wrote: > >> On 05/30/2012 05:40 AM, Thiago Jung Bauermann wrote: > >>> Hello, > >>> > >>> Android doesn't support MIPS, so understandably there's no > >>> DT_MIPS_RLD_MAP in its header files. This patch allows gdbserver to be > >>> compiled for Android. > >> > >> Then why not '#ifdef DT_MIPS_RLD_MAP' out the bits that use DT_MIPS_RLD_MAP ? > >> It's just dead code on non-MIPS ports. > > > > I thought #ifdef'ing platform-specific code was discouraged in GDB. I > > can certainly do that though. > > > It is, mostly in common code. But this is native code. The alternative > is to abstract it in the linux_target_ops interface, but that's quite > overkill for this. Plenty of other #ifdefs in linux-low.c. What about this version then? -- []'s Thiago Jung Bauermann Linaro Toolchain Working Group 2012-05-30 Thiago Jung Bauermann * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP if the platform doesn't know about it. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index c015a61..e8667ea 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -5492,6 +5492,7 @@ get_r_debug (const int pid, const int is_elf64) if (is_elf64) { Elf64_Dyn *const dyn = (Elf64_Dyn *) buf; +#ifdef DT_MIPS_RLD_MAP union { Elf64_Xword map; @@ -5507,6 +5508,7 @@ get_r_debug (const int pid, const int is_elf64) else break; } +#endif /* DT_MIPS_RLD_MAP */ if (dyn->d_tag == DT_DEBUG && map == -1) map = dyn->d_un.d_val; @@ -5517,6 +5519,7 @@ get_r_debug (const int pid, const int is_elf64) else { Elf32_Dyn *const dyn = (Elf32_Dyn *) buf; +#ifdef DT_MIPS_RLD_MAP union { Elf32_Word map; @@ -5532,6 +5535,7 @@ get_r_debug (const int pid, const int is_elf64) else break; } +#endif /* DT_MIPS_RLD_MAP */ if (dyn->d_tag == DT_DEBUG && map == -1) map = dyn->d_un.d_val;