[09/14] gdb/testsuite: Fix break-always.exp for enabled do_reload_on_run

Message ID 20200207150003.8383-10-shahab.vahedi@gmail.com
State New
Headers show
Series
  • Fixes for GDB Testsuites
Related show

Commit Message

Shahab Vahedi Feb. 7, 2020, 2:59 p.m.
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(-)

-- 
2.25.0

Patch

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"