x86 nat: Add helper functions to save the XSAVE layout for the host.
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 28 Aug 2023 21:18:19 +0000 (14:18 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Mon, 28 Aug 2023 21:18:19 +0000 (14:18 -0700)
commit2e639674c56a35a14ebb33bcfcd9ff614a516735
tree4f9be15461f1d2790124134cafa4abd53e02ac3a
parente85aad4ae764d7fbc02d4f6a5729c1308597499f
x86 nat: Add helper functions to save the XSAVE layout for the host.

x86_xsave_length returns the total length of the XSAVE state area
standard format as queried from CPUID.

x86_fetch_xsave_layout uses CPUID to query the offsets of XSAVE
extended regions from the running host.  The total length of the XSAVE
state area can either be supplied by the caller if known (e.g. from
FreeBSD's PT_GETXSTATEINFO) or it can be queried from the running host
using x86_xsave_length.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/nat/x86-xstate.c [new file with mode: 0644]
gdb/nat/x86-xstate.h [new file with mode: 0644]