Module Name: src Committed By: kamil Date: Sat Jan 7 03:41:25 UTC 2017
Modified Files: src/lib/libc/sys: ptrace.2 Log Message: Document PT_SET_SIGINFO and PT_GET_SIGINFO in ptrace(2) PT_SET_SIGINFO - fake signal information emitted to tracee PT_GET_SIGINFO - read signal information routed to tracee Sponsored by <The NetBSD Foundation> To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/lib/libc/sys/ptrace.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/sys/ptrace.2 diff -u src/lib/libc/sys/ptrace.2:1.48 src/lib/libc/sys/ptrace.2:1.49 --- src/lib/libc/sys/ptrace.2:1.48 Sat Jan 7 01:32:35 2017 +++ src/lib/libc/sys/ptrace.2 Sat Jan 7 03:41:25 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: ptrace.2,v 1.48 2017/01/07 01:32:35 kamil Exp $ +.\" $NetBSD: ptrace.2,v 1.49 2017/01/07 03:41:25 kamil Exp $ .\" .\" This file is in the public domain. .Dd January 7, 2016 @@ -329,6 +329,57 @@ The .Fa data argument should be set to .Li sizeof(struct ptrace_state) . +.It Dv PT_SET_SIGINFO +This request can be used to specify signal information emitted to tracee. +This signal information is specified in +.Dq Li "struct ptrace_siginfo" +defined as: +.Bd -literal -offset indentq +typedef struct ptrace_siginfo { + siginfo_t psi_siginfo; + lwpid_t psi_lwpid; +} ptrace_siginfo_t; +.Ed +.Pp +Where +.Fa psi_siginfo +is the set to signal information structure. +The +.Fa psi_lwpid +field describes LWP address of the signal. +Value +.Dv 0 +means the whole process +(route signal to all LWPs). +.Pp +A pointer to this structure is passed in +.Fa addr . +The +.Fa data +argument should be set to +.Li sizeof(struct ptrace_siginfo) . +.Pp +In order to pass faked signal to the tracee, +the siginal type must match the signal passed to process with +.Dv PT_CONTINUE , +.Dv PT_DETACH +or +.Dv PT_STEP . +.It Dv PT_GET_SIGINFO +This request can be used to determine signal information that was received by +a debugger +.Po +see +.Xr siginfo 2 +.Pc . +The information is read into the +.Dq Li struct ptrace_siginfo +pointed to by +.Fa addr . +The +.Fa data +argument should be set to +.Li sizeof(struct ptrace_siginfo) . .El .Pp Additionally, the following requests exist but are