diff options
author | Tom de Vries <tdevries@suse.de> | 2021-09-24 12:39:14 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2021-09-24 12:39:14 +0200 |
commit | dfca0ed23fc32c7a6a157c46796a9cc56689a5ad (patch) | |
tree | 65c24da2e1a5c8a553e7c393ba5a3cf5879bc2d1 | |
parent | d294324cc25bdff55b1f3c3918394ceeb63e7354 (diff) | |
download | fsf-binutils-gdb-dfca0ed23fc32c7a6a157c46796a9cc56689a5ad.zip fsf-binutils-gdb-dfca0ed23fc32c7a6a157c46796a9cc56689a5ad.tar.gz fsf-binutils-gdb-dfca0ed23fc32c7a6a157c46796a9cc56689a5ad.tar.bz2 |
[gdb/testsuite] Fix set $var val in gdb.dwarf2/dw2-is-stmt.exp
When doing a testrun with:
...
$ make check RUNTESTFLAGS=$(cd $src/gdb/testsuite/; echo gdb.dwarf2/*.exp)
...
I ran into:
...
ERROR: tcl error sourcing gdb.dwarf2/dw2-is-stmt.exp.
ERROR: expected integer but got "dw2-abs-hi-pc-world.c"
while executing
"incr i"
...
The variable i is set in gdb.dwarf2/dw2-abs-hi-pc.exp, and leaks to
gdb.dwarf2/dw2-is-stmt.exp. It's not removed by gdb_cleanup_globals because i
is set as global variable by runtest.exp, which does:
...
for { set i 0 } { $i < $argc } { incr i } {
...
at toplevel but forgets to unset the variable.
Fix this by removing '$' in front of the variable name when doing set:
...
-set $i 0
+set i 0
...
Tested on x86_64-linux.
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp index 90f7647..bb0afe1 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp @@ -188,7 +188,7 @@ runto_main # be a single instruction between line_label_1 and line_label_2, but # we allow for up to 25 (just a random number). -set $i 0 +set i 0 set pc [get_hexadecimal_valueof "\$pc" "NO-PC" \ "get pc before stepi loop at line_label_1"] while { $pc < $ll2 } { @@ -218,7 +218,7 @@ while { $pc < $ll2 } { # Now single instruction step forward until GDB reports a new source # line, at which point we should be at line_label_5. -set $i 0 +set i 0 set pc [get_hexadecimal_valueof "\$pc" "NO-PC" \ "get pc before stepi loop at line_label_2"] while { $pc < $ll5 } { |