* [PATCH 2/2] amd64-linux: expose system register FS_BASE and GS_BASE for Linux.
2016-11-03 9:47 [PATCH 0/2] amd64: add fs_base and gs_base Walfred Tedeschi
@ 2016-11-03 9:47 ` Walfred Tedeschi
2016-11-05 14:55 ` John Baldwin
` (2 more replies)
2016-11-03 9:47 ` [PATCH 1/2] gdbserver-amd64: add HAVE_STRUCT_USER_REGS_STRUCT_(GS|FS)_BASE for gdbserver Walfred Tedeschi
2016-11-30 14:20 ` [PATCH 0/2] amd64: add fs_base and gs_base Gary Benson
2 siblings, 3 replies; 13+ messages in thread
From: Walfred Tedeschi @ 2016-11-03 9:47 UTC (permalink / raw)
To: palves, eliz, brobecker; +Cc: gdb-patches, Walfred Tedeschi
This patch allows examination of the registers FS_BASE and GS_BASE
for Linux Systems running on 64bit. Tests for simple read and write
of the new registers is also added with this patch.
Tests were performed on:
x86_64 RHEL 5.3 - For the older ptrace calls.
x86_64 Ubuntu 16.10 - For the new ptrace calls.
2016-04-26 Walfred Tedeschi <walfred.tedeschi@intel.com>
Richard Henderson <rth@redhat.com>
gdb/ChangeLog:
* amd64-linux-nat.c (PTRACE_ARCH_PRCTL): New define.
(amd64_linux_fetch_inferior_registers): Add case to fetch FS_BASE
GS_BASE for older kernels.
(amd64_linux_store_inferior_registers): Add case to store FS_BASE
GS_BASE for older kernels.
* amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Add FS_BASE
and GS_BASE to the offset table.
(amd64_linux_register_reggroup_p): Add FS_BASE and GS_BASE to the
system register group.
(amd64_linux_init_abi): Add the segment registers into
the current target description.
(amd64_x32_linux_init_abi): Add the segment registers into
the target description.
* amd64-tdep.h (amd64_regnum): Add AMD64_FSBASE_REGNUM and
AMD64_GSBASE_REGNUM.
(AMD64_NUM_REGS): Set to AMD64_GSBASE_REGNUM + 1.
* amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Change the
ORIG_RAX to be AMD64_NUM_REGS as defined in amd64-tdep.h.
* features/Makefile (amd64-linux.dat, amd64-avx-linux.dat)
(amd64-mpx-linux.dat, amd64-avx512-linux.dat, x32-linux.dat)
(x32-avx-linux.dat, x32-avx512-linux.dat): Add
i386/64bit-segments.xml in those rules.
* features/i386/64bit-segments.xml: New file.
* features/i386/amd64-avx-mpx-linux.xml: Add 64bit-segments.xml.
* features/i386/amd64-avx-linux.xml: Add 64bit-segments.xml.
* features/i386/amd64-avx512-linux.xml: Add 64bit-segments.xml.
* features/i386/amd64-mpx-linux.xml: Add 64bit-segments.xml.
* features/i386/x32-avx512-linux.xml: Add 64bit-segments.xml.
* features/i386/x32-avx-linux.xml: Add 64bit-segments.xml.
* features/i386/amd64-linux.xml: Add 64bit-segments.xml.
* features/i386/amd64-avx-linux.c: Regenerated.
* features/i386/amd64-avx-mpx-linux.c: Regenerated.
* features/i386/amd64-avx-mpx.c: Regenerated.
* features/i386/amd64-avx512-linux.c: Regenerated.
* features/i386/amd64-linux.c: Regenerated.
* features/i386/amd64-mpx-linux.c: Regenerated.
* features/i386/i386-avx-mpx-linux.c: Regenerated.
* features/i386/i386-avx-mpx.c: Regenerated.
* features/i386/x32-avx-linux.c: Regenerated.
* features/i386/x32-avx512-linux.c: Regenerated.
gdb/doc/ChangeLog:
* gdb.texinfo (i386 Features): Add system segment registers
as feature.
gdb/gdbserver/ChangeLog:
* linux-x86-low.c (x86_64_regmap): Add fs_base and gs_base
to the register table.
(x86_fill_gregset): Add support for old kernels for the
fs_base and gs_base system registers.
(x86_store_gregset): Likewise.
gdb/testsuite/ChangeLog:
* gdb.arch/amd64-gs_base.c: New file.
* gdb.arch/amd64-gs_base.exp: New file.
---
gdb/amd64-linux-nat.c | 53 ++++++++
gdb/amd64-linux-tdep.c | 35 ++++-
gdb/amd64-linux-tdep.h | 2 +-
gdb/amd64-tdep.h | 6 +-
gdb/doc/gdb.texinfo | 3 +
gdb/features/Makefile | 17 +--
gdb/features/i386/64bit-segments.xml | 12 ++
gdb/features/i386/amd64-avx-linux.c | 36 +++---
gdb/features/i386/amd64-avx-linux.xml | 1 +
gdb/features/i386/amd64-avx-mpx-linux.c | 48 +++----
gdb/features/i386/amd64-avx-mpx-linux.xml | 1 +
gdb/features/i386/amd64-avx512-linux.c | 192 ++++++++++++++--------------
gdb/features/i386/amd64-avx512-linux.xml | 1 +
gdb/features/i386/amd64-linux.c | 4 +
gdb/features/i386/amd64-linux.xml | 1 +
gdb/features/i386/amd64-mpx-linux.c | 16 ++-
gdb/features/i386/amd64-mpx-linux.xml | 1 +
gdb/features/i386/x32-avx-linux.c | 36 +++---
gdb/features/i386/x32-avx-linux.xml | 1 +
gdb/features/i386/x32-avx512-linux.c | 192 ++++++++++++++--------------
gdb/features/i386/x32-avx512-linux.xml | 1 +
gdb/features/i386/x32-linux.c | 4 +
gdb/features/i386/x32-linux.xml | 1 +
gdb/gdbserver/configure.srv | 2 +-
gdb/gdbserver/linux-x86-low.c | 32 +++++
gdb/regformats/i386/amd64-avx-linux.dat | 2 +
gdb/regformats/i386/amd64-avx-mpx-linux.dat | 2 +
gdb/regformats/i386/amd64-avx512-linux.dat | 2 +
gdb/regformats/i386/amd64-linux.dat | 2 +
gdb/regformats/i386/amd64-mpx-linux.dat | 2 +
gdb/regformats/i386/x32-avx-linux.dat | 2 +
gdb/regformats/i386/x32-avx512-linux.dat | 2 +
gdb/regformats/i386/x32-linux.dat | 2 +
gdb/testsuite/gdb.arch/amd64-gs_base.c | 33 +++++
gdb/testsuite/gdb.arch/amd64-gs_base.exp | 57 +++++++++
35 files changed, 543 insertions(+), 261 deletions(-)
create mode 100644 gdb/features/i386/64bit-segments.xml
create mode 100644 gdb/testsuite/gdb.arch/amd64-gs_base.c
create mode 100644 gdb/testsuite/gdb.arch/amd64-gs_base.exp
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 5122b04..036e3a0 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -40,6 +40,11 @@
#include "nat/linux-ptrace.h"
#include "nat/amd64-linux-siginfo.h"
+/* This definition comes from prctl.h, but some kernels may not have it. */
+#ifndef PTRACE_ARCH_PRCTL
+#define PTRACE_ARCH_PRCTL 30
+#endif
+
/* Mapping between the general-purpose registers in GNU/Linux x86-64
`struct user' format and GDB's register cache layout for GNU/Linux
i386.
@@ -171,6 +176,30 @@ amd64_linux_fetch_inferior_registers (struct target_ops *ops,
amd64_supply_fxsave (regcache, -1, &fpregs);
}
+#ifndef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+ {
+ /* PTRACE_ARCH_PRCTL is obsolete since 2.6.25, where the
+ fs_base and gs_base fields of user_regs_struct can be
+ used directly. */
+ unsigned long base;
+
+ if (regnum == -1 || regnum == AMD64_FSBASE_REGNUM)
+ {
+ if (ptrace (PTRACE_ARCH_PRCTL, tid, &base, ARCH_GET_FS) < 0)
+ perror_with_name (_("Couldn't get segment register fs_base"));
+
+ regcache_raw_supply (regcache, AMD64_FSBASE_REGNUM, &base);
+ }
+
+ if (regnum == -1 || regnum == AMD64_GSBASE_REGNUM)
+ {
+ if (ptrace (PTRACE_ARCH_PRCTL, tid, &base, ARCH_GET_GS) < 0)
+ perror_with_name (_("Couldn't get segment register gs_base"));
+
+ regcache_raw_supply (regcache, AMD64_GSBASE_REGNUM, &base);
+ }
+ }
+#endif
}
}
@@ -237,6 +266,30 @@ amd64_linux_store_inferior_registers (struct target_ops *ops,
if (ptrace (PTRACE_SETFPREGS, tid, 0, (long) &fpregs) < 0)
perror_with_name (_("Couldn't write floating point status"));
}
+
+#ifndef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+ {
+ /* PTRACE_ARCH_PRCTL is obsolete since 2.6.25, where the
+ fs_base and gs_base fields of user_regs_struct can be
+ used directly. */
+ void *base;
+
+ if (regnum == -1 || regnum == AMD64_FSBASE_REGNUM)
+ {
+ regcache_raw_collect (regcache, AMD64_FSBASE_REGNUM, &base);
+
+ if (ptrace (PTRACE_ARCH_PRCTL, tid, base, ARCH_SET_FS) < 0)
+ perror_with_name (_("Couldn't write fs_base"));
+ }
+ if (regnum == -1 || regnum == AMD64_GSBASE_REGNUM)
+ {
+
+ regcache_raw_collect (regcache, AMD64_GSBASE_REGNUM, &base);
+ if (ptrace (PTRACE_ARCH_PRCTL, tid, base, ARCH_SET_GS) < 0)
+ perror_with_name (_("Couldn't write gs_base"));
+ }
+ }
+#endif
}
}
\f
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
@@ -103,7 +103,14 @@ 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,
+ /* System register added at the end. */
+#ifdef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+ 21 * 8, 22 * 8, /* fs_base and gs_base. */
+#else
+ -1, -1, /* fs_base and gs_base. */
+#endif
15 * 8 /* "orig_rax" */
+
};
\f
@@ -284,7 +291,9 @@ static int
amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
struct reggroup *group)
{
- if (regnum == AMD64_LINUX_ORIG_RAX_REGNUM)
+ if (regnum == AMD64_LINUX_ORIG_RAX_REGNUM
+ || regnum == AMD64_FSBASE_REGNUM
+ || regnum == AMD64_GSBASE_REGNUM)
return (group == system_reggroup
|| group == save_reggroup
|| group == restore_reggroup);
@@ -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;
@@ -2099,6 +2120,18 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
if (!valid_p)
return;
+ feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.segments");
+ if (feature != NULL)
+ {
+ struct tdesc_arch_data *tdesc_data
+ = (struct tdesc_arch_data *) info.tdep_info;
+
+ tdesc_numbered_register (feature, tdesc_data,
+ AMD64_FSBASE_REGNUM, "fs_base");
+ tdesc_numbered_register (feature, tdesc_data,
+ AMD64_GSBASE_REGNUM, "gs_base");
+ }
+
amd64_linux_init_abi_common (info, gdbarch);
/* Initialize the amd64_x32_linux_record_tdep. */
diff --git a/gdb/amd64-linux-tdep.h b/gdb/amd64-linux-tdep.h
index d64d5d6..193d7b0 100644
--- a/gdb/amd64-linux-tdep.h
+++ b/gdb/amd64-linux-tdep.h
@@ -26,7 +26,7 @@
/* Register number for the "orig_rax" register. If this register
contains a value >= 0 it is interpreted as the system call number
that the kernel is supposed to restart. */
-#define AMD64_LINUX_ORIG_RAX_REGNUM (AMD64_ZMM31H_REGNUM + 1)
+#define AMD64_LINUX_ORIG_RAX_REGNUM (AMD64_NUM_REGS)
/* Total number of registers for GNU/Linux. */
#define AMD64_LINUX_NUM_REGS (AMD64_LINUX_ORIG_RAX_REGNUM + 1)
diff --git a/gdb/amd64-tdep.h b/gdb/amd64-tdep.h
index 2691e99..548c5e7 100644
--- a/gdb/amd64-tdep.h
+++ b/gdb/amd64-tdep.h
@@ -76,13 +76,15 @@ enum amd64_regnum
AMD64_K0_REGNUM,
AMD64_K7_REGNUM = AMD64_K0_REGNUM + 7,
AMD64_ZMM0H_REGNUM,
- AMD64_ZMM31H_REGNUM = AMD64_ZMM0H_REGNUM + 31
+ AMD64_ZMM31H_REGNUM = AMD64_ZMM0H_REGNUM + 31,
+ AMD64_FSBASE_REGNUM,
+ AMD64_GSBASE_REGNUM
};
/* Number of general purpose registers. */
#define AMD64_NUM_GREGS 24
-#define AMD64_NUM_REGS (AMD64_ZMM31H_REGNUM + 1)
+#define AMD64_NUM_REGS (AMD64_GSBASE_REGNUM + 1)
extern struct target_desc *tdesc_amd64;
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index df548dc..d120aba 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -41116,6 +41116,9 @@ Memory Protection Extension (MPX). It should describe the following registers:
The @samp{org.gnu.gdb.i386.linux} feature is optional. It should
describe a single register, @samp{orig_eax}.
+The @samp{org.gnu.gdb.i386.segments} feature is optional. It should
+describe two system registers: @samp{fs_base} and @samp{gs_base}.
+
The @samp{org.gnu.gdb.i386.avx512} feature is optional and requires the
@samp{org.gnu.gdb.i386.avx} feature. It should
describe additional @sc{xmm} registers:
diff --git a/gdb/features/Makefile b/gdb/features/Makefile
index 30eed5d..c87f29f 100644
--- a/gdb/features/Makefile
+++ b/gdb/features/Makefile
@@ -259,7 +259,7 @@ $(outdir)/i386/i386-linux.dat: i386/32bit-core.xml i386/32bit-sse.xml \
i386/32bit-linux.xml
$(outdir)/i386/amd64.dat: i386/64bit-core.xml i386/64bit-sse.xml
$(outdir)/i386/amd64-linux.dat: i386/64bit-core.xml i386/64bit-sse.xml \
- i386/64bit-linux.xml
+ i386/64bit-linux.xml i386/64bit-segments.xml
$(outdir)/i386/i386-avx.dat: i386/32bit-core.xml i386/32bit-avx.xml
$(outdir)/i386/i386-avx-linux.dat: i386/32bit-core.xml i386/32bit-avx.xml \
i386/32bit-linux.xml
@@ -279,11 +279,11 @@ $(outdir)/i386/i386-mmx.dat: i386/32bit-core.xml
$(outdir)/i386/i386-mmx-linux.dat: i386/32bit-core.xml i386/32bit-linux.xml
$(outdir)/i386/amd64-avx.dat: i386/64bit-core.xml i386/64bit-avx.xml
$(outdir)/i386/amd64-avx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
- i386/64bit-linux.xml
+ i386/64bit-linux.xml i386/64bit-segments.xml
$(outdir)/i386/amd64-mpx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
- i386/64bit-linux.xml i386/64bit-mpx.xml
+ i386/64bit-linux.xml i386/64bit-segments.xml i386/64bit-mpx.xml
$(outdir)/i386/amd64-avx-mpx-linux.dat: i386/64bit-core.xml \
- i386/64bit-linux.xml i386/64bit-mpx.xml
+ i386/64bit-linux.xml i386/64bit-segments.xml i386/64bit-mpx.xml
$(outdir)/i386/amd64-mpx.dat: i386/64bit-core.xml i386/64bit-avx.xml \
i386/64bit-mpx.xml
$(outdir)/i386/amd64-avx-mpx.dat: i386/64bit-core.xml \
@@ -292,17 +292,18 @@ $(outdir)/i386/amd64-avx512.dat: i386/64bit-core.xml i386/64bit-avx.xml \
i386/64bit-mpx.xml i386/64bit-avx512.xml
$(outdir)/i386/amd64-avx512-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
i386/64bit-mpx.xml i386/64bit-avx512.xml \
- i386/64bit-linux.xml
+ i386/64bit-linux.xml i386/64bit-segments.xml
$(outdir)/i386/x32.dat: i386/x32-core.xml i386/64bit-sse.xml
$(outdir)/i386/x32-linux.dat: i386/x32-core.xml i386/64bit-sse.xml \
- i386/64bit-linux.xml
+ i386/64bit-linux.xml i386/64bit-segments.xml
$(outdir)/i386/x32-avx.dat: i386/x32-core.xml i386/64bit-avx.xml
$(outdir)/i386/x32-avx-linux.dat: i386/x32-core.xml i386/64bit-avx.xml \
- i386/64bit-linux.xml
+ i386/64bit-linux.xml i386/64bit-segments.xml
$(outdir)/i386/x32-avx512.dat: i386/x32-core.xml i386/64bit-avx.xml \
i386/64bit-mpx.xml i386/64bit-avx512.xml
$(outdir)/i386/x32-avx512-linux.dat: i386/x32-core.xml i386/64bit-avx.xml \
- i386/64bit-mpx.xml i386/64bit-avx512.xml i386/64bit-linux.xml
+ i386/64bit-mpx.xml i386/64bit-avx512.xml \
+ i386/64bit-linux.xml i386/64bit-segments.xml
# 'all' doesn't build the C files, so don't delete them in 'clean'
# either.
diff --git a/gdb/features/i386/64bit-segments.xml b/gdb/features/i386/64bit-segments.xml
new file mode 100644
index 0000000..0ea55f5
--- /dev/null
+++ b/gdb/features/i386/64bit-segments.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2016 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="64" type="int" regnum="58"/>
+ <reg name="gs_base" bitsize="64" type="int" regnum="59"/>
+</feature>
diff --git a/gdb/features/i386/amd64-avx-linux.c b/gdb/features/i386/amd64-avx-linux.c
index 9c8f9eb..1d56dbf 100644
--- a/gdb/features/i386/amd64-avx-linux.c
+++ b/gdb/features/i386/amd64-avx-linux.c
@@ -151,23 +151,27 @@ initialize_tdesc_amd64_avx_linux (void)
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.segments");
+ tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "int");
+
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
- tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm0h", 60, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm1h", 61, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm2h", 62, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm3h", 63, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm4h", 64, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm5h", 65, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm6h", 66, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm7h", 67, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm8h", 68, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm9h", 69, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm10h", 70, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm11h", 71, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm12h", 72, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm13h", 73, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm14h", 74, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm15h", 75, 1, NULL, 128, "uint128");
tdesc_amd64_avx_linux = result;
}
diff --git a/gdb/features/i386/amd64-avx-linux.xml b/gdb/features/i386/amd64-avx-linux.xml
index adb3835..50ada07 100644
--- a/gdb/features/i386/amd64-avx-linux.xml
+++ b/gdb/features/i386/amd64-avx-linux.xml
@@ -14,5 +14,6 @@
<xi:include href="64bit-core.xml"/>
<xi:include href="64bit-sse.xml"/>
<xi:include href="64bit-linux.xml"/>
+ <xi:include href="64bit-segments.xml"/>
<xi:include href="64bit-avx.xml"/>
</target>
diff --git a/gdb/features/i386/amd64-avx-mpx-linux.c b/gdb/features/i386/amd64-avx-mpx-linux.c
index 4605480..26c1339 100644
--- a/gdb/features/i386/amd64-avx-mpx-linux.c
+++ b/gdb/features/i386/amd64-avx-mpx-linux.c
@@ -151,23 +151,27 @@ initialize_tdesc_amd64_avx_mpx_linux (void)
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.segments");
+ tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "int");
+
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
- tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm0h", 60, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm1h", 61, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm2h", 62, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm3h", 63, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm4h", 64, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm5h", 65, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm6h", 66, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm7h", 67, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm8h", 68, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm9h", 69, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm10h", 70, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm11h", 71, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm12h", 72, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm13h", 73, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm14h", 74, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm15h", 75, 1, NULL, 128, "uint128");
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
type = tdesc_create_struct (feature, "br128");
@@ -200,12 +204,12 @@ initialize_tdesc_amd64_avx_mpx_linux (void)
field_type = tdesc_named_type (feature, "_bndcfgu");
tdesc_add_field (type, "config", field_type);
- tdesc_create_reg (feature, "bnd0raw", 74, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd1raw", 75, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd2raw", 76, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd3raw", 77, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bndcfgu", 78, 1, NULL, 64, "cfgu");
- tdesc_create_reg (feature, "bndstatus", 79, 1, NULL, 64, "status");
+ tdesc_create_reg (feature, "bnd0raw", 76, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd1raw", 77, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd2raw", 78, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd3raw", 79, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bndcfgu", 80, 1, NULL, 64, "cfgu");
+ tdesc_create_reg (feature, "bndstatus", 81, 1, NULL, 64, "status");
tdesc_amd64_avx_mpx_linux = result;
}
diff --git a/gdb/features/i386/amd64-avx-mpx-linux.xml b/gdb/features/i386/amd64-avx-mpx-linux.xml
index 526c700..ff47c03 100644
--- a/gdb/features/i386/amd64-avx-mpx-linux.xml
+++ b/gdb/features/i386/amd64-avx-mpx-linux.xml
@@ -14,6 +14,7 @@
<xi:include href="64bit-core.xml"/>
<xi:include href="64bit-sse.xml"/>
<xi:include href="64bit-linux.xml"/>
+ <xi:include href="64bit-segments.xml"/>
<xi:include href="64bit-avx.xml"/>
<xi:include href="64bit-mpx.xml"/>
</target>
diff --git a/gdb/features/i386/amd64-avx512-linux.c b/gdb/features/i386/amd64-avx512-linux.c
index ec3ba61..b071f62 100644
--- a/gdb/features/i386/amd64-avx512-linux.c
+++ b/gdb/features/i386/amd64-avx512-linux.c
@@ -151,23 +151,27 @@ initialize_tdesc_amd64_avx512_linux (void)
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.segments");
+ tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "int");
+
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
- tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm0h", 60, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm1h", 61, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm2h", 62, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm3h", 63, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm4h", 64, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm5h", 65, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm6h", 66, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm7h", 67, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm8h", 68, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm9h", 69, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm10h", 70, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm11h", 71, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm12h", 72, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm13h", 73, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm14h", 74, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm15h", 75, 1, NULL, 128, "uint128");
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
type = tdesc_create_struct (feature, "br128");
@@ -200,12 +204,12 @@ initialize_tdesc_amd64_avx512_linux (void)
field_type = tdesc_named_type (feature, "_bndcfgu");
tdesc_add_field (type, "config", field_type);
- tdesc_create_reg (feature, "bnd0raw", 74, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd1raw", 75, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd2raw", 76, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd3raw", 77, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bndcfgu", 78, 1, NULL, 64, "cfgu");
- tdesc_create_reg (feature, "bndstatus", 79, 1, NULL, 64, "status");
+ tdesc_create_reg (feature, "bnd0raw", 76, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd1raw", 77, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd2raw", 78, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd3raw", 79, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bndcfgu", 80, 1, NULL, 64, "cfgu");
+ tdesc_create_reg (feature, "bndstatus", 81, 1, NULL, 64, "status");
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx512");
field_type = tdesc_named_type (feature, "ieee_single");
@@ -245,78 +249,78 @@ initialize_tdesc_amd64_avx512_linux (void)
field_type = tdesc_named_type (feature, "uint128");
tdesc_create_vector (feature, "v2ui128", field_type, 2);
- tdesc_create_reg (feature, "xmm16", 80, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm17", 81, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm18", 82, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm19", 83, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm20", 84, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm21", 85, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm22", 86, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm23", 87, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm24", 88, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm25", 89, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm26", 90, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm27", 91, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm28", 92, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm29", 93, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm30", 94, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm31", 95, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "ymm16h", 96, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm17h", 97, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm18h", 98, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm19h", 99, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm20h", 100, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm21h", 101, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm22h", 102, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm23h", 103, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm24h", 104, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm25h", 105, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm26h", 106, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm27h", 107, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm28h", 108, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm29h", 109, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm30h", 110, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm31h", 111, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "k0", 112, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k1", 113, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k2", 114, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k3", 115, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k4", 116, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k5", 117, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k6", 118, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k7", 119, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "zmm0h", 120, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm1h", 121, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm2h", 122, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm3h", 123, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm4h", 124, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm5h", 125, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm6h", 126, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm7h", 127, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm8h", 128, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm9h", 129, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm10h", 130, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm11h", 131, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm12h", 132, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm13h", 133, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm14h", 134, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm15h", 135, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm16h", 136, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm17h", 137, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm18h", 138, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm19h", 139, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm20h", 140, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm21h", 141, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm22h", 142, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm23h", 143, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm24h", 144, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm25h", 145, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm26h", 146, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm27h", 147, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm28h", 148, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm29h", 149, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm30h", 150, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm31h", 151, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "xmm16", 82, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm17", 83, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm18", 84, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm19", 85, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm20", 86, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm21", 87, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm22", 88, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm23", 89, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm24", 90, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm25", 91, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm26", 92, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm27", 93, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm28", 94, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm29", 95, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm30", 96, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm31", 97, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "ymm16h", 98, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm17h", 99, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm18h", 100, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm19h", 101, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm20h", 102, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm21h", 103, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm22h", 104, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm23h", 105, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm24h", 106, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm25h", 107, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm26h", 108, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm27h", 109, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm28h", 110, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm29h", 111, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm30h", 112, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm31h", 113, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "k0", 114, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k1", 115, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k2", 116, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k3", 117, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k4", 118, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k5", 119, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k6", 120, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k7", 121, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "zmm0h", 122, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm1h", 123, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm2h", 124, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm3h", 125, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm4h", 126, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm5h", 127, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm6h", 128, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm7h", 129, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm8h", 130, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm9h", 131, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm10h", 132, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm11h", 133, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm12h", 134, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm13h", 135, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm14h", 136, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm15h", 137, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm16h", 138, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm17h", 139, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm18h", 140, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm19h", 141, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm20h", 142, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm21h", 143, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm22h", 144, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm23h", 145, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm24h", 146, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm25h", 147, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm26h", 148, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm27h", 149, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm28h", 150, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm29h", 151, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm30h", 152, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm31h", 153, 1, NULL, 256, "v2ui128");
tdesc_amd64_avx512_linux = result;
}
diff --git a/gdb/features/i386/amd64-avx512-linux.xml b/gdb/features/i386/amd64-avx512-linux.xml
index f8eb35a..c154a0c 100644
--- a/gdb/features/i386/amd64-avx512-linux.xml
+++ b/gdb/features/i386/amd64-avx512-linux.xml
@@ -14,6 +14,7 @@
<xi:include href="64bit-core.xml"/>
<xi:include href="64bit-sse.xml"/>
<xi:include href="64bit-linux.xml"/>
+ <xi:include href="64bit-segments.xml"/>
<xi:include href="64bit-avx.xml"/>
<xi:include href="64bit-mpx.xml"/>
<xi:include href="64bit-avx512.xml"/>
diff --git a/gdb/features/i386/amd64-linux.c b/gdb/features/i386/amd64-linux.c
index 02aeba5..0e921ba9 100644
--- a/gdb/features/i386/amd64-linux.c
+++ b/gdb/features/i386/amd64-linux.c
@@ -151,5 +151,9 @@ initialize_tdesc_amd64_linux (void)
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.segments");
+ tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "int");
+
tdesc_amd64_linux = result;
}
diff --git a/gdb/features/i386/amd64-linux.xml b/gdb/features/i386/amd64-linux.xml
index f665a5b..d0cd3e5 100644
--- a/gdb/features/i386/amd64-linux.xml
+++ b/gdb/features/i386/amd64-linux.xml
@@ -14,4 +14,5 @@
<xi:include href="64bit-core.xml"/>
<xi:include href="64bit-sse.xml"/>
<xi:include href="64bit-linux.xml"/>
+ <xi:include href="64bit-segments.xml"/>
</target>
diff --git a/gdb/features/i386/amd64-mpx-linux.c b/gdb/features/i386/amd64-mpx-linux.c
index a20ca4f..e26a74a 100644
--- a/gdb/features/i386/amd64-mpx-linux.c
+++ b/gdb/features/i386/amd64-mpx-linux.c
@@ -151,6 +151,10 @@ initialize_tdesc_amd64_mpx_linux (void)
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.segments");
+ tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "int");
+
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
type = tdesc_create_struct (feature, "br128");
field_type = tdesc_named_type (feature, "uint64");
@@ -182,12 +186,12 @@ initialize_tdesc_amd64_mpx_linux (void)
field_type = tdesc_named_type (feature, "_bndcfgu");
tdesc_add_field (type, "config", field_type);
- tdesc_create_reg (feature, "bnd0raw", 58, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd1raw", 59, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd2raw", 60, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd3raw", 61, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bndcfgu", 62, 1, NULL, 64, "cfgu");
- tdesc_create_reg (feature, "bndstatus", 63, 1, NULL, 64, "status");
+ tdesc_create_reg (feature, "bnd0raw", 60, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd1raw", 61, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd2raw", 62, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd3raw", 63, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bndcfgu", 64, 1, NULL, 64, "cfgu");
+ tdesc_create_reg (feature, "bndstatus", 65, 1, NULL, 64, "status");
tdesc_amd64_mpx_linux = result;
}
diff --git a/gdb/features/i386/amd64-mpx-linux.xml b/gdb/features/i386/amd64-mpx-linux.xml
index 835126b..074db32 100644
--- a/gdb/features/i386/amd64-mpx-linux.xml
+++ b/gdb/features/i386/amd64-mpx-linux.xml
@@ -14,5 +14,6 @@
<xi:include href="64bit-core.xml"/>
<xi:include href="64bit-sse.xml"/>
<xi:include href="64bit-linux.xml"/>
+ <xi:include href="64bit-segments.xml"/>
<xi:include href="64bit-mpx.xml"/>
</target>
diff --git a/gdb/features/i386/x32-avx-linux.c b/gdb/features/i386/x32-avx-linux.c
index b12c71c..8406815 100644
--- a/gdb/features/i386/x32-avx-linux.c
+++ b/gdb/features/i386/x32-avx-linux.c
@@ -151,23 +151,27 @@ initialize_tdesc_x32_avx_linux (void)
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.segments");
+ tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "int");
+
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
- tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm0h", 60, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm1h", 61, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm2h", 62, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm3h", 63, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm4h", 64, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm5h", 65, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm6h", 66, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm7h", 67, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm8h", 68, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm9h", 69, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm10h", 70, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm11h", 71, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm12h", 72, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm13h", 73, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm14h", 74, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm15h", 75, 1, NULL, 128, "uint128");
tdesc_x32_avx_linux = result;
}
diff --git a/gdb/features/i386/x32-avx-linux.xml b/gdb/features/i386/x32-avx-linux.xml
index 0cae967..21314a6 100644
--- a/gdb/features/i386/x32-avx-linux.xml
+++ b/gdb/features/i386/x32-avx-linux.xml
@@ -14,5 +14,6 @@
<xi:include href="x32-core.xml"/>
<xi:include href="64bit-sse.xml"/>
<xi:include href="64bit-linux.xml"/>
+ <xi:include href="64bit-segments.xml"/>
<xi:include href="64bit-avx.xml"/>
</target>
diff --git a/gdb/features/i386/x32-avx512-linux.c b/gdb/features/i386/x32-avx512-linux.c
index 7b2ab90..3994996 100644
--- a/gdb/features/i386/x32-avx512-linux.c
+++ b/gdb/features/i386/x32-avx512-linux.c
@@ -151,23 +151,27 @@ initialize_tdesc_x32_avx512_linux (void)
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.segments");
+ tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "int");
+
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx");
- tdesc_create_reg (feature, "ymm0h", 58, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm1h", 59, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm2h", 60, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm3h", 61, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm4h", 62, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm5h", 63, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm6h", 64, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm7h", 65, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm8h", 66, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm9h", 67, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm10h", 68, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm11h", 69, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm12h", 70, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm13h", 71, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm14h", 72, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm15h", 73, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm0h", 60, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm1h", 61, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm2h", 62, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm3h", 63, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm4h", 64, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm5h", 65, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm6h", 66, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm7h", 67, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm8h", 68, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm9h", 69, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm10h", 70, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm11h", 71, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm12h", 72, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm13h", 73, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm14h", 74, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm15h", 75, 1, NULL, 128, "uint128");
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx");
type = tdesc_create_struct (feature, "br128");
@@ -200,12 +204,12 @@ initialize_tdesc_x32_avx512_linux (void)
field_type = tdesc_named_type (feature, "_bndcfgu");
tdesc_add_field (type, "config", field_type);
- tdesc_create_reg (feature, "bnd0raw", 74, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd1raw", 75, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd2raw", 76, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bnd3raw", 77, 1, NULL, 128, "br128");
- tdesc_create_reg (feature, "bndcfgu", 78, 1, NULL, 64, "cfgu");
- tdesc_create_reg (feature, "bndstatus", 79, 1, NULL, 64, "status");
+ tdesc_create_reg (feature, "bnd0raw", 76, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd1raw", 77, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd2raw", 78, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bnd3raw", 79, 1, NULL, 128, "br128");
+ tdesc_create_reg (feature, "bndcfgu", 80, 1, NULL, 64, "cfgu");
+ tdesc_create_reg (feature, "bndstatus", 81, 1, NULL, 64, "status");
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.avx512");
field_type = tdesc_named_type (feature, "ieee_single");
@@ -245,78 +249,78 @@ initialize_tdesc_x32_avx512_linux (void)
field_type = tdesc_named_type (feature, "uint128");
tdesc_create_vector (feature, "v2ui128", field_type, 2);
- tdesc_create_reg (feature, "xmm16", 80, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm17", 81, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm18", 82, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm19", 83, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm20", 84, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm21", 85, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm22", 86, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm23", 87, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm24", 88, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm25", 89, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm26", 90, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm27", 91, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm28", 92, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm29", 93, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm30", 94, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "xmm31", 95, 1, NULL, 128, "vec128");
- tdesc_create_reg (feature, "ymm16h", 96, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm17h", 97, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm18h", 98, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm19h", 99, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm20h", 100, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm21h", 101, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm22h", 102, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm23h", 103, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm24h", 104, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm25h", 105, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm26h", 106, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm27h", 107, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm28h", 108, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm29h", 109, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm30h", 110, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "ymm31h", 111, 1, NULL, 128, "uint128");
- tdesc_create_reg (feature, "k0", 112, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k1", 113, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k2", 114, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k3", 115, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k4", 116, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k5", 117, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k6", 118, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "k7", 119, 1, NULL, 64, "uint64");
- tdesc_create_reg (feature, "zmm0h", 120, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm1h", 121, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm2h", 122, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm3h", 123, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm4h", 124, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm5h", 125, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm6h", 126, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm7h", 127, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm8h", 128, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm9h", 129, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm10h", 130, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm11h", 131, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm12h", 132, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm13h", 133, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm14h", 134, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm15h", 135, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm16h", 136, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm17h", 137, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm18h", 138, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm19h", 139, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm20h", 140, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm21h", 141, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm22h", 142, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm23h", 143, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm24h", 144, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm25h", 145, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm26h", 146, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm27h", 147, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm28h", 148, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm29h", 149, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm30h", 150, 1, NULL, 256, "v2ui128");
- tdesc_create_reg (feature, "zmm31h", 151, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "xmm16", 82, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm17", 83, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm18", 84, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm19", 85, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm20", 86, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm21", 87, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm22", 88, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm23", 89, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm24", 90, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm25", 91, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm26", 92, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm27", 93, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm28", 94, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm29", 95, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm30", 96, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "xmm31", 97, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "ymm16h", 98, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm17h", 99, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm18h", 100, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm19h", 101, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm20h", 102, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm21h", 103, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm22h", 104, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm23h", 105, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm24h", 106, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm25h", 107, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm26h", 108, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm27h", 109, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm28h", 110, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm29h", 111, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm30h", 112, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "ymm31h", 113, 1, NULL, 128, "uint128");
+ tdesc_create_reg (feature, "k0", 114, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k1", 115, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k2", 116, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k3", 117, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k4", 118, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k5", 119, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k6", 120, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "k7", 121, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "zmm0h", 122, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm1h", 123, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm2h", 124, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm3h", 125, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm4h", 126, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm5h", 127, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm6h", 128, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm7h", 129, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm8h", 130, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm9h", 131, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm10h", 132, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm11h", 133, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm12h", 134, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm13h", 135, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm14h", 136, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm15h", 137, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm16h", 138, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm17h", 139, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm18h", 140, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm19h", 141, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm20h", 142, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm21h", 143, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm22h", 144, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm23h", 145, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm24h", 146, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm25h", 147, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm26h", 148, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm27h", 149, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm28h", 150, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm29h", 151, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm30h", 152, 1, NULL, 256, "v2ui128");
+ tdesc_create_reg (feature, "zmm31h", 153, 1, NULL, 256, "v2ui128");
tdesc_x32_avx512_linux = result;
}
diff --git a/gdb/features/i386/x32-avx512-linux.xml b/gdb/features/i386/x32-avx512-linux.xml
index 2056873..579be87 100644
--- a/gdb/features/i386/x32-avx512-linux.xml
+++ b/gdb/features/i386/x32-avx512-linux.xml
@@ -14,6 +14,7 @@
<xi:include href="x32-core.xml"/>
<xi:include href="64bit-sse.xml"/>
<xi:include href="64bit-linux.xml"/>
+ <xi:include href="64bit-segments.xml"/>
<xi:include href="64bit-avx.xml"/>
<xi:include href="64bit-mpx.xml"/>
<xi:include href="64bit-avx512.xml"/>
diff --git a/gdb/features/i386/x32-linux.c b/gdb/features/i386/x32-linux.c
index 1262688..ae49549 100644
--- a/gdb/features/i386/x32-linux.c
+++ b/gdb/features/i386/x32-linux.c
@@ -151,5 +151,9 @@ initialize_tdesc_x32_linux (void)
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.linux");
tdesc_create_reg (feature, "orig_rax", 57, 1, NULL, 64, "int");
+ feature = tdesc_create_feature (result, "org.gnu.gdb.i386.segments");
+ tdesc_create_reg (feature, "fs_base", 58, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "gs_base", 59, 1, NULL, 64, "int");
+
tdesc_x32_linux = result;
}
diff --git a/gdb/features/i386/x32-linux.xml b/gdb/features/i386/x32-linux.xml
index 7311500..957aaf2 100644
--- a/gdb/features/i386/x32-linux.xml
+++ b/gdb/features/i386/x32-linux.xml
@@ -14,4 +14,5 @@
<xi:include href="x32-core.xml"/>
<xi:include href="64bit-sse.xml"/>
<xi:include href="64bit-linux.xml"/>
+ <xi:include href="64bit-segments.xml"/>
</target>
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 3267599..d03dcb9 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -35,7 +35,7 @@ ipa_x32_linux_regobj="x32-linux-ipa.o x32-avx-linux-ipa.o x32-avx512-linux-ipa.o
ipa_ppc_linux_regobj="powerpc-32l-ipa.o powerpc-altivec32l-ipa.o powerpc-cell32l-ipa.o powerpc-vsx32l-ipa.o powerpc-isa205-32l-ipa.o powerpc-isa205-altivec32l-ipa.o powerpc-isa205-vsx32l-ipa.o powerpc-e500l-ipa.o powerpc-64l-ipa.o powerpc-altivec64l-ipa.o powerpc-cell64l-ipa.o powerpc-vsx64l-ipa.o powerpc-isa205-64l-ipa.o powerpc-isa205-altivec64l-ipa.o powerpc-isa205-vsx64l-ipa.o"
srv_i386_32bit_xmlfiles="i386/32bit-core.xml i386/32bit-sse.xml i386/32bit-avx.xml i386/32bit-avx512.xml i386/32bit-mpx.xml"
-srv_i386_64bit_xmlfiles="i386/64bit-core.xml i386/64bit-sse.xml i386/64bit-avx.xml i386/64bit-avx512.xml i386/x32-core.xml i386/64bit-mpx.xml"
+srv_i386_64bit_xmlfiles="i386/64bit-core.xml i386/64bit-segments.xml i386/64bit-sse.xml i386/64bit-avx.xml i386/64bit-avx512.xml i386/x32-core.xml i386/64bit-mpx.xml"
srv_i386_xmlfiles="i386/i386.xml i386/i386-avx.xml i386/i386-avx512.xml i386/i386-mpx.xml i386/i386-avx-mpx.xml i386/i386-mmx.xml $srv_i386_32bit_xmlfiles"
srv_amd64_xmlfiles="i386/amd64.xml i386/amd64-avx.xml i386/amd64-avx512.xml i386/x32.xml i386/x32-avx.xml i386/x32-avx512.xml i386/amd64-mpx.xml i386/amd64-avx-mpx.xml $srv_i386_64bit_xmlfiles"
srv_i386_linux_xmlfiles="i386/i386-linux.xml i386/i386-avx-linux.xml i386/i386-avx512-linux.xml i386/i386-mmx-linux.xml i386/32bit-linux.xml i386/i386-mpx-linux.xml i386/i386-avx-mpx-linux.xml $srv_i386_32bit_xmlfiles"
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index acded1a..53ea1f4 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -133,6 +133,11 @@ static const int x86_64_regmap[] =
-1,
-1, -1, -1, -1, -1, -1, -1, -1,
ORIG_RAX * 8,
+#ifdef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+ 21 * 8, 22 * 8,
+#else
+ -1, -1,
+#endif
-1, -1, -1, -1, /* MPX registers BND0 ... BND3. */
-1, -1, /* MPX registers BNDCFGU, BNDSTATUS. */
-1, -1, -1, -1, -1, -1, -1, -1, /* xmm16 ... xmm31 (AVX512) */
@@ -306,6 +311,20 @@ x86_fill_gregset (struct regcache *regcache, void *buf)
for (i = 0; i < X86_64_NUM_REGS; i++)
if (x86_64_regmap[i] != -1)
collect_register (regcache, i, ((char *) buf) + x86_64_regmap[i]);
+
+#ifndef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+ {
+ unsigned long base;
+ int lwpid = lwpid_of (current_thread);
+
+ collect_register_by_name (regcache, "fs_base", &base);
+ ptrace (PTRACE_ARCH_PRCTL, lwpid, &base, ARCH_SET_FS);
+
+ collect_register_by_name (regcache, "gs_base", &base);
+ ptrace (PTRACE_ARCH_PRCTL, lwpid, &base, ARCH_SET_GS);
+ }
+#endif
+
return;
}
@@ -332,6 +351,19 @@ x86_store_gregset (struct regcache *regcache, const void *buf)
for (i = 0; i < X86_64_NUM_REGS; i++)
if (x86_64_regmap[i] != -1)
supply_register (regcache, i, ((char *) buf) + x86_64_regmap[i]);
+
+#ifndef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE
+ {
+ unsigned long base;
+ int lwpid = lwpid_of (current_thread);
+
+ if (ptrace (PTRACE_ARCH_PRCTL, lwpid, &base, ARCH_GET_FS) == 0)
+ supply_register_by_name (regcache, "fs_base", &base);
+
+ if (ptrace (PTRACE_ARCH_PRCTL, lwpid, &base, ARCH_GET_GS) == 0)
+ supply_register_by_name (regcache, "gs_base", &base);
+ }
+#endif
return;
}
#endif
diff --git a/gdb/regformats/i386/amd64-avx-linux.dat b/gdb/regformats/i386/amd64-avx-linux.dat
index d8199da..7780b3b 100644
--- a/gdb/regformats/i386/amd64-avx-linux.dat
+++ b/gdb/regformats/i386/amd64-avx-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
128:xmm15
32:mxcsr
64:orig_rax
+64:fs_base
+64:gs_base
128:ymm0h
128:ymm1h
128:ymm2h
diff --git a/gdb/regformats/i386/amd64-avx-mpx-linux.dat b/gdb/regformats/i386/amd64-avx-mpx-linux.dat
index 6d45324..7c2f928 100644
--- a/gdb/regformats/i386/amd64-avx-mpx-linux.dat
+++ b/gdb/regformats/i386/amd64-avx-mpx-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
128:xmm15
32:mxcsr
64:orig_rax
+64:fs_base
+64:gs_base
128:ymm0h
128:ymm1h
128:ymm2h
diff --git a/gdb/regformats/i386/amd64-avx512-linux.dat b/gdb/regformats/i386/amd64-avx512-linux.dat
index dfc41e2..f1658d3 100644
--- a/gdb/regformats/i386/amd64-avx512-linux.dat
+++ b/gdb/regformats/i386/amd64-avx512-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
128:xmm15
32:mxcsr
64:orig_rax
+64:fs_base
+64:gs_base
128:ymm0h
128:ymm1h
128:ymm2h
diff --git a/gdb/regformats/i386/amd64-linux.dat b/gdb/regformats/i386/amd64-linux.dat
index 6914cc4..cd16a15 100644
--- a/gdb/regformats/i386/amd64-linux.dat
+++ b/gdb/regformats/i386/amd64-linux.dat
@@ -61,3 +61,5 @@ expedite:rbp,rsp,rip
128:xmm15
32:mxcsr
64:orig_rax
+64:fs_base
+64:gs_base
diff --git a/gdb/regformats/i386/amd64-mpx-linux.dat b/gdb/regformats/i386/amd64-mpx-linux.dat
index 523ae01..10487f6 100644
--- a/gdb/regformats/i386/amd64-mpx-linux.dat
+++ b/gdb/regformats/i386/amd64-mpx-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
128:xmm15
32:mxcsr
64:orig_rax
+64:fs_base
+64:gs_base
128:bnd0raw
128:bnd1raw
128:bnd2raw
diff --git a/gdb/regformats/i386/x32-avx-linux.dat b/gdb/regformats/i386/x32-avx-linux.dat
index a2b8d02..eb0e3953 100644
--- a/gdb/regformats/i386/x32-avx-linux.dat
+++ b/gdb/regformats/i386/x32-avx-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
128:xmm15
32:mxcsr
64:orig_rax
+64:fs_base
+64:gs_base
128:ymm0h
128:ymm1h
128:ymm2h
diff --git a/gdb/regformats/i386/x32-avx512-linux.dat b/gdb/regformats/i386/x32-avx512-linux.dat
index 0f5b2ce..0b7f73a 100644
--- a/gdb/regformats/i386/x32-avx512-linux.dat
+++ b/gdb/regformats/i386/x32-avx512-linux.dat
@@ -61,6 +61,8 @@ expedite:rbp,rsp,rip
128:xmm15
32:mxcsr
64:orig_rax
+64:fs_base
+64:gs_base
128:ymm0h
128:ymm1h
128:ymm2h
diff --git a/gdb/regformats/i386/x32-linux.dat b/gdb/regformats/i386/x32-linux.dat
index d976a25..eee378f 100644
--- a/gdb/regformats/i386/x32-linux.dat
+++ b/gdb/regformats/i386/x32-linux.dat
@@ -61,3 +61,5 @@ expedite:rbp,rsp,rip
128:xmm15
32:mxcsr
64:orig_rax
+64:fs_base
+64:gs_base
diff --git a/gdb/testsuite/gdb.arch/amd64-gs_base.c b/gdb/testsuite/gdb.arch/amd64-gs_base.c
new file mode 100644
index 0000000..b177d57
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-gs_base.c
@@ -0,0 +1,33 @@
+/* Unwinder test program for fs_base and gs_base.
+
+ Copyright 2016 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+func (int a)
+{
+ return a * a;
+}
+
+int
+main (void)
+{
+ volatile int a;
+ a = 10;
+ a = func (a);
+ return a;
+}
diff --git a/gdb/testsuite/gdb.arch/amd64-gs_base.exp b/gdb/testsuite/gdb.arch/amd64-gs_base.exp
new file mode 100644
index 0000000..ccd6b87
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-gs_base.exp
@@ -0,0 +1,57 @@
+# Copyright 2016 Free Software Foundation, Inc.
+
+# This file is part of the GDB testsuite.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if { ![istarget "x86_64-*linux*"] } then {
+ verbose "Skipping x86_64 fs_base and gs_base tests."
+ return
+}
+
+standard_testfile
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+ executable { debug }] != "" } {
+ untested ${testfile}.exp
+ return -1
+}
+
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+runto func
+
+gdb_test "print /x \$fs_base" "= $hex" "print fs_base"
+gdb_test "print /x \$gs_base" "= $hex" "print gs_base"
+
+gdb_test "print \$fs_base = 2" "= 2" "set fs_base"
+gdb_test "print \$gs_base = 3" "= 3" "set gs_base"
+
+# Test the presence of fs_base and gs_base on the system
+# register group and values.
+#
+set ws "\[\t \]*"
+set info_reg_out [multi_line "info register sys" \
+ "fs_base${ws}0x2${ws}2"\
+ "gs_base${ws}0x3${ws}3"\
+ "orig_rax${ws}$hex${ws}\[-\]$decimal" ]
+
+gdb_test "info register sys" $info_reg_out\
+ "info registers fs_base and gs_base with value "
+
--
2.9.3
^ permalink raw reply [flat|nested] 13+ messages in thread