From patchwork Tue Jun 28 23:00:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 13458 Received: (qmail 100703 invoked by alias); 28 Jun 2016 23:00:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 100590 invoked by uid 89); 28 Jun 2016 23:00:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=HX-Greylist:EDT, HX-Greylist:0400 X-HELO: bigwig.baldwin.cx Received: from bigwig.baldwin.cx (HELO bigwig.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 28 Jun 2016 23:00:33 +0000 Received: from ralph.com (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 46EB5B953 for ; Tue, 28 Jun 2016 19:00:31 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH 1/3] Honor detach-on-fork on FreeBSD. Date: Tue, 28 Jun 2016 16:00:09 -0700 Message-Id: <20160628230011.80849-2-jhb@FreeBSD.org> In-Reply-To: <20160628230011.80849-1-jhb@FreeBSD.org> References: <20160628230011.80849-1-jhb@FreeBSD.org> X-IsSubscribed: yes 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 + * fbsd-nat.c (fbsd_follow_fork): Only detach child if + "detach_fork" is true. + +2016-06-24 John Baldwin + * 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);