mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
Support the fs_base and gs_base registers on i386.
As on amd64, these registers hold the base address of the fs and gs segments, respectively. For i386 these two registers are 32 bits. gdb/ChangeLog: * amd64-fbsd-nat.c (amd64_fbsd_nat_target::read_description): Update calls to i386_target_description to add 'segments' parameter. * amd64-tdep.c (amd64_init_abi): Set tdep->fsbase_regnum. Don't add segment base registers. * arch/i386.c (i386_create_target_description): Add 'segments' parameter to enable segment base registers. * arch/i386.h (i386_create_target_description): Likewise. * features/i386/32bit-segments.xml: New file. * features/i386/32bit-segments.c: Generate. * i386-fbsd-nat.c (i386_fbsd_nat_target::read_description): Update call to i386_target_description to add 'segments' parameter. * i386-fbsd-tdep.c (i386fbsd_core_read_description): Likewise. * i386-go32-tdep.c (i386_go32_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_read_description): Likewise. * i386-tdep.c (i386_validate_tdesc_p): Add segment base registers if feature is present. (i386_gdbarch_init): Pass I386_NUM_REGS to set_gdbarch_num_regs. Add 'segments' parameter to call to i386_target_description. (i386_target_description): Add 'segments' parameter to enable segment base registers. (_initialize_i386_tdep) [GDB_SELF_TEST]: Add 'segments' parameter to call to i386_target_description. * i386-tdep.h (struct gdbarch_tdep): Add 'fsbase_regnum'. (enum i386_regnum): Add I386_FSBASE_REGNUM and I386_GSBASE_REGNUM. Define I386_NUM_REGS. (i386_target_description): Add 'segments' parameter to enable segment base registers. gdb/gdbserver/ChangeLog: * linux-x86-tdesc.c (i386_linux_read_description): Update call to i386_create_target_description for 'segments' parameter. * lynx-i386-low.c (lynx_i386_arch_setup): Likewise. * nto-x86-low.c (nto_x86_arch_setup): Likewise. * win32-i386-low.c (i386_arch_setup): Likewise.
This commit is contained in:
@@ -3107,15 +3107,7 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch,
|
||||
|
||||
if (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.segments") != NULL)
|
||||
{
|
||||
const struct tdesc_feature *feature =
|
||||
tdesc_find_feature (tdesc, "org.gnu.gdb.i386.segments");
|
||||
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");
|
||||
tdep->fsbase_regnum = AMD64_FSBASE_REGNUM;
|
||||
}
|
||||
|
||||
if (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.pkeys") != NULL)
|
||||
|
||||
Reference in New Issue
Block a user