summaryrefslogtreecommitdiffstats
path: root/sys/x86
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-08-05 08:17:10 +0000
committerkib <kib@FreeBSD.org>2015-08-05 08:17:10 +0000
commit83f30eda371b1192a70eeaba6f278f01b67cdb76 (patch)
treef70aca8415c813f994a4316cf700171adaff2fc5 /sys/x86
parent13079235af5f6cf8c395e19bedfee5481353abe5 (diff)
downloadFreeBSD-src-83f30eda371b1192a70eeaba6f278f01b67cdb76.zip
FreeBSD-src-83f30eda371b1192a70eeaba6f278f01b67cdb76.tar.gz
Implement x86 ptrace(2) requests PT_{GET,SET}{FS,GS}BASE.
MFC r284918: Add helper fill_based_sd(9). MFC r284919: Add x86 PT_GETFSBASE, PT_GETGSBASE machine-depended ptrace requests to obtain the thread %fs and %gs bases. Add x86 PT_SETFSBASE and PT_SETGSBASE requests to set the bases from debuggers. The set requests, similarly to the sysarch({I386,AMD64}_SET_FSBASE), override the corresponding segment registers. MFC r284965: Document x86 machine-specific ptrace(2) requests. MFC r285011: Disallow a debugger on 64bit system to set fs/gs bases of the 32bit process beyond the end of the process address space. MFC r285104: Grammar and language fixes.
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/include/ptrace.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/x86/include/ptrace.h b/sys/x86/include/ptrace.h
index 16f9c62..40c7663 100644
--- a/sys/x86/include/ptrace.h
+++ b/sys/x86/include/ptrace.h
@@ -51,6 +51,10 @@
#define PT_GETXSTATE_INFO (PT_FIRSTMACH + 4)
#define PT_GETXSTATE (PT_FIRSTMACH + 5)
#define PT_SETXSTATE (PT_FIRSTMACH + 6)
+#define PT_GETFSBASE (PT_FIRSTMACH + 7)
+#define PT_SETFSBASE (PT_FIRSTMACH + 8)
+#define PT_GETGSBASE (PT_FIRSTMACH + 9)
+#define PT_SETGSBASE (PT_FIRSTMACH + 10)
/* Argument structure for PT_GETXSTATE_INFO. */
struct ptrace_xstate_info {
OpenPOWER on IntegriCloud