mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 01:28:46 +00:00
gdb: Support XSAVE layouts for the current host in the Linux x86 targets.
Note that this uses the CPUID instruction to determine the total size of the XSAVE register set. If there is a way to fetch the register set size using ptrace that would probably be better. Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
@@ -210,6 +210,7 @@ void
|
||||
amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
|
||||
{
|
||||
struct gdbarch *gdbarch = regcache->arch ();
|
||||
const i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
|
||||
int tid;
|
||||
|
||||
/* GNU/Linux LWP ID's are process ID's. */
|
||||
@@ -235,7 +236,7 @@ amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
|
||||
|
||||
if (have_ptrace_getregset == TRIBOOL_TRUE)
|
||||
{
|
||||
char xstateregs[X86_XSTATE_MAX_SIZE];
|
||||
char xstateregs[tdep->xsave_layout.sizeof_xsave];
|
||||
struct iovec iov;
|
||||
|
||||
/* Pre-4.14 kernels have a bug (fixed by commit 0852b374173b
|
||||
@@ -270,6 +271,7 @@ void
|
||||
amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum)
|
||||
{
|
||||
struct gdbarch *gdbarch = regcache->arch ();
|
||||
const i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
|
||||
int tid;
|
||||
|
||||
/* GNU/Linux LWP ID's are process ID's. */
|
||||
@@ -299,7 +301,7 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum)
|
||||
|
||||
if (have_ptrace_getregset == TRIBOOL_TRUE)
|
||||
{
|
||||
char xstateregs[X86_XSTATE_MAX_SIZE];
|
||||
char xstateregs[tdep->xsave_layout.sizeof_xsave];
|
||||
struct iovec iov;
|
||||
|
||||
iov.iov_base = xstateregs;
|
||||
|
||||
Reference in New Issue
Block a user