summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-05-06 14:48:50 +0200
committerTom de Vries <tdevries@suse.de>2020-05-06 14:48:50 +0200
commit24fe640b4d2cdb3914254afe2cd02aa31242e4db (patch)
tree25d9466e23bde6048e452d2ccab87abed9f72a77
parent0d8683a32122f0027d2ab64082d1f9fced98d599 (diff)
downloadbinutils-gdb-24fe640b4d2cdb3914254afe2cd02aa31242e4db.tar.gz
[gdb/testsuite] Fix gdb.reverse/consecutive-{precsave,reverse}.exp with gcc-8
When running test-cases gdb.reverse/consecutive-precsave.exp and gdb.reverse/consecutive-reverse.exp with gcc-8, we get: ... FAIL: gdb.reverse/consecutive-precsave.exp: stopped at bp, 2nd instr FAIL: gdb.reverse/consecutive-reverse.exp: stopped at bp, 2nd instr ... These FAILs are duplicates of the FAILs fixed in commit 7c99e7e2b08 "[gdb/testsuite] Fix gdb.base/consecutive.exp with gcc-8". Fix these in the same manner. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-05-06 Tom de Vries <tdevries@suse.de> * gdb.reverse/consecutive-precsave.exp: Handle if instruction after breakpoint is at a "recommended breakpoint location". * gdb.reverse/consecutive-reverse.exp: Same.
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.reverse/consecutive-precsave.exp15
-rw-r--r--gdb/testsuite/gdb.reverse/consecutive-reverse.exp15
3 files changed, 34 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index d808217ad57..443c3d35d12 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2020-05-06 Tom de Vries <tdevries@suse.de>
+ * gdb.reverse/consecutive-precsave.exp: Handle if instruction after
+ breakpoint is at a "recommended breakpoint location".
+ * gdb.reverse/consecutive-reverse.exp: Same.
+
+2020-05-06 Tom de Vries <tdevries@suse.de>
+
* gdb.base/watchpoint-reuse-slot.exp (stepi): Print $pc to get current
address.
diff --git a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
index 9aaa1314d25..dec501d589b 100644
--- a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
@@ -35,6 +35,8 @@ if [supports_process_record] {
gdb_test_no_output "record" "turn on process record"
}
+set is_stmt [is_stmt_addresses $srcfile]
+
set end_location [gdb_get_line_number "end of main" ]
gdb_test "break $end_location" \
"Breakpoint $decimal at .*$srcfile, line $end_location\." \
@@ -79,7 +81,7 @@ gdb_test "break \*$foo2_addr" "Breakpoint $decimal at $foo2_addr: file .*" \
set testmsg "stopped at bp, 2nd instr"
gdb_test_multiple "step" $testmsg {
- -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" {
+ -re -wrap "Breakpoint $decimal, ($hex) in foo.*" {
set stop_addr $expect_out(1,string)
if [eval expr "$foo2_addr == $stop_addr"] then {
pass "stopped at bp, 2nd instr"
@@ -87,6 +89,17 @@ gdb_test_multiple "step" $testmsg {
fail "stopped at bp, 2nd instr (wrong address)"
}
}
+ -re -wrap "Breakpoint $decimal, foo.*" {
+ set stop_addr [get_valueof "/x" "\$pc" "" "value of pc"]
+ set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
+ if { ! $stop_addr_is_stmt } {
+ fail "stopped at bp, 2nd instr (missing hex prefix)"
+ } elseif [eval expr "$foo2_addr == $stop_addr"] then {
+ pass "stopped at bp, 2nd instr"
+ } else {
+ fail "stopped at bp, 2nd instr (wrong address)"
+ }
+ }
}
###
diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
index 33834875d49..ff03e6744a4 100644
--- a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
@@ -33,6 +33,8 @@ if [supports_process_record] {
gdb_test_no_output "record" "turn on process record"
}
+set is_stmt [is_stmt_addresses $srcfile]
+
gdb_breakpoint foo
gdb_test "continue" "Breakpoint $decimal, foo .*" \
"continue to breakpoint in foo"
@@ -59,7 +61,7 @@ gdb_test "break \*$foo2_addr" "Breakpoint $decimal at $foo2_addr: file .*" \
set testmsg "stopped at bp, 2nd instr"
gdb_test_multiple "step" $testmsg {
- -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" {
+ -re -wrap "Breakpoint $decimal, ($hex) in foo.*" {
set stop_addr $expect_out(1,string)
if [eval expr "$foo2_addr == $stop_addr"] then {
pass "stopped at bp, 2nd instr"
@@ -67,6 +69,17 @@ gdb_test_multiple "step" $testmsg {
fail "stopped at bp, 2nd instr (wrong address)"
}
}
+ -re -wrap "Breakpoint $decimal, foo.*" {
+ set stop_addr [get_valueof "/x" "\$pc" "" "value of pc"]
+ set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
+ if { ! $stop_addr_is_stmt } {
+ fail "stopped at bp, 2nd instr (missing hex prefix)"
+ } elseif [eval expr "$foo2_addr == $stop_addr"] then {
+ pass "stopped at bp, 2nd instr"
+ } else {
+ fail "stopped at bp, 2nd instr (wrong address)"
+ }
+ }
}
###