From: Markus Metzger <markus.t.metzger@intel.com>
To: gdb-patches@sourceware.org
Subject: [PATCH v1 6/7] gdb, btrace: remove the teardown_btrace() target method
Date: Tue, 10 Nov 2026 07:43:15 +0100 [thread overview]
Message-ID: <20261110064317.405487-7-markus.t.metzger@intel.com> (raw)
In-Reply-To: <20261110064317.405487-1-markus.t.metzger@intel.com>
The teardown_btrace() target method is no longer used. Remove it.
---
gdb/remote.c | 11 -----------
gdb/target-delegates-gen.c | 24 ------------------------
gdb/target.c | 8 --------
gdb/target.h | 10 ----------
gdb/x86-linux-nat.c | 9 ---------
gdb/x86-linux-nat.h | 1 -
6 files changed, 63 deletions(-)
diff --git a/gdb/remote.c b/gdb/remote.c
index a728d57df6e..38e0802a68a 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1228,8 +1228,6 @@ class remote_target : public process_stratum_target
void disable_btrace (struct btrace_target_info *tinfo) override;
- void teardown_btrace (struct btrace_target_info *tinfo) override;
-
enum btrace_error read_btrace (struct btrace_data *data,
struct btrace_target_info *btinfo,
enum btrace_read_type type) override;
@@ -15708,15 +15706,6 @@ remote_target::disable_btrace (struct btrace_target_info *tinfo)
delete tinfo;
}
-/* Teardown branch tracing. */
-
-void
-remote_target::teardown_btrace (struct btrace_target_info *tinfo)
-{
- /* We must not talk to the target during teardown. */
- delete tinfo;
-}
-
/* Read the branch trace. */
enum btrace_error
diff --git a/gdb/target-delegates-gen.c b/gdb/target-delegates-gen.c
index b39fd7cb33a..2ef0ae503ef 100644
--- a/gdb/target-delegates-gen.c
+++ b/gdb/target-delegates-gen.c
@@ -168,7 +168,6 @@ struct dummy_target : public target_ops
bool can_use_agent () override;
struct btrace_target_info *enable_btrace (thread_info *arg0, const struct btrace_config *arg1) override;
void disable_btrace (struct btrace_target_info *arg0) override;
- void teardown_btrace (struct btrace_target_info *arg0) override;
enum btrace_error read_btrace (struct btrace_data *arg0, struct btrace_target_info *arg1, enum btrace_read_type arg2) override;
const struct btrace_config *btrace_conf (const struct btrace_target_info *arg0) override;
enum record_method record_method (ptid_t arg0) override;
@@ -349,7 +348,6 @@ struct debug_target : public target_ops
bool can_use_agent () override;
struct btrace_target_info *enable_btrace (thread_info *arg0, const struct btrace_config *arg1) override;
void disable_btrace (struct btrace_target_info *arg0) override;
- void teardown_btrace (struct btrace_target_info *arg0) override;
enum btrace_error read_btrace (struct btrace_data *arg0, struct btrace_target_info *arg1, enum btrace_read_type arg2) override;
const struct btrace_config *btrace_conf (const struct btrace_target_info *arg0) override;
enum record_method record_method (ptid_t arg0) override;
@@ -3693,28 +3691,6 @@ debug_target::disable_btrace (struct btrace_target_info *arg0)
target_debug_print_btrace_target_info_p (arg0).c_str ());
}
-void
-target_ops::teardown_btrace (struct btrace_target_info *arg0)
-{
- this->beneath ()->teardown_btrace (arg0);
-}
-
-void
-dummy_target::teardown_btrace (struct btrace_target_info *arg0)
-{
- tcomplain ();
-}
-
-void
-debug_target::teardown_btrace (struct btrace_target_info *arg0)
-{
- target_debug_printf_nofunc ("-> %s->teardown_btrace (...)", this->beneath ()->shortname ());
- this->beneath ()->teardown_btrace (arg0);
- target_debug_printf_nofunc ("<- %s->teardown_btrace (%s)",
- this->beneath ()->shortname (),
- target_debug_print_btrace_target_info_p (arg0).c_str ());
-}
-
enum btrace_error
target_ops::read_btrace (struct btrace_data *arg0, struct btrace_target_info *arg1, enum btrace_read_type arg2)
{
diff --git a/gdb/target.c b/gdb/target.c
index 56a5f78c4c0..10f24d954fa 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -4051,14 +4051,6 @@ target_disable_btrace (struct btrace_target_info *btinfo)
/* See target.h. */
-void
-target_teardown_btrace (struct btrace_target_info *btinfo)
-{
- current_inferior ()->top_target ()->teardown_btrace (btinfo);
-}
-
-/* See target.h. */
-
enum btrace_error
target_read_btrace (struct btrace_data *btrace,
struct btrace_target_info *btinfo,
diff --git a/gdb/target.h b/gdb/target.h
index 38bdc68f6a3..3df31199feb 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1208,13 +1208,6 @@ struct target_ops
virtual void disable_btrace (struct btrace_target_info *tinfo)
TARGET_DEFAULT_NORETURN (tcomplain ());
- /* Disable branch tracing and deallocate TINFO. This function is similar
- to to_disable_btrace, except that it is called during teardown and is
- only allowed to perform actions that are safe. A counter-example would
- be attempting to talk to a remote target. */
- virtual void teardown_btrace (struct btrace_target_info *tinfo)
- TARGET_DEFAULT_NORETURN (tcomplain ());
-
/* Read branch trace data for the thread indicated by BTINFO into DATA.
DATA is cleared before new trace is added. */
virtual enum btrace_error read_btrace (struct btrace_data *data,
@@ -2618,9 +2611,6 @@ extern struct btrace_target_info *
/* See to_disable_btrace in struct target_ops. */
extern void target_disable_btrace (struct btrace_target_info *btinfo);
-/* See to_teardown_btrace in struct target_ops. */
-extern void target_teardown_btrace (struct btrace_target_info *btinfo);
-
/* See to_read_btrace in struct target_ops. */
extern enum btrace_error target_read_btrace (struct btrace_data *,
struct btrace_target_info *,
diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
index 9c49b3bed47..9fe8afe98f3 100644
--- a/gdb/x86-linux-nat.c
+++ b/gdb/x86-linux-nat.c
@@ -146,15 +146,6 @@ x86_linux_nat_target::disable_btrace (struct btrace_target_info *tinfo)
error (_("Could not disable branch tracing."));
}
-/* Teardown branch tracing. */
-
-void
-x86_linux_nat_target::teardown_btrace (struct btrace_target_info *tinfo)
-{
- /* Ignore errors. */
- linux_disable_btrace (tinfo);
-}
-
enum btrace_error
x86_linux_nat_target::read_btrace (struct btrace_data *data,
struct btrace_target_info *btinfo,
diff --git a/gdb/x86-linux-nat.h b/gdb/x86-linux-nat.h
index 61d534a3adf..10c44416bf8 100644
--- a/gdb/x86-linux-nat.h
+++ b/gdb/x86-linux-nat.h
@@ -37,7 +37,6 @@ struct x86_linux_nat_target : public x86_nat_target<linux_nat_target>
struct btrace_target_info *enable_btrace (thread_info *tp,
const struct btrace_config *conf) override;
void disable_btrace (struct btrace_target_info *tinfo) override;
- void teardown_btrace (struct btrace_target_info *tinfo) override;
enum btrace_error read_btrace (struct btrace_data *data,
struct btrace_target_info *btinfo,
enum btrace_read_type type) override;
--
2.53.0
________________________________________
Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 (89) 99143-0
www.intel.de
Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman
Chairperson of the Supervisory Board: Sonja Pierer
Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
next prev parent reply other threads:[~2026-11-10 6:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 6:43 [PATCH v1 0/7] gdb, btrace: fix unexpected core file Markus Metzger
2026-11-10 6:43 ` [PATCH v1 1/7] gdb, btrace: add clear_btrace_resources() Markus Metzger
2026-11-10 6:43 ` [PATCH v1 2/7] gdb, btrace: disable tracing in linux_btrace_target_info dtor Markus Metzger
2026-11-10 6:43 ` [PATCH v1 3/7] gdb, btrace: do not use btrace_teardown() for an exited thread Markus Metzger
2026-11-10 6:43 ` [PATCH v1 4/7] gdb, btrace: do not stop recording on close Markus Metzger
2026-11-10 6:43 ` [PATCH v1 5/7] gdb, btrace: remove btrace_teardown() Markus Metzger
2026-11-10 6:43 ` Markus Metzger [this message]
2026-11-10 6:43 ` [PATCH v1 7/7] gdb, btrace: remove the disconnect() record-btrace target method Markus Metzger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110064317.405487-7-markus.t.metzger@intel.com \
--to=markus.t.metzger@intel.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox