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 May 20, 2021 | .Dd Sep ??, 2021 | |||||||||||
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 102 Lines • ▼ Show 20 Lines | ||||||||||||
are terminated. | are terminated. | |||||||||||
If set to zero, kernel implicitly detaches traced processes. | If set to zero, kernel implicitly detaches traced processes. | |||||||||||
Traced processes are un-stopped if needed, and then continue the execution | Traced processes are un-stopped if needed, and then continue the execution | |||||||||||
without tracing. | without tracing. | |||||||||||
Kernel drops any | Kernel drops any | |||||||||||
.Dv SIGTRAP | .Dv SIGTRAP | |||||||||||
signals queued to the traced children, which could be either generated by | signals queued to the traced children, which could be either generated by | |||||||||||
not yet consumed debug events, or sent by other means, the later should | not yet consumed debug events, or sent by other means, the later should | |||||||||||
not be done anyway. | not be done anyway. | |||||||||||
.Sh TRACING EVENTS | .Sh TRACING EVENTS | |||||||||||
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: | ||||||||||||
.Pp | .Pp | |||||||||||
Each traced process has a tracing event mask. | Each traced process has a tracing event mask. | |||||||||||
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 | |||||||||||
▲ Show 20 Lines • Show All 323 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. | ||||||||||||
kibUnsubmitted 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 799 Lines • Show Last 20 Lines |
Don't forget to adjust the date/expand the ?? before committing.