summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/sys/ptrace.221
-rw-r--r--share/man/man5/procfs.57
-rw-r--r--sys/amd64/include/reg.h3
-rw-r--r--sys/i386/include/reg.h3
4 files changed, 33 insertions, 1 deletions
diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2
index 37eca05..551f41d 100644
--- a/lib/libc/sys/ptrace.2
+++ b/lib/libc/sys/ptrace.2
@@ -202,6 +202,23 @@ it loads the traced process' floating-point registers from the
.Aq Pa machine/reg.h )
pointed to by
.Fa addr .
+.It Dv PT_GETDBREGS
+This request reads the traced process' debug registers into
+the
+.Dq Li "struct dbreg"
+(defined in
+.Aq Pa machine/reg.h )
+pointed to by
+.Fa addr .
+.It Dv PT_SETDBREGS
+This request is the converse of
+.Dv PT_GETDBREGS ;
+it loads the traced process' debug registers from the
+.Dq Li "struct dbreg"
+(defined in
+.Aq Pa machine/reg.h )
+pointed to by
+.Fa addr .
.El
.Sh RETURN VALUES
Some requests can cause
@@ -250,8 +267,10 @@ was neither 0 nor a legal signal number.
.Dv PT_GETREGS ,
.Dv PT_SETREGS ,
.Dv PT_GETFPREGS ,
+.Dv PT_SETFPREGS ,
+.Dv PT_GETDBREGS ,
or
-.Dv PT_SETFPREGS
+.Dv PT_SETDBREGS
was attempted on a process with no valid register set. (This is
normally true only of system processes.)
.El
diff --git a/share/man/man5/procfs.5 b/share/man/man5/procfs.5
index 5f9a634..af637a0 100644
--- a/share/man/man5/procfs.5
+++ b/share/man/man5/procfs.5
@@ -74,6 +74,13 @@ prefix,
in which case that signal is delivered to the process
(see
.Xr sigaction 2 ).
+.It Pa dbregs
+The debug registers as defined by
+.Dv "struct dbregs"
+in
+.Pa <machine/reg.h> .
+.Pa dbregs
+is currently only implemented on the i386 architecture.
.It Pa etype
The type of the executable referenced by the
.Pa file
diff --git a/sys/amd64/include/reg.h b/sys/amd64/include/reg.h
index 7b5b69a..6effd1a 100644
--- a/sys/amd64/include/reg.h
+++ b/sys/amd64/include/reg.h
@@ -118,6 +118,9 @@ struct fpreg {
unsigned char fpr_pad[64];
};
+/*
+ * Register set accessible via /proc/$pid/dbregs.
+ */
struct dbreg {
unsigned int dr0; /* debug address register 0 */
unsigned int dr1; /* debug address register 1 */
diff --git a/sys/i386/include/reg.h b/sys/i386/include/reg.h
index 7b5b69a..6effd1a 100644
--- a/sys/i386/include/reg.h
+++ b/sys/i386/include/reg.h
@@ -118,6 +118,9 @@ struct fpreg {
unsigned char fpr_pad[64];
};
+/*
+ * Register set accessible via /proc/$pid/dbregs.
+ */
struct dbreg {
unsigned int dr0; /* debug address register 0 */
unsigned int dr1; /* debug address register 1 */
OpenPOWER on IntegriCloud