aboutsummaryrefslogtreecommitdiff
path: root/gdb/amd64-linux-tdep.c
diff options
context:
space:
mode:
authorWalfred Tedeschi <walfred.tedeschi@intel.com>2013-11-20 13:02:37 +0100
committerWalfred Tedeschi <walfred.tedeschi@intel.com>2013-11-20 14:42:51 +0100
commite43e105e0d3a6cf324b19adc10d4952b553f43ee (patch)
tree0ab371baffaaf9fe978b4b032b55a1e9b8989518 /gdb/amd64-linux-tdep.c
parent1dbcd68cf12168c359df2da36b5b612100310a30 (diff)
downloadgdb-e43e105e0d3a6cf324b19adc10d4952b553f43ee.zip
gdb-e43e105e0d3a6cf324b19adc10d4952b553f43ee.tar.gz
gdb-e43e105e0d3a6cf324b19adc10d4952b553f43ee.tar.bz2
MPX for amd64
2013-06-24 Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add MPX registers. (amd64_linux_read_description): Add initialization for MPX and AVX independently. * amd64-linux-tdep.c: Includes features/i386/amd64-mpx-linux.c. (amd64_linux_gregset_reg_offset): Add MPX registers. (amd64_linux_core_read_description): Add initialization for MPX registers. (_initialize_amd64_linux_tdep): Initialize MPX targets. * amd64-linux-tdep.h (AMD64_LINUX_RAX_REGNUM): Set it to the last register on the list. (tdesc_amd64_mpx_linux) Add new target for MPX. * amd64-tdep.c: Includes features/i386/amd64-mpx.c. (amd64_mpx_names): MPX register names. (amd64_init_abi): Add MPX register while initializing the ABI. (_initialize_amd64_tdep): Initialize MPX targets. * amd64-tdep.h (amd64_regnum): Add MPX registers. (AMD64_NUM_REGS): Set number of registers taking MPX into account. Change-Id: I4a785c181e2fb45e4086650b2f87426caeb2f800 Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com> Conflicts: gdb/ChangeLog
Diffstat (limited to 'gdb/amd64-linux-tdep.c')
-rw-r--r--gdb/amd64-linux-tdep.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 73864ec..7fe92d1 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -42,6 +42,7 @@
#include "features/i386/amd64-linux.c"
#include "features/i386/amd64-avx-linux.c"
+#include "features/i386/amd64-mpx-linux.c"
#include "features/i386/x32-linux.c"
#include "features/i386/x32-avx-linux.c"
@@ -96,6 +97,8 @@ int amd64_linux_gregset_reg_offset[] =
-1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, /* MPX registers BND0 ... BND3. */
+ -1, -1, /* MPX registers BNDCFGU and BNDSTATUS. */
15 * 8 /* "orig_rax" */
};
@@ -1287,8 +1290,14 @@ amd64_linux_core_read_description (struct gdbarch *gdbarch,
{
/* Linux/x86-64. */
uint64_t xcr0 = i386_linux_core_read_xcr0 (abfd);
- switch ((xcr0 & I386_XSTATE_AVX_MASK))
+
+ switch (xcr0 & I386_XSTATE_ALL_MASK)
{
+ case I386_XSTATE_MPX_MASK:
+ if (gdbarch_ptr_bit (gdbarch) == 32)
+ return tdesc_x32_avx_linux; /* No x32 MPX falling back to AVX. */
+ else
+ return tdesc_amd64_mpx_linux;
case I386_XSTATE_AVX_MASK:
if (gdbarch_ptr_bit (gdbarch) == 32)
return tdesc_x32_avx_linux;
@@ -1623,6 +1632,7 @@ _initialize_amd64_linux_tdep (void)
/* Initialize the Linux target description. */
initialize_tdesc_amd64_linux ();
initialize_tdesc_amd64_avx_linux ();
+ initialize_tdesc_amd64_mpx_linux ();
initialize_tdesc_x32_linux ();
initialize_tdesc_x32_avx_linux ();
}