diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-03-26 18:52:51 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-03-26 18:52:51 +0000 |
commit | f06daade43dc8ec839e2eb3bd8b200c4b3f9682b (patch) | |
tree | 9f0e953bfcd63c7e875e84b1821f33bdf75f987a /gdbserver | |
parent | 49a7660fb50cc3c68e7830eb098905d068a3ccbf (diff) | |
download | gdb-f06daade43dc8ec839e2eb3bd8b200c4b3f9682b.zip gdb-f06daade43dc8ec839e2eb3bd8b200c4b3f9682b.tar.gz gdb-f06daade43dc8ec839e2eb3bd8b200c4b3f9682b.tar.bz2 |
Revert "gdb/gdbserver: share I386_LINUX_XSAVE_XCR0_OFFSET definition"
This reverts commit 7816b81e9b36ea0f57662bfd7446b573bf0c9e54.
Diffstat (limited to 'gdbserver')
-rw-r--r-- | gdbserver/linux-x86-low.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc index 30d876e..872c3fc 100644 --- a/gdbserver/linux-x86-low.cc +++ b/gdbserver/linux-x86-low.cc @@ -27,7 +27,6 @@ #include "gdbsupport/x86-xstate.h" #include "nat/x86-xstate.h" #include "nat/gdb_ptrace.h" -#include "nat/x86-linux.h" #ifdef __x86_64__ #include "nat/amd64-linux-siginfo.h" @@ -833,6 +832,27 @@ x86_target::low_siginfo_fixup (siginfo_t *ptrace, gdb_byte *inf, int direction) static int use_xml; +/* Format of XSAVE extended state is: + struct + { + fxsave_bytes[0..463] + sw_usable_bytes[464..511] + xstate_hdr_bytes[512..575] + avx_bytes[576..831] + future_state etc + }; + + Same memory layout will be used for the coredump NT_X86_XSTATE + representing the XSAVE extended state registers. + + The first 8 bytes of the sw_usable_bytes[464..467] is the OS enabled + extended state mask, which is the same as the extended control register + 0 (the XFEATURE_ENABLED_MASK register), XCR0. We can use this mask + together with the mask saved in the xstate_hdr_bytes to determine what + states the processor/OS supports and what state, used or initialized, + the process/thread is in. */ +#define I386_LINUX_XSAVE_XCR0_OFFSET 464 + /* Does the current host support the GETFPXREGS request? The header file may or may not define it, and even if it is defined, the kernel will return EIO if it's running on a pre-SSE processor. */ |