From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1936) id E90E0386EC13; Tue, 22 Mar 2022 22:53:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E90E0386EC13 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: John Baldwin To: gdb-cvs@sourceware.org Subject: [binutils-gdb] fbsd-nat: Add a low_new_fork virtual method. X-Act-Checkin: binutils-gdb X-Git-Author: John Baldwin X-Git-Refname: refs/heads/master X-Git-Oldrev: a49ce729c808b5762faf948a34e6159a6d8874de X-Git-Newrev: c77282d8ba91cf25cf2f08b76702c447e2e74575 Message-Id: <20220322225330.E90E0386EC13@sourceware.org> Date: Tue, 22 Mar 2022 22:53:30 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2022 22:53:31 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dc77282d8ba91= cf25cf2f08b76702c447e2e74575 commit c77282d8ba91cf25cf2f08b76702c447e2e74575 Author: John Baldwin Date: Tue Mar 22 12:05:43 2022 -0700 fbsd-nat: Add a low_new_fork virtual method. =20 This method can be overridden by architecture-specific targets to perform additional work when a new child process is forked. Diff: --- 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_w= aitstatus *ourstatus, warning (_("Failed to fetch process information")); #endif =20 + 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 @@ public: =20 bool supports_disable_randomization () override; =20 + /* Methods meant to be overridden by arch-specific target + classes. */ + + virtual void low_new_fork (ptid_t parent, pid_t child) + {} + protected: =20 void post_startup_inferior (ptid_t) override;