Honor detach-on-fork on FreeBSD.
authorJohn Baldwin <jhb@FreeBSD.org>
Sat, 25 Jun 2016 01:24:21 +0000 (18:24 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 1 Jul 2016 15:32:38 +0000 (08:32 -0700)
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.

gdb/ChangeLog
gdb/fbsd-nat.c

index e4f7e3ae52081abd4f3b1f683eb0d7e3e3c7c791..b6bf7fa592dd87307951691833217a910df8018c 100644 (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'.
index c9548e9a4bb0610b1e878b9827e60e087c9f558b..099971282ee8e965c3ab0ada7eee41d0ac972202 100644 (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);