aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-05-06 14:27:36 +0200
committerTom de Vries <tdevries@suse.de>2020-05-06 14:27:36 +0200
commit0d8683a32122f0027d2ab64082d1f9fced98d599 (patch)
treeba5c3c91b06077034d1d6fea5bff44170d9ab884
parent6ef719c016b440223754ef05457892c91a3b8751 (diff)
downloadgdb-0d8683a32122f0027d2ab64082d1f9fced98d599.zip
gdb-0d8683a32122f0027d2ab64082d1f9fced98d599.tar.gz
gdb-0d8683a32122f0027d2ab64082d1f9fced98d599.tar.bz2
[gdb/testsuite] Fix gdb.base/watchpoint-reuse-slot.exp with gcc-8
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. 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.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp4
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index fde7135..d808217 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2020-05-06 Tom de Vries <tdevries@suse.de>
+ * gdb.base/watchpoint-reuse-slot.exp (stepi): Print $pc to get current
+ address.
+
+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>
diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
index 83b9703..3d3d3c4 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 {