aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/ptrace.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2016-07-18 14:53:55 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2016-07-18 14:53:55 +0000
commitfc4f075a1ace0a14602ee2bd3f0e808ca194260e (patch)
treeeace14a1c813d7d3839130b326862ba3ba3a9b25 /sys/sys/ptrace.h
parentd0cefbdc0d9861d88d0282fba68ed7416a14ac3f (diff)
downloadsrc-fc4f075a1ace0a14602ee2bd3f0e808ca194260e.tar.gz
src-fc4f075a1ace0a14602ee2bd3f0e808ca194260e.zip
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
Notes
Notes: svn path=/head/; revision=303001
Diffstat (limited to 'sys/sys/ptrace.h')
-rw-r--r--sys/sys/ptrace.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h
index 0cf25e86a150..e2045c81c8c9 100644
--- a/sys/sys/ptrace.h
+++ b/sys/sys/ptrace.h
@@ -89,6 +89,7 @@
#define PTRACE_SYSCALL (PTRACE_SCE | PTRACE_SCX)
#define PTRACE_FORK 0x0008
#define PTRACE_LWP 0x0010
+#define PTRACE_VFORK 0x0020
#define PTRACE_DEFAULT (PTRACE_EXEC)
@@ -124,6 +125,8 @@ struct ptrace_lwpinfo {
#define PL_FLAG_CHILD 0x80 /* I am from child */
#define PL_FLAG_BORN 0x100 /* new LWP */
#define PL_FLAG_EXITED 0x200 /* exiting LWP */
+#define PL_FLAG_VFORKED 0x400 /* new child via vfork */
+#define PL_FLAG_VFORK_DONE 0x800 /* vfork parent has resumed */
sigset_t pl_sigmask; /* LWP signal mask */
sigset_t pl_siglist; /* LWP pending signal */
struct __siginfo pl_siginfo; /* siginfo for signal */