Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [pushed] gdbserver: remove unused last_tracepoint variable
Date: Mon, 19 Oct 2026 11:46:07 -0400	[thread overview]
Message-ID: <20261019154613.544164-1-simon.marchi@efficios.com> (raw)

Building gdbserver with a recent clang fails with:

    /home/smarchi/src/binutils-gdb/gdbserver/tracepoint.cc:753:27: error: variable 'last_tracepoint' set but not used [-Werror,-Wunused-but-set-global]

The variable has been unused since commit 1e4d17643d49 (2011-11-14),
which changed add_tracepoint to insert new tracepoints in address order
instead of appending them at the end of the list.  That commit removed
the only read of last_tracepoint, but left the assignments.  Remove the
variable.

Change-Id: I85293f31f7994c49a6a878f4192c97874ed26eee
---
 gdbserver/tracepoint.cc | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc
index 593dca65f768..a5bb22540fdc 100644
--- a/gdbserver/tracepoint.cc
+++ b/gdbserver/tracepoint.cc
@@ -747,11 +747,6 @@ IP_AGENT_EXPORT_VAR int expr_eval_result = expr_eval_no_error;
 
 #ifndef IN_PROCESS_AGENT
 
-/* Pointer to the last tracepoint in the list, new tracepoints are
-   linked in at the end.  */
-
-static struct tracepoint *last_tracepoint;
-
 static const char * const eval_result_names[] =
   {
 #define AX_RESULT_TYPE(ENUM,STR) STR,
@@ -1738,7 +1733,6 @@ add_tracepoint (int num, CORE_ADDR addr)
     ;
   tpoint->next = *tp_next;
   *tp_next = tpoint;
-  last_tracepoint = tpoint;
 
   seen_step_action_flag = 0;
 
@@ -2260,7 +2254,6 @@ cmd_qtinit (char *packet)
   clear_readonly_regions ();
 
   tracepoints = NULL;
-  last_tracepoint = NULL;
 
   /* Clear out any leftover trace state variables.  Ones with target
      defined getters should be kept however.  */

base-commit: a0afe8f89d660b0cbcf5f7f12167427f3d2a5c37
-- 
2.56.0


                 reply	other threads:[~2026-10-19 15:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261019154613.544164-1-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.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