[RFC,03/13] gdb: Use NT_X86_CPUID in x86 FreeBSD architectures to read XSAVE layouts

Message ID 20231009183617.24862-4-jhb@FreeBSD.org
State New
Headers
Series Proposal for a new NT_X86_CPUID core dump note |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed

Commit Message

John Baldwin Oct. 9, 2023, 6:36 p.m. UTC
  If this core dump note is present, use it to determine the layout of
XSAVE register set notes.
---
 gdb/i386-fbsd-tdep.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gdb/i386-fbsd-tdep.c b/gdb/i386-fbsd-tdep.c
index f8c2758c2b0..1789f3921fd 100644
--- a/gdb/i386-fbsd-tdep.c
+++ b/gdb/i386-fbsd-tdep.c
@@ -266,7 +266,8 @@  i386_fbsd_core_read_xsave_info (bfd *abfd, x86_xsave_layout &layout)
 
   uint64_t xcr0 = bfd_get_64 (abfd, contents);
 
-  if (!i387_guess_xsave_layout (xcr0, size, layout))
+  if (!i387_read_xsave_layout_from_core (abfd, xcr0, size, layout)
+      && !i387_guess_xsave_layout (xcr0, size, layout))
     return 0;
 
   return xcr0;