diff options
author | John Baldwin <jhb@FreeBSD.org> | 2019-03-12 13:39:02 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2019-03-12 13:39:02 -0700 |
commit | 1163a4b7a38a79ebd153dc5ee76ce93877d21dbd (patch) | |
tree | a05739b03daf22efcb07be32a1526f26ca19a9fd /gdb/features | |
parent | 7cde5fc2ec2e32e8a81ac613d26cf86bf8623816 (diff) | |
download | gdb-1163a4b7a38a79ebd153dc5ee76ce93877d21dbd.zip gdb-1163a4b7a38a79ebd153dc5ee76ce93877d21dbd.tar.gz gdb-1163a4b7a38a79ebd153dc5ee76ce93877d21dbd.tar.bz2 |
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.
Diffstat (limited to 'gdb/features')
-rw-r--r-- | gdb/features/i386/32bit-segments.c | 15 | ||||
-rw-r--r-- | gdb/features/i386/32bit-segments.xml | 12 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gdb/features/i386/32bit-segments.c b/gdb/features/i386/32bit-segments.c new file mode 100644 index 0000000..c22c3df --- /dev/null +++ b/gdb/features/i386/32bit-segments.c @@ -0,0 +1,15 @@ +/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro: + Original: 32bit-segments.xml */ + +#include "common/tdesc.h" + +static int +create_feature_i386_32bit_segments (struct target_desc *result, long regnum) +{ + struct tdesc_feature *feature; + + feature = tdesc_create_feature (result, "org.gnu.gdb.i386.segments"); + tdesc_create_reg (feature, "fs_base", regnum++, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "gs_base", regnum++, 1, NULL, 32, "int"); + return regnum; +} diff --git a/gdb/features/i386/32bit-segments.xml b/gdb/features/i386/32bit-segments.xml new file mode 100644 index 0000000..098948e --- /dev/null +++ b/gdb/features/i386/32bit-segments.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- Copyright (C) 2016-2018 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. --> + +<!DOCTYPE feature SYSTEM "gdb-target.dtd"> +<feature name="org.gnu.gdb.i386.segments"> + <reg name="fs_base" bitsize="32" type="int"/> + <reg name="gs_base" bitsize="32" type="int"/> +</feature> |