]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add PTRACE_VFORK to trace vfork events.
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 18 Jul 2016 14:53:55 +0000 (14:53 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Mon, 18 Jul 2016 14:53:55 +0000 (14:53 +0000)
commitfc4f075a1ace0a14602ee2bd3f0e808ca194260e
treeeace14a1c813d7d3839130b326862ba3ba3a9b25
parentd0cefbdc0d9861d88d0282fba68ed7416a14ac3f
Add PTRACE_VFORK to trace vfork events.

First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when
the new child was created via vfork() rather than fork().  Second, a
new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK
event mask.  This new stop is reported after the vfork parent resumes
due to the child calling exit or exec.  Debuggers can use this stop to
reinsert breakpoints in the vfork parent process before it resumes.

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7045
lib/libc/sys/ptrace.2
sys/kern/kern_fork.c
sys/kern/subr_syscall.c
sys/kern/sys_process.c
sys/sys/proc.h
sys/sys/ptrace.h
tests/sys/kern/ptrace_test.c