aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-11-11 11:18:10 -0500
committerSimon Marchi <simon.marchi@efficios.com>2020-11-11 11:18:11 -0500
commitacb994fab6bd62ac7d3ad1d729ee72f461081917 (patch)
treee211e20fc7c35a90c664dca85f2eb3e41177d977 /gdb
parentf27c0b449face6052e3b2fa92d77acc17522cb8e (diff)
downloadfsf-binutils-gdb-acb994fab6bd62ac7d3ad1d729ee72f461081917.zip
fsf-binutils-gdb-acb994fab6bd62ac7d3ad1d729ee72f461081917.tar.gz
fsf-binutils-gdb-acb994fab6bd62ac7d3ad1d729ee72f461081917.tar.bz2
gdb/testsuite: add "breakpoint always-inserted" axis in gdb.base/continue-after-aborted-step-over.exp
The test gdb.base/continue-after-aborted-step-over.exp fails on ROCm GDB [1] when using the unix board (when debugging a standard x86-64/Linux program), with: (gdb) b *0^M Breakpoint 2 at 0x0^M Warning:^M Cannot insert breakpoint 2.^M Cannot access memory at address 0x0^M ^M (gdb) FAIL: gdb.base/continue-after-aborted-step-over.exp: displaced-stepping=off: b *0 This happens because that build of GDB defaults to "set breakpoint always-inserted on", for reasons that are unrelevant to explain here. As soon as the breakpoint is created, GDB tries to insert it and (expectedly) fails. This causes more text to be output than what the pattern expects. It is actually be relevant to run the test with both "set breakpoint always-inserted" on and off. With it on, it mimics what happens when running in non-stop mode, with other threads running. This is relevant for upstream even outside of the ROCm port, so here's a patch for it. Add this other axis and adjust the "b *0" test to handle the extra output when it is on. [1] https://github.com/ROCm-Developer-Tools/ROCgdb gdb/testsuite/ChangeLog: * gdb.base/continue-after-aborted-step-over.exp: Add "breakpoint always-inserted" axis. (do_test): Add breakpoint_always_inserted parameter. Change-Id: I95126cae563a0b9a72f4a99627809fc34340cd5e
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp13
2 files changed, 16 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 18c3988..855ceaa 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2020-11-11 Simon Marchi <simon.marchi@efficios.com>
+
+ * gdb.base/continue-after-aborted-step-over.exp: Add "breakpoint
+ always-inserted" axis.
+ (do_test): Add breakpoint_always_inserted parameter.
+
2020-11-10 Tom Tromey <tromey@adacore.com>
* gdb.ada/bias.exp: Update.
diff --git a/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp b/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp
index 6a54ce1..558f5fb 100644
--- a/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp
+++ b/gdb/testsuite/gdb.base/continue-after-aborted-step-over.exp
@@ -41,13 +41,14 @@ if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
}
# DISPLACED indicates whether to use displaced-stepping.
-proc do_test {displaced} {
+proc do_test {displaced breakpoint_always_inserted} {
global gdb_prompt decimal
global srcfile binfile
clean_restart $binfile
gdb_test_no_output "set displaced-stepping $displaced"
+ gdb_test_no_output "set breakpoint always-inserted $breakpoint_always_inserted"
if ![runto_main] {
fail "run to main"
@@ -64,7 +65,11 @@ proc do_test {displaced} {
}
# Set a breakpoint that fails to insert.
- gdb_test "b *0" "Breakpoint $decimal at 0x0"
+ if { $breakpoint_always_inserted == "on" } {
+ gdb_test "b *0" "Breakpoint $decimal at 0x0.*"
+ } else {
+ gdb_test "b *0" "Breakpoint $decimal at 0x0"
+ }
gdb_test "continue" \
"Command aborted\\." \
@@ -83,5 +88,7 @@ proc do_test {displaced} {
# machinery. So make sure this runs with displaced stepping disabled,
# and for good measure, also try with displaced stepping enabled.
foreach_with_prefix displaced-stepping {"off" "on"} {
- do_test ${displaced-stepping}
+ foreach_with_prefix breakpoint-always-inserted {"off" "on"} {
+ do_test ${displaced-stepping} ${breakpoint-always-inserted}
+ }
}