diff options
author | John Baldwin <jhb@FreeBSD.org> | 2023-08-28 14:18:19 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2023-08-28 14:18:19 -0700 |
commit | c689d1fe58b2c0faf51e4f574d50271f1d0648e3 (patch) | |
tree | a9d6bb2b8f2485874a9d4ec24b079a21dd11fde8 /gdb/gdbarch-gen.h | |
parent | a388ab0b863a07ddb37d1e98ae8e7443ab85746c (diff) | |
download | gdb-c689d1fe58b2c0faf51e4f574d50271f1d0648e3.zip gdb-c689d1fe58b2c0faf51e4f574d50271f1d0648e3.tar.gz gdb-c689d1fe58b2c0faf51e4f574d50271f1d0648e3.tar.bz2 |
core: Support fetching x86 XSAVE layout from architectures.
Add gdbarch_core_read_x86_xsave_layout to fetch the x86 XSAVE layout
structure from a core file.
Current OS's do not export the offsets of XSAVE state components in
core dumps, so provide an i387_guess_xsave_layout helper function to
set offsets based on known combinations of XCR0 masks and total state
sizes. Eventually when core dumps do contain this information this
function should only be used as a fall back for older core dumps.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/gdbarch-gen.h')
-rw-r--r-- | gdb/gdbarch-gen.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h index 101b1b7..d62eefa 100644 --- a/gdb/gdbarch-gen.h +++ b/gdb/gdbarch-gen.h @@ -1013,6 +1013,15 @@ typedef LONGEST (gdbarch_core_xfer_siginfo_ftype) (struct gdbarch *gdbarch, gdb_ extern LONGEST gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len); extern void set_gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdbarch_core_xfer_siginfo_ftype *core_xfer_siginfo); +/* Read x86 XSAVE layout information from core file into XSAVE_LAYOUT. + Returns true if the layout was read successfully. */ + +extern bool gdbarch_core_read_x86_xsave_layout_p (struct gdbarch *gdbarch); + +typedef bool (gdbarch_core_read_x86_xsave_layout_ftype) (struct gdbarch *gdbarch, x86_xsave_layout &xsave_layout); +extern bool gdbarch_core_read_x86_xsave_layout (struct gdbarch *gdbarch, x86_xsave_layout &xsave_layout); +extern void set_gdbarch_core_read_x86_xsave_layout (struct gdbarch *gdbarch, gdbarch_core_read_x86_xsave_layout_ftype *core_read_x86_xsave_layout); + /* BFD target to use when generating a core file. */ extern bool gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch); |