[gdb/testsuite] Fix cur_addr update in gdb.base/watchpoint-reuse-slot.exp
authorTom de Vries <tdevries@suse.de>
Wed, 6 May 2020 12:13:02 +0000 (14:13 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 6 May 2020 12:13:02 +0000 (14:13 +0200)
I noticed this code in gdb.base/watchpoint-reuse-slot.exp, proc stepi:
...
    gdb_test_multiple "stepi" $test {
-re "($hex).*[string_to_regexp $srcline]\r\n$gdb_prompt $" {
    set addr $expect_out(1,string)
    if {$addr != $cur_addr} {
pass $test
    } else {
fail $test
    }
    set cur_addr addr
}
    }
...

The variable cur_addr is documented as:
...
 # The address the program is stopped at currently.
 set cur_addr ""
...
but in the gdb_test_multiple clause we assign the string "addr" to cur_addr,
while $addr contains the current address.

Fix this by assigning $addr instead "addr".

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-05-06  Tom de Vries  <tdevries@suse.de>

* gdb.base/watchpoint-reuse-slot.exp: Fix incorrect assignment.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp

index 7a62fe8ce77102840eeba091b5512c901f3adac9..fde713527d6f34799543d804232e1f8a265c37cb 100644 (file)
@@ -1,3 +1,7 @@
+2020-05-06  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.base/watchpoint-reuse-slot.exp: Fix incorrect assignment.
+
 2020-05-06  Tom de Vries  <tdevries@suse.de>
 
        * gdb.base/store.exp (check_set, up_set): Allowing missing location
index 73213787c615d4e25e3ce7ae9bebc85355d39ad7..83b970380ca497805f226a53704937de59b18017 100644 (file)
@@ -73,7 +73,7 @@ proc stepi {} {
            } else {
                fail $test
            }
-           set cur_addr addr
+           set cur_addr $addr
        }
     }
 }
This page took 0.032079 seconds and 4 git commands to generate.