From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2607:f138:0:13::2]) by sourceware.org (Postfix) with ESMTPS id 8F3963952007 for ; Wed, 16 Mar 2022 20:19:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8F3963952007 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=FreeBSD.org Received: from ralph.com (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 077C21A84E39 for ; Wed, 16 Mar 2022 16:19:46 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH v2 05/12] fbsd-nat: Add a low_new_fork virtual method. Date: Wed, 16 Mar 2022 13:19:16 -0700 Message-Id: <20220316201923.89694-6-jhb@FreeBSD.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316201923.89694-1-jhb@FreeBSD.org> References: <20220316201923.89694-1-jhb@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (mail.baldwin.cx [0.0.0.0]); Wed, 16 Mar 2022 16:19:47 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2022 20:19:48 -0000 This method can be overridden by architecture-specific targets to perform additional work when a new child process is forked. --- gdb/fbsd-nat.c | 2 ++ gdb/fbsd-nat.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index ba84265dd58..6d76c8234d5 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -1380,6 +1380,8 @@ fbsd_nat_target::wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus, warning (_("Failed to fetch process information")); #endif + low_new_fork (wptid, child); + if (is_vfork) ourstatus->set_vforked (child_ptid); else diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h index 2d9c6e19a2c..2f17be5a8f0 100644 --- a/gdb/fbsd-nat.h +++ b/gdb/fbsd-nat.h @@ -109,6 +109,12 @@ class fbsd_nat_target : public inf_ptrace_target bool supports_disable_randomization () override; + /* Methods meant to be overridden by arch-specific target + classes. */ + + virtual void low_new_fork (ptid_t parent, pid_t child) + {} + protected: void post_startup_inferior (ptid_t) override; -- 2.34.1