Fake VFORK_DONE events when following only the parent after a vfork.
authorJohn Baldwin <jhb@FreeBSD.org>
Sat, 25 Jun 2016 04:00:04 +0000 (21:00 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 1 Jul 2016 15:35:33 +0000 (08:35 -0700)
commit2c5c2a3321706c28cbf1b85a970a2e32912eb0c8
tree8bf821a89de943c5fb9718649ce00efbfcc6b5be
parent8607ea632c806235554aa2336cf01bf3758c1264
Fake VFORK_DONE events when following only the parent after a vfork.

FreeBSD does not currently report a ptrace event for a parent process
after it resumes due to the child exiting the shared memory region after
a vfork.  Take the same approach used in linux-nat.c in this case of
sleeping for a while and then reporting a fake VFORK_DONE event.

gdb/ChangeLog:

* fbsd-nat.c (struct fbsd_fork_child_info): Rename to ...
(struct fbsd_fork_info): ... this.
(struct fbsd_fork_info) <child>: Rename to ...
(struct fbsd_fork_info) <ptid>: ... this.
(fbsd_pending_children): Update type.
(fbsd_remember_child): Update type and field name.
(fbsd_is_child_pending): Likewise.
(fbsd_pending_vfork_done): New variable.
(fbsd_is_vfork_done_pending): New function.
(fbsd_next_vfork_done): New function.
(fbsd_resume): Don't resume processes with a pending vfork done
event.
(fbsd_wait): Report pending vfork done events.
(fbsd_follow_fork): Delay and record a pending vfork done event
for a vfork parent when detaching the child.
gdb/ChangeLog
gdb/fbsd-nat.c