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 BC23F394FC33 for ; Wed, 16 Mar 2022 20:19:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC23F394FC33 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 1BDA41A84E39 for ; Wed, 16 Mar 2022 16:19:50 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH v2 10/12] fbsd-nat: Add a low_delete_thread virtual method. Date: Wed, 16 Mar 2022 13:19:21 -0700 Message-Id: <20220316201923.89694-11-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:50 -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:51 -0000 This method can be overridden by architecture-specific targets to perform additional work when a thread is deleted. Note that this method is only invoked on systems supporting LWP events, but the pending use case (aarch64 debug registers) is not supported on older kernels that do not support LWP events. --- gdb/fbsd-nat.c | 1 + gdb/fbsd-nat.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index 51234eaa6c9..2bc7937a38b 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -1293,6 +1293,7 @@ fbsd_nat_target::wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus, if (print_thread_events) printf_unfiltered (_("[%s exited]\n"), target_pid_to_str (wptid).c_str ()); + low_delete_thread (thr); delete_thread (thr); } if (ptrace (PT_CONTINUE, pid, (caddr_t) 1, 0) == -1) diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h index d7c8eb81e96..6028aebfccc 100644 --- a/gdb/fbsd-nat.h +++ b/gdb/fbsd-nat.h @@ -115,6 +115,10 @@ class fbsd_nat_target : public inf_ptrace_target virtual void low_new_fork (ptid_t parent, pid_t child) {} + /* The method to call, if any, when a thread is destroyed. */ + virtual void low_delete_thread (thread_info *) + {} + protected: void post_startup_inferior (ptid_t) override; -- 2.34.1