This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/3] Honor detach-on-fork on FreeBSD.
- From: John Baldwin <jhb at FreeBSD dot org>
- To: gdb-patches at sourceware dot org
- Date: Tue, 28 Jun 2016 16:00:09 -0700
- Subject: [PATCH 1/3] Honor detach-on-fork on FreeBSD.
- Authentication-results: sourceware.org; auth=none
- References: <20160628230011 dot 80849-1-jhb at FreeBSD dot org>
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.x
---
gdb/ChangeLog | 5 +++++
gdb/fbsd-nat.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 22234be..1c90732 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2016-06-24 John Baldwin <jhb@FreeBSD.org>
+ * fbsd-nat.c (fbsd_follow_fork): Only detach child if
+ "detach_fork" is true.
+
+2016-06-24 John Baldwin <jhb@FreeBSD.org>
+
* fbsd-tdep.c: Include "auxv.h".
(fbsd_print_auxv_entry): New function.
(fbsd_init_abi): Install gdbarch "print_auxv_entry" method.
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index dc65e29..0f375f5 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -792,7 +792,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);
--
2.8.4