Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [pushed] gdbserver: remove unused last_tracepoint variable
@ 2026-10-19 15:46 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2026-10-19 15:46 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-19 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-19 15:46 [pushed] gdbserver: remove unused last_tracepoint variable Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox