Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed][gdb/testsuite] Fix cur_addr update in gdb.base/watchpoint-reuse-slot.exp
@ 2020-05-06 12:13 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2020-05-06 12:13 UTC (permalink / raw)
  To: gdb-patches

Hi,

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.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix cur_addr update in gdb.base/watchpoint-reuse-slot.exp

gdb/testsuite/ChangeLog:

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

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

---
 gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
index 73213787c61..83b970380ca 100644
--- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
@@ -73,7 +73,7 @@ proc stepi {} {
 	    } else {
 		fail $test
 	    }
-	    set cur_addr addr
+	    set cur_addr $addr
 	}
     }
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-06 12:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06 12:13 [committed][gdb/testsuite] Fix cur_addr update in gdb.base/watchpoint-reuse-slot.exp Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox