From patchwork Mon Jul 18 14:57:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 13846 Received: (qmail 29521 invoked by alias); 18 Jul 2016 14:58:54 -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 29409 invoked by uid 89); 18 Jul 2016 14:58:53 -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-languages-length:1336, fork 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; Mon, 18 Jul 2016 14:58:43 +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 E3063B9A5 for ; Mon, 18 Jul 2016 10:58:40 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH 2/3] Enable ptrace events on new child processes. Date: Mon, 18 Jul 2016 07:57:58 -0700 Message-Id: <20160718145759.58543-3-jhb@FreeBSD.org> In-Reply-To: <20160718145759.58543-1-jhb@FreeBSD.org> References: <20160718145759.58543-1-jhb@FreeBSD.org> X-IsSubscribed: yes New child processes on FreeBSD do not inherit optional ptrace events such as fork and LWP events from the parent process. Instead, explicitly enable events on new children when reporting a fork event. gdb/ChangeLog: * fbsd-nat.c (fbsd_wait): Use "fbsd_enable_proc_events" on new child processes. --- gdb/ChangeLog | 5 +++++ gdb/fbsd-nat.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dcedc14..33cd6a7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2016-07-15 John Baldwin + * fbsd-nat.c (fbsd_wait): Use "fbsd_enable_proc_events" on + new child processes. + +2016-07-15 John Baldwin + * fbsd-nat.c (fbsd_enable_lwp_events): Remove function. (fbsd_enable_proc_events): New function. (fbsd_enable_follow_fork): Remove function. diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index 508ab19..5e4304e 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -836,6 +836,9 @@ fbsd_wait (struct target_ops *ops, child_ptid = ptid_build (child, pl.pl_lwpid, 0); } + /* Enable additional events on the child process. */ + fbsd_enable_proc_events (ptid_get_pid (child_ptid)); + /* For vfork, the child process will have the P_PPWAIT flag set. */ fbsd_fetch_kinfo_proc (child, &kp);