This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH 2/2] amd64-linux: expose system register FS_BASE and GS_BASE for Linux.
> 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,
Thanks for the review! :)
I can place the code there. I also have to change fix a regression on a test on gcore.
Next review I do in the way you proposed. I can also place the changes in a dedicated branch if it helps.
Thanks and regards,
Fred
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928