diff options
author | John Baldwin <jhb@FreeBSD.org> | 2014-11-21 20:53:17 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2014-11-21 20:53:17 +0000 |
commit | 180e57e5c7b6bd5a0fd0bc523c4dcd7cff363fd6 (patch) | |
tree | 99aebdaca5d14d076e3c8d62e9c14bad62a4c56c /contrib | |
parent | 1e7bf26b33f52bf151947f85383d7042bf7e1e3c (diff) | |
download | src-180e57e5c7b6bd5a0fd0bc523c4dcd7cff363fd6.tar.gz src-180e57e5c7b6bd5a0fd0bc523c4dcd7cff363fd6.zip |
Improve support for XSAVE with debuggers.
- Dump an NT_X86_XSTATE note if XSAVE is in use. This note is designed
to match what Linux does in that 1) it dumps the entire XSAVE area
including the fxsave state, and 2) it stashes a copy of the current
xsave mask in the unused padding between the fxsave state and the
xstate header at the same location used by Linux.
- Teach readelf() to recognize NT_X86_XSTATE notes.
- Change PT_GET/SETXSTATE to take the entire XSAVE state instead of
only the extra portion. This avoids having to always make two
ptrace() calls to get or set the full XSAVE state.
- Add a PT_GET_XSTATE_INFO which returns the length of the current
XSTATE save area (so the size of the buffer needed for PT_GETXSTATE)
and the current XSAVE mask (%xcr0).
Differential Revision: https://reviews.freebsd.org/D1193
Reviewed by: kib
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=274817
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/binutils/binutils/readelf.c | 2 | ||||
-rw-r--r-- | contrib/binutils/include/elf/common.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/contrib/binutils/binutils/readelf.c b/contrib/binutils/binutils/readelf.c index aafd8d4502e9..09f4062a4d9f 100644 --- a/contrib/binutils/binutils/readelf.c +++ b/contrib/binutils/binutils/readelf.c @@ -9159,6 +9159,8 @@ get_freebsd_note_type (unsigned e_type) return _("NT_PROCSTAT_PSSTRINGS (ps_strings data)"); case NT_PROCSTAT_AUXV: return _("NT_PROCSTAT_AUXV (auxv data)"); + case NT_X86_XSTATE: + return _("NT_X86_XSTATE (x86 XSAVE extended state)"); default: return get_note_type(e_type); } diff --git a/contrib/binutils/include/elf/common.h b/contrib/binutils/include/elf/common.h index d4d9d7b0cc7a..157922af3f0b 100644 --- a/contrib/binutils/include/elf/common.h +++ b/contrib/binutils/include/elf/common.h @@ -414,6 +414,7 @@ #define NT_PROCSTAT_OSREL 14 #define NT_PROCSTAT_PSSTRINGS 15 #define NT_PROCSTAT_AUXV 16 +#define NT_X86_XSTATE 0x202 /* Note segments for core files on NetBSD systems. Note name |