This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Honor detach-on-fork on FreeBSD.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bb2a62e694953c099c41d49f59947d3d91cc7c27

commit bb2a62e694953c099c41d49f59947d3d91cc7c27
Author: John Baldwin <jhb@FreeBSD.org>
Date:   Fri Jun 24 18:24:21 2016 -0700

    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.

Diff:
---
 gdb/ChangeLog  | 5 +++++
 gdb/fbsd-nat.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e4f7e3a..b6bf7fa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 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'.
 	(x86bsd_dr_set): Set debug registers on all threads belonging to
 	the current inferior.
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index c9548e9..0999712 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]