From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.baldwin.cx (bigwig.baldwin.cx [66.216.25.90]) by sourceware.org (Postfix) with ESMTPS id 9634A385842D for ; Tue, 1 Mar 2022 00:24:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9634A385842D 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 E40EF1A84E65 for ; Mon, 28 Feb 2022 19:24:33 -0500 (EST) From: John Baldwin To: gdb-patches@sourceware.org Subject: [RFC PATCH 10/12] fbsd-nat: Add a low_delete_thread virtual method. Date: Mon, 28 Feb 2022 16:24:17 -0800 Message-Id: <20220301002419.5122-11-jhb@FreeBSD.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220301002419.5122-1-jhb@FreeBSD.org> References: <20220301002419.5122-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]); Mon, 28 Feb 2022 19:24:34 -0500 (EST) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-12.4 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: Tue, 01 Mar 2022 00:24:36 -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