Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@freebsd.org>
To: gdb-patches@sourceware.org
Cc: Walfred Tedeschi <walfred.tedeschi@intel.com>,
	palves@redhat.com, eliz@gnu.org, brobecker@adacore.com
Subject: Re: [PATCH 2/2] amd64-linux: expose system register FS_BASE and GS_BASE for Linux.
Date: Sat, 05 Nov 2016 14:55:00 -0000	[thread overview]
Message-ID: <10348831.DcNpOF0W33@ralph.baldwin.cx> (raw)
In-Reply-To: <1478166445-21370-3-git-send-email-walfred.tedeschi@intel.com>

On Thursday, November 03, 2016 10:47:25 AM Walfred Tedeschi wrote:
> diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
> index 3f2a92b..a8a0b79 100644
> --- a/gdb/amd64-linux-tdep.c
> +++ b/gdb/amd64-linux-tdep.c
> @@ -1872,6 +1881,18 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
>      tdesc = tdesc_amd64_linux;
>    tdep->tdesc = tdesc;
>  
> +  feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.segments");
> +  if (feature != NULL)
> +    {
> +      struct tdesc_arch_data *tdesc_data_segments
> +      = (struct tdesc_arch_data *) info.tdep_info;
> +
> +      tdesc_numbered_register (feature, tdesc_data_segments,
> +			       AMD64_FSBASE_REGNUM, "fs_base");
> +      tdesc_numbered_register (feature, tdesc_data_segments,
> +			       AMD64_GSBASE_REGNUM, "gs_base");
> +    }
> +
>    feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.linux");
>    if (feature == NULL)
>      return;

Should this be done in the OS-independent amd64_init_abi() instead?
FreeBSD also has ptrace operations to get/set the FS and GS base
registers (which I will add as a followup once this series is
committed).

-- 
John Baldwin


  reply	other threads:[~2016-11-05 14:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03  9:47 [PATCH 0/2] amd64: add fs_base and gs_base Walfred Tedeschi
2016-11-03  9:47 ` [PATCH 2/2] amd64-linux: expose system register FS_BASE and GS_BASE for Linux Walfred Tedeschi
2016-11-05 14:55   ` John Baldwin [this message]
2016-11-07 14:40     ` Tedeschi, Walfred
2016-11-10 12:36   ` Gary Benson
2016-11-30 13:31     ` Tedeschi, Walfred
2016-11-23 12:02   ` Pedro Alves
2016-11-30 10:29     ` Tedeschi, Walfred
2016-12-07 16:37       ` Pedro Alves
     [not found] ` <1478166445-21370-2-git-send-email-walfred.tedeschi@intel.com>
2016-11-10 12:37   ` [PATCH 1/2] gdbserver-amd64: add HAVE_STRUCT_USER_REGS_STRUCT_(GS|FS)_BASE for gdbserver Gary Benson
2016-11-23 12:02     ` Pedro Alves
2016-11-30 14:20 ` [PATCH 0/2] amd64: add fs_base and gs_base Gary Benson

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=10348831.DcNpOF0W33@ralph.baldwin.cx \
    --to=jhb@freebsd.org \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=walfred.tedeschi@intel.com \
    /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