diff options
author | Tom de Vries <tdevries@suse.de> | 2020-12-04 13:36:48 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-12-04 13:36:48 +0100 |
commit | a8d136756b9882f90311af7205a00c0d97fea64d (patch) | |
tree | 815a49754c5b7fab5b7882234d412f7565c7e0db | |
parent | f17727b3497a630b01dffd219cdc372a058be121 (diff) | |
download | fsf-binutils-gdb-a8d136756b9882f90311af7205a00c0d97fea64d.zip fsf-binutils-gdb-a8d136756b9882f90311af7205a00c0d97fea64d.tar.gz fsf-binutils-gdb-a8d136756b9882f90311af7205a00c0d97fea64d.tar.bz2 |
[gdb/testsuite] Fix control-flow in gdb.reverse/insn-reverse.exp
In gdb.reverse/insn-reverse.exp, we have loop containing a call to
gdb_test_multiple, which itself contains a break:
...
for {} {$count < 500} {incr count} {
...
gdb_test_multiple "x/i \$pc" "" {
...
break
}
...
On SLE-11 with:
...
$ runtest --version
Expect version is 5.44.1.11
Tcl version is 8.5
Framework version is 1.4.4
...
the break doesn't seem to have the effect of breaking out of the loop.
The break does have the effect of terminating evaluation of the expect clause,
which means we don't set insn_array, after which we run into:
...
ERROR: tcl error sourcing src/gdb/testsuite/gdb.reverse/insn-reverse.exp.
ERROR: can't read "insn_array(5)": no such element in array
...
gdb/testsuite/ChangeLog:
2020-12-04 Tom de Vries <tdevries@suse.de>
* gdb.reverse/insn-reverse.exp: Don't break inside gdb_test_multiple
clause.
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/insn-reverse.exp | 26 |
2 files changed, 20 insertions, 11 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a88668d..6d7d0c2 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2020-12-04 Tom de Vries <tdevries@suse.de> + * gdb.reverse/insn-reverse.exp: Don't break inside gdb_test_multiple + clause. + +2020-12-04 Tom de Vries <tdevries@suse.de> + * gdb.reverse/insn-reverse.exp: Fix count handling. 2020-12-04 Tom de Vries <tdevries@suse.de> diff --git a/gdb/testsuite/gdb.reverse/insn-reverse.exp b/gdb/testsuite/gdb.reverse/insn-reverse.exp index 5831952..54af958 100644 --- a/gdb/testsuite/gdb.reverse/insn-reverse.exp +++ b/gdb/testsuite/gdb.reverse/insn-reverse.exp @@ -79,23 +79,27 @@ proc test { func testcase_nr } { set count 0 set insn_addr "" for {} {$count < 500} {incr count} { + set prev_insn_addr $insn_addr + set insn_addr "" gdb_test_multiple "x/i \$pc" "" { -re ".* ($hex) <.*>:\[ \t\]*(.*)\r\n$gdb_prompt $" { - set prev_insn_addr $insn_addr set insn_addr $expect_out(1,string) + set insn_array($count) $expect_out(2,string) + } + } - if [expr {$last_insn == $insn_addr}] { - break - } + if { $insn_addr == "" } { + break + } - if { $prev_insn_addr == $insn_addr } { - # Failed to make progress, might have run into SIGILL. - unsupported "no progress at: $expect_out(2,string)" - break - } + if { $last_insn == $insn_addr } { + break + } - set insn_array($count) $expect_out(2,string) - } + if { $prev_insn_addr == $insn_addr } { + # Failed to make progress, might have run into SIGILL. + unsupported "no progress at: $expect_out(2,string)" + break } set pre_regs($count) [capture_command_output "info all-registers" ""] |