]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, Tcl 9.0] Fix use of deprecated trace variable subcommand
authorTom de Vries <tdevries@suse.de>
Fri, 20 Mar 2026 09:13:27 +0000 (10:13 +0100)
committerTom de Vries <tdevries@suse.de>
Fri, 20 Mar 2026 09:13:27 +0000 (10:13 +0100)
With Tcl 9.0, we get:
...
bad option "variable": must be add, info, or remove
    while executing
"trace variable "boards_dir" w append_gdb_boards_dir"
    (file "lib/append_gdb_boards_dir.exp" line 48)
...

The trace subcommand "trace variable <name> <ops> <command>" [1]:
- is equivalent to "trace add variable <name> <ops> <command>"
- is for backwards compatibility,
- uses "an older syntax in which array, read, write, unset are replaced by a,
  r, w and u respectively",
- has an ops argument which is "not a list, but simply a string concatenation
  of the operations", and
- is "deprecated and will likely be removed in a future version of Tcl".

Fix this by using "trace add variable":
...
-trace variable "boards_dir" w append_gdb_boards_dir
+trace add variable "boards_dir" {write} append_gdb_boards_dir
...

Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33948

[1] https://www.tcl-lang.org/man/tcl8.6/TclCmd/trace.htm#M27

gdb/testsuite/lib/append_gdb_boards_dir.exp

index fb7564090658da9d0a603ca3a35d01f652545e86..8984744ab869f525d58fad843466ae06d156fe03 100644 (file)
@@ -45,4 +45,4 @@ proc append_gdb_boards_dir { name1 name2 op } {
     }
     lappend boards_dir "${gdb_boards_dir}"
 }
-trace variable "boards_dir" w append_gdb_boards_dir
+trace add variable "boards_dir" {write} append_gdb_boards_dir