aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/ChangeLog11
-rw-r--r--gdb/testsuite/gdb.base/ui-redirect.exp2
-rw-r--r--gdb/testsuite/gdb.guile/scm-breakpoint.exp2
-rw-r--r--gdb/testsuite/lib/gdb.exp2
-rw-r--r--gdb/testsuite/lib/mi-support.exp16
5 files changed, 27 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 19b4e2b..ea6241b 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,16 @@
2020-10-13 Pedro Alves <pedro@palves.net>
+ * gdb.base/ui-redirect.exp: Expect "break -qualified main" in
+ saved breakpoints file.
+ * gdb.guile/scm-breakpoint.exp: Expect "-qualified main" when
+ inspecting breakpoint list.
+ * lib/gdb.exp (runto_main): Add "qualified" to options.
+ * lib/mi-support.exp (mi_runto_helper): Add 'qualified' parameter,
+ and handle it.
+ (mi_runto_main): Pass 1 as qualified argument.
+
+2020-10-13 Pedro Alves <pedro@palves.net>
+
* lib/mi-support.exp (mi_runto_main): New proc.
(mi_run_to_main): Use it.
* gdb.mi/mi-catch-cpp-exceptions.exp: Likewise.
diff --git a/gdb/testsuite/gdb.base/ui-redirect.exp b/gdb/testsuite/gdb.base/ui-redirect.exp
index ef0a791..9e0a694 100644
--- a/gdb/testsuite/gdb.base/ui-redirect.exp
+++ b/gdb/testsuite/gdb.base/ui-redirect.exp
@@ -47,7 +47,7 @@ gdb_breakpoint "foo"
gdb_breakpoint "bar"
set cmds [multi_line_input \
- "break main" \
+ "break -qualified main" \
" commands" \
" print 1" \
" end" \
diff --git a/gdb/testsuite/gdb.guile/scm-breakpoint.exp b/gdb/testsuite/gdb.guile/scm-breakpoint.exp
index 7545392..3bcd5c8 100644
--- a/gdb/testsuite/gdb.guile/scm-breakpoint.exp
+++ b/gdb/testsuite/gdb.guile/scm-breakpoint.exp
@@ -43,7 +43,7 @@ proc test_bkpt_basic { } {
gdb_scm_test_silent_cmd "guile (define blist (breakpoints))" \
"get breakpoint list 1"
gdb_test "guile (print (car blist))" \
- "<gdb:breakpoint #1 BP_BREAKPOINT enabled noisy hit:1 ignore:0 @main>" \
+ "<gdb:breakpoint #1 BP_BREAKPOINT enabled noisy hit:1 ignore:0 @-qualified main>" \
"check main breakpoint"
gdb_test "guile (print (breakpoint-location (car blist)))" \
"main" "check main breakpoint location"
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 6084699..4c9675f 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -689,7 +689,7 @@ proc runto { function args } {
# If you don't want that, use gdb_start_cmd.
proc runto_main { } {
- return [runto main no-message]
+ return [runto main no-message qualified]
}
### Continue, and expect to hit a breakpoint.
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 732aed2..ea59288 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -1055,8 +1055,12 @@ proc mi_run_to_main { } {
# It returns:
# -1 if test suppressed, failed, timedout
# 0 if test passed
+#
+# Supported options:
+#
+# -qualified -- pass --qualified to -break-insert
-proc mi_runto_helper {func run_or_continue} {
+proc mi_runto_helper {func run_or_continue args} {
global suppress_flag
if { $suppress_flag } {
return -1
@@ -1065,10 +1069,16 @@ proc mi_runto_helper {func run_or_continue} {
global mi_gdb_prompt expect_out
global hex decimal fullname_syntax
+ parse_args {{qualified}}
+
set test "mi runto $func"
set bp [mi_make_breakpoint -type breakpoint -disp del \
-func $func\(\\\(.*\\\)\)?]
- mi_gdb_test "200-break-insert -t $func" "200\\^done,$bp" \
+ set extra_opts ""
+ if {$qualified} {
+ append extra_opts "--qualified"
+ }
+ mi_gdb_test "200-break-insert $extra_opts -t $func" "200\\^done,$bp" \
"breakpoint at $func"
if {$run_or_continue == "run"} {
@@ -1089,7 +1099,7 @@ proc mi_runto {func} {
# Just like runto_main but works with the MI interface.
proc mi_runto_main {} {
- return [mi_runto_helper "main" "run"]
+ return [mi_runto_helper "main" "run" -qualified]
}
# Next to the next statement