Page MenuHomeFreeBSD

Add PTRACE_VFORK to trace vfork events.
ClosedPublic

Authored by jhb on Jul 1 2016, 1:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 12:31 AM
Unknown Object (File)
Dec 11 2023, 8:55 PM
Unknown Object (File)
Nov 23 2023, 3:11 AM
Unknown Object (File)
Nov 9 2023, 1:31 PM
Unknown Object (File)
Nov 8 2023, 9:25 AM
Unknown Object (File)
Nov 3 2023, 7:06 AM
Unknown Object (File)
Nov 2 2023, 5:58 AM
Unknown Object (File)
Oct 22 2023, 2:09 AM
Subscribers

Details

Summary

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.

Test Plan
  • Run new tests.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb retitled this revision from to Add PTRACE_VFORK to trace vfork events..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: kib.
  • Rebase after ptrace events were committed upstream.
  • Add PTRACE_VFORK to the list of valid event flags.
  • Document PTRACE_VFORK.

The changes to let gdb use this (along with some other fixes) are here:

https://github.com/bsdjhb/gdb/compare/vfork_done2

I will post those patches to gdb-patches@ once PTRACE_VFORK lands in HEAD.

kib edited edge metadata.
This revision is now accepted and ready to land.Jul 16 2016, 11:44 PM
This revision was automatically updated to reflect the committed changes.