Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org
Subject: Re: [PATCH] gdbserver: add support for FDPIC loadmaps
Date: Thu, 29 Sep 2011 09:34:00 -0000	[thread overview]
Message-ID: <4E843213.8040403@codesourcery.com> (raw)
In-Reply-To: <1317268705-29948-1-git-send-email-vapier@gentoo.org>

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 (齐尧)


  reply	other threads:[~2011-09-29  8:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29  4:07 Mike Frysinger
2011-09-29  9:34 ` Yao Qi [this message]
2011-09-29 11:23   ` Pedro Alves
2011-09-29 14:35   ` Mike Frysinger
2011-09-30  1:10     ` Yao Qi
2011-09-29 11:25 ` Pedro Alves
2011-09-30  0:56   ` Mike Frysinger

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=4E843213.8040403@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=toolchain-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.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