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

Hi,

When running test-case gdb.base/watchpoint-reuse-slot.exp with gcc-8 instead
of gcc-7, we have:
...
 (gdb) PASS: $conf: watch *(buf.byte + 0 + 0)@1
 stepi^M
-0x00000000004004b9      34        for (i = 0; i < 100000; i++);^M
+34        for (i = 0; i < 100000; i++);^M
-(gdb) PASS: $conf: stepi advanced
+(gdb) FAIL: $conf: stepi advanced
...
where $conf is "gdb.base/watchpoint-reuse-slot.exp: hw-watch: always-inserted
off: watch x watch: : width 1, iter 0: base + 0".

This is due to the fact that gcc-8 generates more precise line info, making
the instruction at 0x4004b9 a "recommended breakpoint location", such that gdb
no longer prints the instruction address.

Fix this by getting the instruction address by printing $pc.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix gdb.base/watchpoint-reuse-slot.exp with gcc-8

gdb/testsuite/ChangeLog:

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

	* gdb.base/watchpoint-reuse-slot.exp (stepi): Print $pc to get current
	address.

---
 gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
index 83b970380ca..3d3d3c479d5 100644
--- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
@@ -66,8 +66,8 @@ proc stepi {} {
     set srcline "  for (i = 0; i < 100000; i++); /* stepi line */"
     set test "stepi advanced"
     gdb_test_multiple "stepi" $test {
-	-re "($hex).*[string_to_regexp $srcline]\r\n$gdb_prompt $" {
-	    set addr $expect_out(1,string)
+	-re -wrap "[string_to_regexp $srcline]" {
+	    set addr [get_valueof "/x" "\$pc" "0"]
 	    if {$addr != $cur_addr} {
 		pass $test
 	    } else {


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

only message in thread, other threads:[~2020-05-06 12:27 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:27 [committed][gdb/testsuite] Fix gdb.base/watchpoint-reuse-slot.exp with gcc-8 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