Honor detach-on-fork on FreeBSD.

Only detach from the new child process in the follow fork callback
if detach_fork is true.

gdb/ChangeLog:

	* fbsd-nat.c (fbsd_follow_fork): Only detach child if
	"detach_fork" is true.
This commit is contained in:
John Baldwin 2016-06-24 18:24:21 -07:00
parent 5e866f5aee
commit bb2a62e694
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2016-07-01 John Baldwin <jhb@FreeBSD.org>
* fbsd-nat.c (fbsd_follow_fork): Only detach child if
"detach_fork" is true.
2016-07-01 John Baldwin <jhb@FreeBSD.org>
* x86bsd-nat.c: Include 'gdbthread.h'.

View File

@ -826,7 +826,7 @@ static int
fbsd_follow_fork (struct target_ops *ops, int follow_child,
int detach_fork)
{
if (!follow_child)
if (!follow_child && detach_fork)
{
struct thread_info *tp = inferior_thread ();
pid_t child_pid = ptid_get_pid (tp->pending_follow.value.related_pid);