This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 09/14] gdb/testsuite: Fix break-always.exp for enabled do_reload_on_run
- From: Shahab Vahedi <shahab dot vahedi at gmail dot com>
- To: gdb-patches at sourceware dot org
- Cc: Shahab Vahedi <shahab at synopsys dot com>, Shahab Vahedi <shahab dot vahedi at gmail dot com>, Francois Bedard <fbedard at synopsys dot com>, Anton Kolesov <Anton dot Kolesov at synopsys dot com>
- Date: Fri, 7 Feb 2020 15:59:58 +0100
- Subject: [PATCH 09/14] gdb/testsuite: Fix break-always.exp for enabled do_reload_on_run
- References: <20200207150003.8383-1-shahab.vahedi@gmail.com>
From: Anton Kolesov <Anton.Kolesov@synopsys.com>
GDB testsuite proc "runto" is not compatible with "always-inserted on"
when gdb,do_reload_on_run is set - in this case "runto" will insert
breakpoint, and then will do a reload, which will overwrite an already
inserted breakpoint, so further continue will not succeed. There is no
problem with "always-inserted off", because breakpoints are inserted
automatically by GDB before resuming, so reloading doesn't overwrite
them.
gdb/testsuite/ChangeLog:
2016-07-19 Anton Kolesov <Anton.Kolesov@synopsys.com>
* gdb.base/break-always.exp: Move "runto" before
"always-inserted on".
Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
---
gdb/testsuite/gdb.base/break-always.exp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.base/break-always.exp b/gdb/testsuite/gdb.base/break-always.exp
index b2a2f3a475cb..c3b55b9f8402 100644
--- a/gdb/testsuite/gdb.base/break-always.exp
+++ b/gdb/testsuite/gdb.base/break-always.exp
@@ -21,6 +21,14 @@ if { [prepare_for_testing "failed to prepare" break-always break-always.c] } {
return -1
}
+# GDB testsuite proc "runto" is not compatible with "always-inserted on" when
+# gdb,do_reload_on_run is set - in this case "runto" will insert breakpoint,
+# and then will do a reload, which will overwrite an already inserted
+# breakpoint, so further continue will not succeed. There is no problem with
+# "always-inserted off", because breakpoints are inserted automatically by GDB
+# before resuming, so reloading doesn't overwrite them.
+runto foo
+
set bar_location [gdb_get_line_number "break in bar" break-always.c]
gdb_test_no_output "set breakpoint always-inserted on"
@@ -28,8 +36,6 @@ gdb_test_no_output "set breakpoint always-inserted on"
gdb_test "show breakpoint always-inserted" "mode is on\." \
"confirm breakpoint always-inserted"
-runto foo
-
gdb_test "break bar" "Breakpoint 2.*" "set breakpoint on bar"
gdb_test "break bar" "Note: breakpoint 2 also set.*Breakpoint 3.*" "set 2nd breakpoint on bar"
gdb_test "break bar" "Note: breakpoints 2 and 3 also set.*Breakpoint 4.*" "set 3rd breakpoint on bar"
--
2.25.0