Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/ptrace.2
.\" $FreeBSD$ | .\" $FreeBSD$ | |||||||||||
.\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ | .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ | |||||||||||
.\" | .\" | |||||||||||
.\" This file is in the public domain. | .\" This file is in the public domain. | |||||||||||
.Dd July 15, 2019 | .Dd August 9, 2019 | |||||||||||
pauamma_gundo.com: Don't forget to adjust the date/expand the ?? before committing. | ||||||||||||
.Dt PTRACE 2 | .Dt PTRACE 2 | |||||||||||
.Os | .Os | |||||||||||
.Sh NAME | .Sh NAME | |||||||||||
.Nm ptrace | .Nm ptrace | |||||||||||
.Nd process tracing and debugging | .Nd process tracing and debugging | |||||||||||
.Sh LIBRARY | .Sh LIBRARY | |||||||||||
.Lb libc | .Lb libc | |||||||||||
.Sh SYNOPSIS | .Sh SYNOPSIS | |||||||||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | ||||||||||||
.Pq Dv PL_FLAG_SCX . | .Pq Dv PL_FLAG_SCX . | |||||||||||
The signal stop for a new child process enabled via | The signal stop for a new child process enabled via | |||||||||||
.Dv PTRACE_FORK | .Dv PTRACE_FORK | |||||||||||
will report a | will report a | |||||||||||
.Dv SIGSTOP | .Dv SIGSTOP | |||||||||||
signal. | signal. | |||||||||||
All other additional signal stops use | All other additional signal stops use | |||||||||||
.Dv SIGTRAP . | .Dv SIGTRAP . | |||||||||||
.Pp | .Pp | |||||||||||
Each traced process has a tracing event mask. | Each traced process has a tracing event mask. | |||||||||||
Not Done Inline Actions
Or "the state of another process" pauamma_gundo.com: Or "the state of another process" | ||||||||||||
Not Done Inline Actions
pauamma_gundo.com: | ||||||||||||
Not Done Inline Actions
pauamma_gundo.com: | ||||||||||||
Not Done Inline Actions
pauamma_gundo.com: | ||||||||||||
An event in the traced process only reports a | An event in the traced process only reports a | |||||||||||
signal stop if the corresponding flag is set in the tracing event mask. | signal stop if the corresponding flag is set in the tracing event mask. | |||||||||||
The current set of tracing event flags include: | The current set of tracing event flags include: | |||||||||||
.Bl -tag -width "Dv PTRACE_SYSCALL" | .Bl -tag -width "Dv PTRACE_SYSCALL" | |||||||||||
.It Dv PTRACE_EXEC | .It Dv PTRACE_EXEC | |||||||||||
Report a stop for a successful invocation of | Report a stop for a successful invocation of | |||||||||||
.Xr execve 2 . | .Xr execve 2 . | |||||||||||
This event is indicated by the | This event is indicated by the | |||||||||||
▲ Show 20 Lines • Show All 320 Lines • ▼ Show 20 Lines | ||||||||||||
it loads the traced process's debug registers from the | it loads the traced process's debug registers from the | |||||||||||
.Do | .Do | |||||||||||
.Vt "struct dbreg" | .Vt "struct dbreg" | |||||||||||
.Dc | .Dc | |||||||||||
(defined in | (defined in | |||||||||||
.In machine/reg.h ) | .In machine/reg.h ) | |||||||||||
pointed to by | pointed to by | |||||||||||
.Fa addr . | .Fa addr . | |||||||||||
.It Dv PT_GETREGSET | ||||||||||||
This request reads the traced process's machine registers. | ||||||||||||
The | ||||||||||||
.Fa data | ||||||||||||
argument specifies the register set to read, with the | ||||||||||||
.Fa addr | ||||||||||||
argument pointing at a | ||||||||||||
.Vt "struct iovec" | ||||||||||||
that points to a register set specific structure to hold the registers. | ||||||||||||
.It Dv PT_SETREGSET | ||||||||||||
This request writes to the traced process's machine registers. | ||||||||||||
The | ||||||||||||
.Fa data | ||||||||||||
argument specifies the register set to write to, with the | ||||||||||||
.Fa addr | ||||||||||||
argument pointing at a | ||||||||||||
Not Done Inline Actions
Since you're touching this page. ("... to the traced process' machine registers" also works.) pauamma_gundo.com: Since you're touching this page. ("... to the traced process' machine registers" also works.) | ||||||||||||
.Vt "struct iovec" | ||||||||||||
that points to a request specific structure that holds the new registers. | ||||||||||||
Not Done Inline ActionsYou did not explained the length handling kib: You did not explained the length handling | ||||||||||||
.It Dv PT_LWPINFO | .It Dv PT_LWPINFO | |||||||||||
This request can be used to obtain information about the kernel thread, | This request can be used to obtain information about the kernel thread, | |||||||||||
also known as light-weight process, that caused the traced process to stop. | also known as light-weight process, that caused the traced process to stop. | |||||||||||
The | The | |||||||||||
.Fa addr | .Fa addr | |||||||||||
argument specifies a pointer to a | argument specifies a pointer to a | |||||||||||
.Vt "struct ptrace_lwpinfo" , | .Vt "struct ptrace_lwpinfo" , | |||||||||||
which is defined as follows: | which is defined as follows: | |||||||||||
▲ Show 20 Lines • Show All 726 Lines • Show Last 20 Lines |
Don't forget to adjust the date/expand the ?? before committing.