From 66637e209cc836c19a21a28e91046649c7702037 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 27 Nov 2023 13:53:22 -0800 Subject: i386: Use a fallback XSAVE layout for remote targets If a target provides a target description including registers from the XSAVE extended region, but does not provide an XSAVE layout, use a fallback XSAVE layout based on the included registers. This fallback layout matches GDB's behavior in earlier releases which assumes the layout from Intel CPUs. This fallback layout is currently only used for remote targets since native targets which support XSAVE provide an explicit layout derived from CPUID. PR gdb/30912 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30912 Approved-By: Simon Marchi --- gdb/i387-tdep.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/i387-tdep.h') diff --git a/gdb/i387-tdep.h b/gdb/i387-tdep.h index e149e30..f939fb9 100644 --- a/gdb/i387-tdep.h +++ b/gdb/i387-tdep.h @@ -147,6 +147,11 @@ extern void i387_supply_fxsave (struct regcache *regcache, int regnum, extern bool i387_guess_xsave_layout (uint64_t xcr0, size_t xsave_size, x86_xsave_layout &layout); +/* Compute an XSAVE layout based on the XCR0 bitmask. This is used + as a fallback if a target does not provide an XSAVE layout. */ + +extern x86_xsave_layout i387_fallback_xsave_layout (uint64_t xcr0); + /* Similar to i387_supply_fxsave, but use XSAVE extended state. */ extern void i387_supply_xsave (struct regcache *regcache, int regnum, -- cgit v1.1