[PATCH v6 00/15] Handle variable XSAVE layouts

John Baldwin
2023-07-14T15:56:09Z

Changes since V5:

- A few fixes not tied to the new layout handling have been merged to
master.

- Reworded the comment describing i386_*_core_read_xsave_info in patches
6 and 8.

Aleksandar Paunovic (2):
gdbserver: Refactor the legacy region within the xsave struct
gdbserver: Use x86_xstate_layout to parse the XSAVE extended state
area.

John Baldwin (13):
x86: Add an x86_xsave_layout structure to handle variable XSAVE
layouts.
gdb: Store an x86_xsave_layout in i386_gdbarch_tdep.
core: Support fetching x86 XSAVE layout from architectures.
nat/x86-cpuid.h: Add x86_cpuid_count wrapper around __get_cpuid_count.
x86 nat: Add helper functions to save the XSAVE layout for the host.
gdb: Update x86 FreeBSD architectures to support XSAVE layouts.
gdb: Support XSAVE layouts for the current host in the FreeBSD x86
targets.
gdb: Update x86 Linux architectures to support XSAVE layouts.
gdb: Support XSAVE layouts for the current host in the Linux x86
targets.
gdb: Use x86_xstate_layout to parse the XSAVE extended state area.
gdbserver: Add a function to set the XSAVE mask and size.
x86: Remove X86_XSTATE_SIZE and related constants.
gdbserver: Simplify handling of ZMM registers.

gdb/amd64-fbsd-nat.c | 40 +--
gdb/amd64-fbsd-tdep.c | 12 +-
gdb/amd64-linux-nat.c | 6 +-
gdb/amd64-linux-tdep.c | 11 +-
gdb/configure.nat | 8 +-
gdb/corelow.c | 21 ++
gdb/gdbarch-gen.h | 9 +
gdb/gdbarch.c | 32 +++
gdb/gdbarch.h | 1 +
gdb/gdbarch_components.py | 11 +
gdb/i386-fbsd-nat.c | 39 +--
gdb/i386-fbsd-tdep.c | 72 ++---
gdb/i386-fbsd-tdep.h | 14 +-
gdb/i386-linux-nat.c | 8 +-
gdb/i386-linux-tdep.c | 67 ++---
gdb/i386-linux-tdep.h | 25 +-
gdb/i386-tdep.c | 18 +-
gdb/i386-tdep.h | 4 +
gdb/i387-tdep.c | 522 +++++++++++++++++++++++--------------
gdb/i387-tdep.h | 9 +
gdb/nat/x86-cpuid.h | 32 +++
gdb/nat/x86-xstate.c | 67 +++++
gdb/nat/x86-xstate.h | 35 +++
gdb/target-debug.h | 20 ++
gdb/target-delegates.c | 27 ++
gdb/target.c | 6 +
gdb/target.h | 7 +
gdb/x86-fbsd-nat.c | 21 ++
gdb/x86-fbsd-nat.h | 19 ++
gdb/x86-linux-nat.c | 3 +
gdb/x86-linux-nat.h | 7 +
gdbserver/configure.srv | 12 +-
gdbserver/i387-fp.cc | 268 +++++++++----------
gdbserver/i387-fp.h | 4 +-
gdbserver/linux-x86-low.cc | 10 +-
gdbsupport/x86-xstate.h | 77 ++++--
36 files changed, 1027 insertions(+), 517 deletions(-)
create mode 100644 gdb/nat/x86-xstate.c
create mode 100644 gdb/nat/x86-xstate.h

--
2.40.0