From 042df45adeb2832bac5a07767f0394aa5343c1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sat, 16 Mar 2002 03:50:32 +0000 Subject: [PATCH] Document PT_IO, and move the comment about machine-dependent requests below PT_[GS]ET_{,DB,FP}REGS. --- lib/libc/sys/ptrace.2 | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index d885b7c9ffa9..66f0b2fdf711 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -102,6 +102,37 @@ except that they write rather than read. The .Fa data argument supplies the value to be written. +.It Dv PT_IO +This request allows reading and writing arbitrary amounts of data in +the traced process's address space. +The +.Fa addr +argument specifies a pointer to a +.Vt struct ptrace_io_desc , +which is defined as follows: +.Bd -literal +struct ptrace_io_desc { + int piod_op; /* I/O operation */ + void *piod_offs; /* child offset */ + void *piod_addr; /* parent offset */ + size_t piod_len; /* request length */ +}; + +/* + * Operations in piod_op. + */ +#define PIOD_READ_D 1 /* Read from D space */ +#define PIOD_WRITE_D 2 /* Write to D space */ +#define PIOD_READ_I 3 /* Read from I space */ +#define PIOD_WRITE_I 4 /* Write to I space */ +.Ed +.Pp +The +.Fa data +argument is ignored. +The actual number of bytes read or written is stored in +.Va piod_len +upon return. .It Dv PT_CONTINUE The traced process continues execution. .Fa addr @@ -146,11 +177,6 @@ This request is like PT_CONTINUE, except that it does not allow specifying an alternate place to continue execution, and after it succeeds, the traced process is no longer traced and continues execution normally. -.El -.Pp -Additionally, machine-specific requests can exist. -On the i386, these are: -.Bl -tag -width 12n .It Dv PT_GETREGS This request reads the traced process's machine registers into the .Do @@ -214,6 +240,8 @@ it loads the traced process's debug registers from the pointed to by .Fa addr . .El +.Pp +Additionally, machine-specific requests can exist. .Sh RETURN VALUES Some requests can cause .Fn ptrace