From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14535 invoked by alias); 29 Sep 2011 08:54:20 -0000 Received: (qmail 14518 invoked by uid 22791); 29 Sep 2011 08:54:17 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,TW_QX,TW_SB X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Sep 2011 08:54:04 +0000 Received: from nat-jpt.mentorg.com ([192.94.33.2] helo=PR1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1R9CNX-0001it-6w from Yao_Qi@mentor.com ; Thu, 29 Sep 2011 01:54:03 -0700 Received: from [172.30.112.173] ([172.30.112.173]) by PR1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Sep 2011 17:54:02 +0900 Message-ID: <4E843213.8040403@codesourcery.com> Date: Thu, 29 Sep 2011 09:34:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: Mike Frysinger CC: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org Subject: Re: [PATCH] gdbserver: add support for FDPIC loadmaps References: <1317268705-29948-1-git-send-email-vapier@gentoo.org> In-Reply-To: <1317268705-29948-1-git-send-email-vapier@gentoo.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 2011-09/txt/msg00510.txt.bz2 On 09/29/2011 11:58 AM, Mike Frysinger wrote: > The DSBT support is very close to the FDPIC code, so extend the existing > loadmap support to work with FDPIC loadmaps too. > Mike, patch looks quite good. > --- > gdb/common/linux-ptrace.h | 7 +++++++ > gdb/gdbserver/linux-low.c | 36 +++++++++++++++++++++++++----------- > 2 files changed, 32 insertions(+), 11 deletions(-) > > diff --git a/gdb/common/linux-ptrace.h b/gdb/common/linux-ptrace.h > index ea4ee0d..0f30430 100644 > --- a/gdb/common/linux-ptrace.h > +++ b/gdb/common/linux-ptrace.h > @@ -51,6 +51,13 @@ > > #endif /* PTRACE_EVENT_FORK */ > > +#if (defined __bfin__ || defined __frv__ || defined __sh__) && \ > + !defined PTRACE_GETFDPIC > +#define PTRACE_GETFDPIC 31 > +#define PTRACE_GETFDPIC_EXEC 0 > +#define PTRACE_GETFDPIC_INTERP 1 > +#endif > + Do you have some reasons to define these macros in common/? I don't see these macros are/will be used in GDB, so maybe, we can move them in gdbserver. Files in common/ are to have contents shared between gdb and gdbserver. > /* We can't always assume that this flag is available, but all systems > with the ptrace event handlers also have __WALL, so it's safe to use > in some contexts. */ > diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c > index 94f785c..5dfa59a 100644 > --- a/gdb/gdbserver/linux-low.c > +++ b/gdb/gdbserver/linux-low.c > @@ -4727,7 +4727,7 @@ linux_qxfer_spu (const char *annex, unsigned char *readbuf, > return ret; > } > > -#if defined PT_GETDSBT > +#if defined PT_GETDSBT || defined PTRACE_GETFDPIC > struct target_loadseg > { > /* Core address to which the segment is mapped. */ > @@ -4738,6 +4738,7 @@ struct target_loadseg > Elf32_Word p_memsz; > }; > > +# if defined PT_GETDSBT > struct target_loadmap > { > /* Protocol version number, must be zero. */ > @@ -4750,9 +4751,24 @@ struct target_loadmap > /* The actual memory map. */ > struct target_loadseg segs[/*nsegs*/]; > }; > -#endif > +# define LINUX_LOADMAP PT_GETDSBT > +# define LINUX_LOADMAP_EXEC PTRACE_GETDSBT_EXEC > +# define LINUX_LOADMAP_INTERP PTRACE_GETDSBT_INTERP > +# else The spaces between '#' and 'define' are not needed. The changes related to dsbt look correct to me. I applied this patch to trunk, and build c6x-uclinux gdb and gdbserver. I didn't run test because the board is in use. -- Yao (齐尧)