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
}
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