summaryrefslogtreecommitdiffstats
path: root/contrib/binutils
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-11-21 20:53:17 +0000
committerjhb <jhb@FreeBSD.org>2014-11-21 20:53:17 +0000
commit1671ac9155f60e765c16e485d93ae02fe40656e3 (patch)
tree99aebdaca5d14d076e3c8d62e9c14bad62a4c56c /contrib/binutils
parentb532057d45360838a1a3c71ee77b32fec6d971ba (diff)
downloadFreeBSD-src-1671ac9155f60e765c16e485d93ae02fe40656e3.zip
FreeBSD-src-1671ac9155f60e765c16e485d93ae02fe40656e3.tar.gz
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
Diffstat (limited to 'contrib/binutils')
-rw-r--r--contrib/binutils/binutils/readelf.c2
-rw-r--r--contrib/binutils/include/elf/common.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/contrib/binutils/binutils/readelf.c b/contrib/binutils/binutils/readelf.c
index aafd8d4..09f4062 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 d4d9d7b..157922a 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
OpenPOWER on IntegriCloud