* [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board
@ 2026-05-06 20:27 simon.marchi
2026-05-06 20:27 ` [PATCH 1/7] gdb/testsuite: remove unused arguments to gdb_breakpoint simon.marchi
` (7 more replies)
0 siblings, 8 replies; 16+ messages in thread
From: simon.marchi @ 2026-05-06 20:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
From: Simon Marchi <simon.marchi@polymtl.ca>
I started looking into this while revieweing this patch from Baris [1].
The problem was that a set was attempting to pass args to the inferior
using "set args", which does not work with the native-gdbserver board.
I tried to implement proper support for passing arguments to inferior
programs in the testsuite, and this series is the result.
[1] https://inbox.sourceware.org/20260424141955.4083734-1-tankut.baris.aktemur%40intel.com
Simon Marchi (7):
gdb/testsuite: remove unused arguments to gdb_breakpoint
gdb/testsuite: make gdb_breakpoint, runto and runto_main use
parse_args
gdb/testsuite: add -inferior-args option to runto
gdb/testsuite: fix step-over-thread-exit.exp with native-gdbserver
gdb/testsuite: make pie-execl.exp work with native-gdbserver
gdb/testsuite: use -inferior-args in
gdb.base/gcore-buffer-overflow.exp
gdb/testsuite: fix gdb.rocm/code-object-load-while-breakpoint-hit.exp
with native-gdbserver
gdb/testsuite/gdb.ada/break-label.exp | 2 +-
gdb/testsuite/gdb.ada/finish-var-size.exp | 2 +-
gdb/testsuite/gdb.ada/import.exp | 6 +-
gdb/testsuite/gdb.ada/length_cond.exp | 2 +-
gdb/testsuite/gdb.ada/non-ascii-utf-8.exp | 14 ++--
.../gdb.arch/aarch64-atomic-inst.exp | 4 +-
.../gdb.arch/aarch64-pseudo-unwind.exp | 4 +-
.../gdb.arch/amd64-pseudo-unwind.exp | 4 +-
.../gdb.arch/arc-analyze-prologue.exp | 6 +-
.../gdb.arch/arm-pseudo-unwind-legacy.exp | 4 +-
gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp | 4 +-
gdb/testsuite/gdb.arch/powerpc-htm-regs.exp | 4 +-
gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp | 6 +-
.../gdb.arch/ppc64-isa207-atomic-inst.exp | 12 +--
gdb/testsuite/gdb.base/annotate-symlink.exp | 2 +-
gdb/testsuite/gdb.base/attach.exp | 2 +-
gdb/testsuite/gdb.base/break-inline.exp | 2 +-
gdb/testsuite/gdb.base/break-interp.exp | 2 +-
.../gdb.base/condbreak-multi-context.exp | 14 ++--
gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 2 +-
gdb/testsuite/gdb.base/dlmopen.exp | 2 +-
gdb/testsuite/gdb.base/eh_return.exp | 2 +-
gdb/testsuite/gdb.base/foll-exec-mode.exp | 2 +-
gdb/testsuite/gdb.base/foll-vfork.exp | 2 +-
.../fork-no-detach-follow-child-dlopen.exp | 2 +-
gdb/testsuite/gdb.base/fullname.exp | 12 +--
.../gdb.base/gcore-buffer-overflow.exp | 5 +-
gdb/testsuite/gdb.base/gcore-memory-usage.exp | 2 +-
gdb/testsuite/gdb.base/gdb-sigterm.exp | 2 +-
gdb/testsuite/gdb.base/gdb1250.exp | 2 +-
gdb/testsuite/gdb.base/infcall-failure-2.exp | 2 +-
.../gdb.base/infcall-nested-structs.exp.tcl | 2 +-
gdb/testsuite/gdb.base/inferior-args.exp | 6 +-
gdb/testsuite/gdb.base/info-shared.exp | 4 +-
gdb/testsuite/gdb.base/jit-reader.exp | 2 +-
gdb/testsuite/gdb.base/nostdlib.exp | 2 +-
gdb/testsuite/gdb.base/pie-execl.exp | 14 +---
gdb/testsuite/gdb.base/prologue.exp | 2 +-
.../gdb.base/run-attach-while-running.exp | 2 +-
gdb/testsuite/gdb.base/shlib-call.exp | 2 +-
.../gdb.base/solib-bad-entry-addr.exp | 2 +-
gdb/testsuite/gdb.base/solib-vanish.exp | 2 +-
gdb/testsuite/gdb.base/stale-infcall.exp | 2 +-
gdb/testsuite/gdb.base/sym-file.exp | 2 +-
gdb/testsuite/gdb.base/symlink-sourcefile.exp | 2 +-
gdb/testsuite/gdb.base/tls-dlobj.exp | 22 ++---
gdb/testsuite/gdb.base/unload.exp | 8 +-
gdb/testsuite/gdb.base/valgrind-disp-step.exp | 2 +-
.../gdb.base/watchpoint-unaligned.exp | 5 +-
gdb/testsuite/gdb.btrace/rn-dl-bind.exp | 2 +-
gdb/testsuite/gdb.cp/anon-ns.exp | 4 +-
.../gdb.cp/breakpoint-shlib-func.exp | 2 +-
gdb/testsuite/gdb.cp/meth-typedefs.exp | 4 +-
gdb/testsuite/gdb.cp/nextoverthrow.exp | 2 +-
gdb/testsuite/gdb.cp/paramless.exp | 2 +-
gdb/testsuite/gdb.cp/save-bp-qualified.exp | 2 +-
gdb/testsuite/gdb.cp/step-and-next-inline.exp | 2 +-
gdb/testsuite/gdb.cp/subtypes.exp | 6 +-
gdb/testsuite/gdb.cp/templates.exp | 16 ++--
.../gdb.debuginfod/fetch_src_and_symbols.exp | 2 +-
gdb/testsuite/gdb.dwarf2/ada-cold-name.exp | 4 +-
gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp | 8 +-
.../gdb.dwarf2/break-inline-psymtab.exp | 2 +-
.../gdb.dwarf2/dw2-main-no-line-number.exp | 2 +-
.../gdb.dwarf2/dw2-vendor-extended-opcode.exp | 2 +-
.../inlined_subroutine-inheritance.exp | 2 +-
.../locexpr-data-member-location.exp | 4 +-
gdb/testsuite/gdb.dwarf2/struct-decl.exp | 2 +-
gdb/testsuite/gdb.gdb/python-helper.exp | 4 +-
gdb/testsuite/gdb.go/methods.exp | 4 +-
gdb/testsuite/gdb.go/no-package.exp | 2 +-
gdb/testsuite/gdb.linespec/explicit.exp | 4 +-
gdb/testsuite/gdb.linespec/keywords.exp | 12 +--
gdb/testsuite/gdb.linespec/thread.exp | 2 +-
.../gdb.multi/inferior-specific-bp.exp | 2 +-
gdb/testsuite/gdb.multi/multi-kill.exp | 2 +-
.../gdb.multi/pending-bp-del-inferior.exp | 2 +-
gdb/testsuite/gdb.multi/pending-bp.exp | 16 ++--
gdb/testsuite/gdb.multi/watchpoint-multi.exp | 4 +-
gdb/testsuite/gdb.opt/inline-break.exp | 4 +-
gdb/testsuite/gdb.python/py-breakpoint.exp | 2 +-
gdb/testsuite/gdb.python/py-events.exp | 2 +-
.../gdb.python/py-finish-breakpoint.exp | 2 +-
.../gdb.reverse/finish-reverse-next.exp | 10 +--
.../gdb.reverse/func-map-to-same-line.exp | 4 +-
.../gdb.reverse/i386-avx-reverse.exp | 4 +-
.../code-object-load-while-breakpoint-hit.exp | 3 +-
.../gdb.rocm/fork-exec-gpu-to-non-gpu.exp | 4 +-
.../gdb.rocm/fork-exec-non-gpu-to-gpu.exp | 4 +-
gdb/testsuite/gdb.rocm/multi-inferior-gpu.exp | 2 +-
.../precise-memory-warning-watchpoint.exp | 2 +-
gdb/testsuite/gdb.rocm/precise-memory.exp | 2 +-
.../gdb.rocm/watchpoint-at-end-of-shader.exp | 2 +-
gdb/testsuite/gdb.rocm/watchpoint-basic.exp | 2 +-
gdb/testsuite/gdb.rust/modules.exp | 4 +-
.../gdb.threads/del-pending-thread-bp.exp | 2 +-
.../gdb.threads/fork-thread-pending.exp | 2 +-
.../gdb.threads/multiple-step-overs.exp | 2 +-
.../process-dies-while-detaching.exp | 4 +-
.../gdb.threads/step-over-thread-exit.c | 15 ++--
.../gdb.threads/step-over-thread-exit.exp | 8 +-
.../gdb.threads/thread-bp-deleted.exp | 3 +-
gdb/testsuite/gdb.trace/actions-changed.exp | 2 +-
gdb/testsuite/gdb.trace/backtrace.exp | 2 +-
gdb/testsuite/gdb.trace/circ.exp | 4 +-
gdb/testsuite/gdb.trace/collection.exp | 4 +-
.../gdb.trace/disconnected-tracing.exp | 4 +-
gdb/testsuite/gdb.trace/ftrace-lock.exp | 4 +-
gdb/testsuite/gdb.trace/ftrace.exp | 4 +-
gdb/testsuite/gdb.trace/infotrace.exp | 2 +-
gdb/testsuite/gdb.trace/packetlen.exp | 2 +-
gdb/testsuite/gdb.trace/passc-dyn.exp | 2 +-
gdb/testsuite/gdb.trace/qtro.exp | 2 +-
gdb/testsuite/gdb.trace/read-memory.exp | 2 +-
gdb/testsuite/gdb.trace/report.exp | 2 +-
gdb/testsuite/gdb.trace/signal.exp | 6 +-
gdb/testsuite/gdb.trace/status-stop.exp | 4 +-
gdb/testsuite/gdb.trace/strace.exp | 6 +-
gdb/testsuite/gdb.trace/tfind.exp | 2 +-
gdb/testsuite/gdb.trace/trace-break.exp | 26 +++---
gdb/testsuite/gdb.trace/trace-condition.exp | 4 +-
gdb/testsuite/gdb.trace/trace-mt.exp | 2 +-
gdb/testsuite/gdb.trace/tstatus.exp | 4 +-
gdb/testsuite/gdb.trace/tsv.exp | 2 +-
.../gdb.trace/unavailable-dwarf-piece.exp | 2 +-
gdb/testsuite/gdb.trace/unavailable.exp | 4 +-
gdb/testsuite/gdb.trace/while-dyn.exp | 2 +-
gdb/testsuite/lib/gdb.exp | 80 +++++++++++++------
gdb/testsuite/lib/selftest-support.exp | 2 +-
129 files changed, 310 insertions(+), 301 deletions(-)
base-commit: 9e6e0c3cd9e6d5ee4953f72a805cff5f150aa2fd
--
2.54.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/7] gdb/testsuite: remove unused arguments to gdb_breakpoint
2026-05-06 20:27 [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board simon.marchi
@ 2026-05-06 20:27 ` simon.marchi
2026-05-06 20:27 ` [PATCH 2/7] gdb/testsuite: make gdb_breakpoint, runto and runto_main use parse_args simon.marchi
` (6 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: simon.marchi @ 2026-05-06 20:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
From: Simon Marchi <simon.marchi@polymtl.ca>
These arguments don't actually do anything, remove them.
Change-Id: Ifd6a18d3effc521ba410fd40280a197d37661b12
---
gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp | 4 +---
gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp | 6 ++----
gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.exp | 12 ++++--------
gdb/testsuite/gdb.base/gcore-memory-usage.exp | 2 +-
gdb/testsuite/gdb.base/valgrind-disp-step.exp | 2 +-
gdb/testsuite/gdb.base/watchpoint-unaligned.exp | 5 ++---
gdb/testsuite/gdb.threads/fork-thread-pending.exp | 2 +-
gdb/testsuite/gdb.threads/multiple-step-overs.exp | 2 +-
gdb/testsuite/gdb.threads/thread-bp-deleted.exp | 3 +--
9 files changed, 14 insertions(+), 24 deletions(-)
diff --git a/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp b/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
index 269e32cecc74..27a13b346e8a 100644
--- a/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
@@ -29,9 +29,7 @@ if {![runto_main]} {
return -1
}
-gdb_breakpoint "[gdb_get_line_number "ldxr"]" \
- "Breakpoint $decimal at $hex" \
- "Set the breakpoint at the start of the sequence"
+gdb_breakpoint "[gdb_get_line_number "ldxr"]"
gdb_test "continue" "Continuing.*Breakpoint $decimal.*" \
"Continue until breakpoint"
diff --git a/gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp b/gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp
index c020df807f44..80410fe6f7c3 100644
--- a/gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp
+++ b/gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp
@@ -39,12 +39,10 @@ proc do_test { displaced } {
gdb_test_no_output "set displaced-stepping $displaced"
set bp1 [gdb_get_line_number "lwarx"]
- gdb_breakpoint "$bp1" "Breakpoint $decimal at $hex" \
- "set the breakpoint at the start of the lwarx/stwcx sequence"
+ gdb_breakpoint "$bp1"
set bp2 [gdb_get_line_number "ldarx"]
- gdb_breakpoint "$bp2" "Breakpoint $decimal at $hex" \
- "set the breakpoint at the start of the ldarx/stdcx sequence"
+ gdb_breakpoint "$bp2"
gdb_test continue "Continuing.*Breakpoint $decimal.*" \
"continue until lwarx/stwcx start breakpoint"
diff --git a/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.exp b/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.exp
index 482dbb4d04fd..0772eda0a0a8 100644
--- a/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.exp
+++ b/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.exp
@@ -43,8 +43,7 @@ proc do_test { displaced } {
gdb_test_no_output "set displaced-stepping $displaced"
- gdb_breakpoint "test_atomic_sequences" "Breakpoint $decimal at $hex" \
- "set the breakpoint at the start of the test function"
+ gdb_breakpoint "test_atomic_sequences"
gdb_test_multiple "continue" "Continue until lbarx/stbcx start breakpoint" {
-re "$inferior_exited_re with code 01.\[\r\n\]+$gdb_prompt $" {
@@ -57,16 +56,13 @@ proc do_test { displaced } {
}
set bp1 [gdb_get_line_number "lbarx" "$srcfile2"]
- gdb_breakpoint "$bp1" "Breakpoint $decimal at $hex" \
- "set the breakpoint at the start of the lbarx/stbcx sequence"
+ gdb_breakpoint "$bp1"
set bp2 [gdb_get_line_number "lharx" "$srcfile2"]
- gdb_breakpoint "$bp2" "Breakpoint $decimal at $hex" \
- "set the breakpoint at the start of the lharx/sthcx sequence"
+ gdb_breakpoint "$bp2"
set bp3 [gdb_get_line_number "lqarx" "$srcfile2"]
- gdb_breakpoint "$bp3" "Breakpoint $decimal at $hex" \
- "set the breakpoint at the start of the lqarx/stqcx sequence"
+ gdb_breakpoint "$bp3"
gdb_test continue "Continuing.*Breakpoint $decimal.*" \
"continue until lbarx/stbcx start breakpoint"
diff --git a/gdb/testsuite/gdb.base/gcore-memory-usage.exp b/gdb/testsuite/gdb.base/gcore-memory-usage.exp
index fc57d1604e29..d9c8dd0bffc3 100644
--- a/gdb/testsuite/gdb.base/gcore-memory-usage.exp
+++ b/gdb/testsuite/gdb.base/gcore-memory-usage.exp
@@ -61,7 +61,7 @@ proc run_test {megs max_mem} {
gdb_test "attach $inferior_pid" "Attaching to.*" attach
set line [gdb_get_line_number "TAG: BREAK HERE" $::testfile.c]
- gdb_breakpoint "${::srcfile}:$line" "break at to known line"
+ gdb_breakpoint "${::srcfile}:$line"
gdb_continue_to_breakpoint "continue to known line"
# Get the important info.
diff --git a/gdb/testsuite/gdb.base/valgrind-disp-step.exp b/gdb/testsuite/gdb.base/valgrind-disp-step.exp
index 13f36837d5e2..c2991b247b9d 100644
--- a/gdb/testsuite/gdb.base/valgrind-disp-step.exp
+++ b/gdb/testsuite/gdb.base/valgrind-disp-step.exp
@@ -35,7 +35,7 @@ if { [vgdb_start] == -1 } {
}
gdb_test_no_output "set displaced-stepping off"
-gdb_breakpoint "main" "breakpoint at main"
+gdb_breakpoint "main"
gdb_test "continue" " stop 0 .*" "continue to main"
delete_breakpoints
diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
index 8b929e5de4e6..3ec57cc9c455 100644
--- a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
@@ -28,7 +28,7 @@ if {![runto_main]} {
return -1
}
-gdb_breakpoint [gdb_get_line_number "start_again"] "Breakpoint $decimal at $hex" "start_again"
+gdb_breakpoint [gdb_get_line_number "start_again"]
set sizes {1 2 4 8}
array set alignedend {1 1 2 2 3 4 4 4 5 8 6 8 7 8 8 8}
@@ -164,8 +164,7 @@ proc size8twice { function cmd offset index } {
# Set a breakpoint.
set bp_src_string "${function}_return"
set bp_loc [gdb_get_line_number $bp_src_string]
- gdb_breakpoint $bp_loc \
- "Breakpoint $::decimal at $::hex" "$bp_src_string"
+ gdb_breakpoint $bp_loc
# Set a hardware watchpoint.
set watch_index [expr {$offset + $index}]
diff --git a/gdb/testsuite/gdb.threads/fork-thread-pending.exp b/gdb/testsuite/gdb.threads/fork-thread-pending.exp
index 6f81e5e7e491..91da718d19ce 100644
--- a/gdb/testsuite/gdb.threads/fork-thread-pending.exp
+++ b/gdb/testsuite/gdb.threads/fork-thread-pending.exp
@@ -29,7 +29,7 @@ if {![runto_main]} {
gdb_test_no_output "set follow-fork-mode child" "1, set follow-fork-mode child"
gdb_test "catch fork" "Catchpoint \[0-9\]* \\(fork\\)" "1, insert fork catchpoint"
-gdb_breakpoint "start" "" "1, set breakpoint at start"
+gdb_breakpoint "start"
gdb_test "continue" "Catchpoint.*" "1, get to the fork event"
diff --git a/gdb/testsuite/gdb.threads/multiple-step-overs.exp b/gdb/testsuite/gdb.threads/multiple-step-overs.exp
index 8433e16340ad..dc4f4ce2db9d 100644
--- a/gdb/testsuite/gdb.threads/multiple-step-overs.exp
+++ b/gdb/testsuite/gdb.threads/multiple-step-overs.exp
@@ -101,7 +101,7 @@ foreach displaced { "off" "on" } {
# Switch back to thread 1, and continue.
gdb_test "thread 1" "Switching.*" "switch back to thread 1"
- gdb_breakpoint "sigusr1_handler" "set break at sigusr1_handler"
+ gdb_breakpoint "sigusr1_handler"
set msg "continue to sigusr1_handler"
gdb_test_multiple "continue" $msg {
diff --git a/gdb/testsuite/gdb.threads/thread-bp-deleted.exp b/gdb/testsuite/gdb.threads/thread-bp-deleted.exp
index 037e8288b62f..84e464f75528 100644
--- a/gdb/testsuite/gdb.threads/thread-bp-deleted.exp
+++ b/gdb/testsuite/gdb.threads/thread-bp-deleted.exp
@@ -96,8 +96,7 @@ proc check_for_thread_specific_breakpoint { testname bpnum expected } {
# Create a thread-specific breakpoint. This will never actually be hit; we
# don't care, we just want to see GDB auto-delete this breakpoint.
-gdb_breakpoint "main thread $worker_thread" \
- "create a thread-specific breakpoint"
+gdb_breakpoint "main thread $worker_thread"
set bpnum [get_integer_valueof "\$bpnum" "INVALID" \
"get number for thread-specific breakpoint"]
--
2.54.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/7] gdb/testsuite: make gdb_breakpoint, runto and runto_main use parse_args
2026-05-06 20:27 [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board simon.marchi
2026-05-06 20:27 ` [PATCH 1/7] gdb/testsuite: remove unused arguments to gdb_breakpoint simon.marchi
@ 2026-05-06 20:27 ` simon.marchi
2026-05-06 20:27 ` [PATCH 3/7] gdb/testsuite: add -inferior-args option to runto simon.marchi
` (5 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: simon.marchi @ 2026-05-06 20:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
From: Simon Marchi <simon.marchi@polymtl.ca>
In preparation to adding an option with argument to runto, change these
procs to use parse_args to manage their args (variable arguments).
These three procs have to be converted at the same time, because they
pass args to each other.
I would have like to allow passing options mixed with non-option
arguments, to allow:
gdb_breakpoint -qualified the_function
But that would be a larger and more difficult change, so we'll have to
stick having options after, like this:
gdb_breakpoint the_function -qualified
Change all callers that do use options to add the leading dash.
This patch removes the "last one wins" aspect of the message/no-message
options in gdb_breakpoint and runto, but I don't think it's important.
I don't think there is actually a spot that passes both. I added some
checks in those procs to ensure that.
Change-Id: I1500c60c4b1705ad5cd982d9324b627900ce411b
---
gdb/testsuite/gdb.ada/break-label.exp | 2 +-
gdb/testsuite/gdb.ada/finish-var-size.exp | 2 +-
gdb/testsuite/gdb.ada/import.exp | 6 +-
gdb/testsuite/gdb.ada/length_cond.exp | 2 +-
gdb/testsuite/gdb.ada/non-ascii-utf-8.exp | 14 ++--
.../gdb.arch/aarch64-pseudo-unwind.exp | 4 +-
.../gdb.arch/amd64-pseudo-unwind.exp | 4 +-
.../gdb.arch/arc-analyze-prologue.exp | 6 +-
.../gdb.arch/arm-pseudo-unwind-legacy.exp | 4 +-
gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp | 4 +-
gdb/testsuite/gdb.arch/powerpc-htm-regs.exp | 4 +-
gdb/testsuite/gdb.base/annotate-symlink.exp | 2 +-
gdb/testsuite/gdb.base/attach.exp | 2 +-
gdb/testsuite/gdb.base/break-inline.exp | 2 +-
gdb/testsuite/gdb.base/break-interp.exp | 2 +-
.../gdb.base/condbreak-multi-context.exp | 14 ++--
gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 2 +-
gdb/testsuite/gdb.base/dlmopen.exp | 2 +-
gdb/testsuite/gdb.base/eh_return.exp | 2 +-
gdb/testsuite/gdb.base/foll-exec-mode.exp | 2 +-
gdb/testsuite/gdb.base/foll-vfork.exp | 2 +-
.../fork-no-detach-follow-child-dlopen.exp | 2 +-
gdb/testsuite/gdb.base/fullname.exp | 12 +--
gdb/testsuite/gdb.base/gdb-sigterm.exp | 2 +-
gdb/testsuite/gdb.base/gdb1250.exp | 2 +-
gdb/testsuite/gdb.base/infcall-failure-2.exp | 2 +-
.../gdb.base/infcall-nested-structs.exp.tcl | 2 +-
gdb/testsuite/gdb.base/inferior-args.exp | 6 +-
gdb/testsuite/gdb.base/info-shared.exp | 4 +-
gdb/testsuite/gdb.base/jit-reader.exp | 2 +-
gdb/testsuite/gdb.base/nostdlib.exp | 2 +-
gdb/testsuite/gdb.base/prologue.exp | 2 +-
.../gdb.base/run-attach-while-running.exp | 2 +-
gdb/testsuite/gdb.base/shlib-call.exp | 2 +-
.../gdb.base/solib-bad-entry-addr.exp | 2 +-
gdb/testsuite/gdb.base/solib-vanish.exp | 2 +-
gdb/testsuite/gdb.base/stale-infcall.exp | 2 +-
gdb/testsuite/gdb.base/sym-file.exp | 2 +-
gdb/testsuite/gdb.base/symlink-sourcefile.exp | 2 +-
gdb/testsuite/gdb.base/tls-dlobj.exp | 22 +++---
gdb/testsuite/gdb.base/unload.exp | 8 +-
gdb/testsuite/gdb.btrace/rn-dl-bind.exp | 2 +-
gdb/testsuite/gdb.cp/anon-ns.exp | 4 +-
.../gdb.cp/breakpoint-shlib-func.exp | 2 +-
gdb/testsuite/gdb.cp/meth-typedefs.exp | 4 +-
gdb/testsuite/gdb.cp/nextoverthrow.exp | 2 +-
gdb/testsuite/gdb.cp/paramless.exp | 2 +-
gdb/testsuite/gdb.cp/save-bp-qualified.exp | 2 +-
gdb/testsuite/gdb.cp/step-and-next-inline.exp | 2 +-
gdb/testsuite/gdb.cp/subtypes.exp | 6 +-
gdb/testsuite/gdb.cp/templates.exp | 16 ++--
.../gdb.debuginfod/fetch_src_and_symbols.exp | 2 +-
gdb/testsuite/gdb.dwarf2/ada-cold-name.exp | 4 +-
gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp | 8 +-
.../gdb.dwarf2/break-inline-psymtab.exp | 2 +-
.../gdb.dwarf2/dw2-main-no-line-number.exp | 2 +-
.../gdb.dwarf2/dw2-vendor-extended-opcode.exp | 2 +-
.../inlined_subroutine-inheritance.exp | 2 +-
.../locexpr-data-member-location.exp | 4 +-
gdb/testsuite/gdb.dwarf2/struct-decl.exp | 2 +-
gdb/testsuite/gdb.gdb/python-helper.exp | 4 +-
gdb/testsuite/gdb.go/methods.exp | 4 +-
gdb/testsuite/gdb.go/no-package.exp | 2 +-
gdb/testsuite/gdb.linespec/explicit.exp | 4 +-
gdb/testsuite/gdb.linespec/keywords.exp | 12 +--
gdb/testsuite/gdb.linespec/thread.exp | 2 +-
.../gdb.multi/inferior-specific-bp.exp | 2 +-
gdb/testsuite/gdb.multi/multi-kill.exp | 2 +-
.../gdb.multi/pending-bp-del-inferior.exp | 2 +-
gdb/testsuite/gdb.multi/pending-bp.exp | 16 ++--
gdb/testsuite/gdb.multi/watchpoint-multi.exp | 4 +-
gdb/testsuite/gdb.opt/inline-break.exp | 4 +-
gdb/testsuite/gdb.python/py-breakpoint.exp | 2 +-
gdb/testsuite/gdb.python/py-events.exp | 2 +-
.../gdb.python/py-finish-breakpoint.exp | 2 +-
.../gdb.reverse/finish-reverse-next.exp | 10 +--
.../gdb.reverse/func-map-to-same-line.exp | 4 +-
.../gdb.reverse/i386-avx-reverse.exp | 4 +-
.../gdb.rocm/fork-exec-gpu-to-non-gpu.exp | 4 +-
.../gdb.rocm/fork-exec-non-gpu-to-gpu.exp | 4 +-
gdb/testsuite/gdb.rocm/multi-inferior-gpu.exp | 2 +-
.../precise-memory-warning-watchpoint.exp | 2 +-
gdb/testsuite/gdb.rocm/precise-memory.exp | 2 +-
.../gdb.rocm/watchpoint-at-end-of-shader.exp | 2 +-
gdb/testsuite/gdb.rocm/watchpoint-basic.exp | 2 +-
gdb/testsuite/gdb.rust/modules.exp | 4 +-
.../gdb.threads/del-pending-thread-bp.exp | 2 +-
.../process-dies-while-detaching.exp | 4 +-
gdb/testsuite/gdb.trace/actions-changed.exp | 2 +-
gdb/testsuite/gdb.trace/backtrace.exp | 2 +-
gdb/testsuite/gdb.trace/circ.exp | 4 +-
gdb/testsuite/gdb.trace/collection.exp | 4 +-
.../gdb.trace/disconnected-tracing.exp | 4 +-
gdb/testsuite/gdb.trace/ftrace-lock.exp | 4 +-
gdb/testsuite/gdb.trace/ftrace.exp | 4 +-
gdb/testsuite/gdb.trace/infotrace.exp | 2 +-
gdb/testsuite/gdb.trace/packetlen.exp | 2 +-
gdb/testsuite/gdb.trace/passc-dyn.exp | 2 +-
gdb/testsuite/gdb.trace/qtro.exp | 2 +-
gdb/testsuite/gdb.trace/read-memory.exp | 2 +-
gdb/testsuite/gdb.trace/report.exp | 2 +-
gdb/testsuite/gdb.trace/signal.exp | 6 +-
gdb/testsuite/gdb.trace/status-stop.exp | 4 +-
gdb/testsuite/gdb.trace/strace.exp | 6 +-
gdb/testsuite/gdb.trace/tfind.exp | 2 +-
gdb/testsuite/gdb.trace/trace-break.exp | 26 +++----
gdb/testsuite/gdb.trace/trace-condition.exp | 4 +-
gdb/testsuite/gdb.trace/trace-mt.exp | 2 +-
gdb/testsuite/gdb.trace/tstatus.exp | 4 +-
gdb/testsuite/gdb.trace/tsv.exp | 2 +-
.../gdb.trace/unavailable-dwarf-piece.exp | 2 +-
gdb/testsuite/gdb.trace/unavailable.exp | 4 +-
gdb/testsuite/gdb.trace/while-dyn.exp | 2 +-
gdb/testsuite/lib/gdb.exp | 77 +++++++++++++------
gdb/testsuite/lib/selftest-support.exp | 2 +-
115 files changed, 278 insertions(+), 247 deletions(-)
diff --git a/gdb/testsuite/gdb.ada/break-label.exp b/gdb/testsuite/gdb.ada/break-label.exp
index b92a665ef862..dec083be1a66 100644
--- a/gdb/testsuite/gdb.ada/break-label.exp
+++ b/gdb/testsuite/gdb.ada/break-label.exp
@@ -26,5 +26,5 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} {
# Ada is case-insensitive, so both of these should work.
foreach_with_prefix name {break_here Break_Here} {
clean_restart ${testfile}
- runto "proc:$name" message
+ runto "proc:$name" -message
}
diff --git a/gdb/testsuite/gdb.ada/finish-var-size.exp b/gdb/testsuite/gdb.ada/finish-var-size.exp
index 51c056a91064..20e214c850ab 100644
--- a/gdb/testsuite/gdb.ada/finish-var-size.exp
+++ b/gdb/testsuite/gdb.ada/finish-var-size.exp
@@ -33,7 +33,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $opts] != ""} {
}
clean_restart ${testfile}
-runto "pck.get" temporary
+runto "pck.get" -temporary
set value [string_to_regexp "= (defined => true, payload => true)"]
diff --git a/gdb/testsuite/gdb.ada/import.exp b/gdb/testsuite/gdb.ada/import.exp
index 085eb2fbf995..50ad623add46 100644
--- a/gdb/testsuite/gdb.ada/import.exp
+++ b/gdb/testsuite/gdb.ada/import.exp
@@ -54,7 +54,7 @@ gdb_test "print pkg.imported_var_ada" " = 42"
gdb_test "print pkg.exported_var_ada" " = 99"
gdb_test "print exported_var_ada" " = 99"
-gdb_breakpoint "local_imported_func" message
+gdb_breakpoint "local_imported_func" -message
gdb_test "print copy" " = 42"
# This passes with gcc 10 but fails with gcc 9. With gcc 9, we have:
@@ -84,11 +84,11 @@ foreach func {"pkg.imported_func_ada" "imported_func"} {
if { [gnat_version_compare < 10] } {
setup_xfail *-*-*
}
- gdb_breakpoint $func message
+ gdb_breakpoint $func -message
}
foreach func {"imported_func_ada" "pkg.exported_func_ada" \
"exported_func_ada" "exported_func"} {
clean_restart $testfile
- gdb_breakpoint $func message
+ gdb_breakpoint $func -message
}
diff --git a/gdb/testsuite/gdb.ada/length_cond.exp b/gdb/testsuite/gdb.ada/length_cond.exp
index 5cf4fb8eabd9..2c62e9b0333f 100644
--- a/gdb/testsuite/gdb.ada/length_cond.exp
+++ b/gdb/testsuite/gdb.ada/length_cond.exp
@@ -29,7 +29,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != "" } {
clean_restart ${testfile}
set bp_location [gdb_get_line_number "BREAKPOINT" ${testdir}/length_cond.adb]
-gdb_breakpoint length_cond.adb:$bp_location message
+gdb_breakpoint length_cond.adb:$bp_location -message
# Resolving the conditional expression would cause a crash, so it's
# enough to just set the conditions.
diff --git a/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp b/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp
index 81c87afc410a..74b1762dc1b6 100644
--- a/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp
+++ b/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp
@@ -49,10 +49,10 @@ gdb_test "print var_𐐩" " = 25"
gdb_test "print VAR_Ż" " = 26"
gdb_test "print var_ż" " = 26"
-gdb_breakpoint "FUNC_Ü" message
-gdb_breakpoint "func_ü" message
-gdb_breakpoint "FUNC_Ƹ" message
-gdb_breakpoint "func_ƹ" message
-gdb_breakpoint "FUNC_Ż" message
-gdb_breakpoint "func_ż" message
-gdb_breakpoint "FUNC_𐐁" message
+gdb_breakpoint "FUNC_Ü" -message
+gdb_breakpoint "func_ü" -message
+gdb_breakpoint "FUNC_Ƹ" -message
+gdb_breakpoint "func_ƹ" -message
+gdb_breakpoint "FUNC_Ż" -message
+gdb_breakpoint "func_ż" -message
+gdb_breakpoint "FUNC_𐐁" -message
diff --git a/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp
index f2bf2236a9b1..99613d12830b 100644
--- a/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp
@@ -35,7 +35,7 @@ if {![runto_main]} {
return
}
-gdb_breakpoint break_here_asm temporary
+gdb_breakpoint break_here_asm -temporary
gdb_continue_to_breakpoint "continue to callee"
# Verify the value of x19/w19 in the inner frame (callee).
@@ -83,6 +83,6 @@ with_test_prefix "callee, after change in caller" {
# Verify that the value of the saved x19 we changed is correctly seen by the
# inferior.
-gdb_breakpoint break_here_c temporary
+gdb_breakpoint break_here_c -temporary
gdb_continue_to_breakpoint "continue to break_here_c"
gdb_test "p/x value" " = 0x44454647"
diff --git a/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp
index a50978d439eb..1df2b8960916 100644
--- a/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp
+++ b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp
@@ -38,7 +38,7 @@ if {![runto_main]} {
return
}
-gdb_breakpoint break_here_asm temporary
+gdb_breakpoint break_here_asm -temporary
gdb_continue_to_breakpoint "continue to callee"
# Verify the value of rbx/ebx in the inner frame (callee).
@@ -86,6 +86,6 @@ with_test_prefix "callee, after change in caller" {
# Verify that the value of the saved rbx we changed is correctly seen by the
# inferior.
-gdb_breakpoint break_here_c temporary
+gdb_breakpoint break_here_c -temporary
gdb_continue_to_breakpoint "continue to break_here_c"
gdb_test "p/x value" " = 0x1011121344454647"
diff --git a/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp b/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
index 01699016dd67..8669ea91e743 100644
--- a/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
+++ b/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
@@ -72,7 +72,7 @@ proc saved_regs_to_str { savedregs funcname } {
proc prologue_test {funcname {savedregs ""} {fp_offset ""} } {
global hex
- gdb_breakpoint $funcname temporary
+ gdb_breakpoint $funcname -temporary
gdb_continue_to_breakpoint $funcname
gdb_test "backtrace 10" \
"#0\[ \t\]*$hex in $funcname .*\r\n#1\[ \t\]*$hex in main.*" \
@@ -130,7 +130,7 @@ prologue_test "enter_s_all" { {r13 4} {r14 8} {r15 12} {r16 16} {r17 20} \
{gp 56} {fp 60} {blink 0} } 0
# Test more levels of backtrace.
-gdb_breakpoint nested_prologue_inner temporary
+gdb_breakpoint nested_prologue_inner -temporary
gdb_continue_to_breakpoint nested_prologue_inner
gdb_test "backtrace 10" \
"#0\[ \t\]*$hex in nested_prologue_inner .*\r\n#1\[ \t\]*$hex in nested_prologue_outer .*\r\n#2\[ \t\]*$hex in main.*" \
@@ -189,7 +189,7 @@ prologue_test "unstored_reg" { {r13 0} {r14 4} }
prologue_test "double_store" { {r14 0} }
# alloca() tests
-gdb_breakpoint alloca_inner temporary
+gdb_breakpoint alloca_inner -temporary
gdb_continue_to_breakpoint alloca_inner
gdb_test "backtrace 3" \
"#0\[ \t\]*$hex in alloca_inner .*\r\n#1\[ \t\]*$hex in alloca_outer .*\r\n#2\[ \t\]*$hex in main.*" \
diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp
index bdfe665ee70b..aad083895a15 100644
--- a/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp
+++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp
@@ -40,7 +40,7 @@ if {![runto_main]} {
return
}
-gdb_breakpoint break_here_asm temporary
+gdb_breakpoint break_here_asm -temporary
gdb_continue_to_breakpoint "continue to callee"
# Verify the value of s16 in the inner frame (callee).
@@ -81,6 +81,6 @@ with_test_prefix "callee, after change in caller" {
# Verify that the value of the saved s16 we changed is correctly seen by the
# inferior.
-gdb_breakpoint break_here_c temporary
+gdb_breakpoint break_here_c -temporary
gdb_continue_to_breakpoint "continue to break_here_c"
gdb_test "p/x value" " = 0x40000000"
diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp
index af637d639757..ebd4d9aa6c2f 100644
--- a/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp
+++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp
@@ -35,7 +35,7 @@ if {![runto_main]} {
return
}
-gdb_breakpoint break_here_asm temporary
+gdb_breakpoint break_here_asm -temporary
gdb_continue_to_breakpoint "continue to callee"
# Verify the value of d8/s16 in the inner frame (callee).
@@ -83,6 +83,6 @@ with_test_prefix "callee, after change in caller" {
# Verify that the value of the saved d8 we changed is correctly seen by the
# inferior.
-gdb_breakpoint break_here_c temporary
+gdb_breakpoint break_here_c -temporary
gdb_continue_to_breakpoint "continue to break_here_c"
gdb_test "p/x value" " = 0x1011121340000000"
diff --git a/gdb/testsuite/gdb.arch/powerpc-htm-regs.exp b/gdb/testsuite/gdb.arch/powerpc-htm-regs.exp
index 8716ce02224b..972b1f2337d1 100644
--- a/gdb/testsuite/gdb.arch/powerpc-htm-regs.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-htm-regs.exp
@@ -87,7 +87,7 @@ with_test_prefix "check htm support" {
# Displaced-stepping a tbegin. causes problems,
# so we make the breakpoint temporary.
- gdb_breakpoint [gdb_get_line_number "marker" "$gen_src"] temporary
+ gdb_breakpoint [gdb_get_line_number "marker" "$gen_src"] -temporary
gdb_run_cmd
@@ -134,7 +134,7 @@ if {[build_executable "compile" $binfile $srcfile {debug}] == -1} {
clean_restart $testfile
-gdb_breakpoint [gdb_get_line_number "first marker"] temporary
+gdb_breakpoint [gdb_get_line_number "first marker"] -temporary
gdb_run_cmd
diff --git a/gdb/testsuite/gdb.base/annotate-symlink.exp b/gdb/testsuite/gdb.base/annotate-symlink.exp
index acf4b540e804..12702e47c5a2 100644
--- a/gdb/testsuite/gdb.base/annotate-symlink.exp
+++ b/gdb/testsuite/gdb.base/annotate-symlink.exp
@@ -41,7 +41,7 @@ if {![runto_main]} {
return -1
}
-gdb_breakpoint func message
+gdb_breakpoint func -message
gdb_test_no_output "set annotate 1"
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index bffdfd9b1aa9..7757e8a3399f 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -320,7 +320,7 @@ proc_with_prefix do_attach_tests {} {
# Verify that the modification really happened.
- gdb_breakpoint [gdb_get_line_number "postloop"] temporary
+ gdb_breakpoint [gdb_get_line_number "postloop"] -temporary
gdb_continue_to_breakpoint "postloop" ".* postloop .*"
# Allow the test process to exit, to cleanup after ourselves.
diff --git a/gdb/testsuite/gdb.base/break-inline.exp b/gdb/testsuite/gdb.base/break-inline.exp
index 99f55f64f837..ae5e02797112 100644
--- a/gdb/testsuite/gdb.base/break-inline.exp
+++ b/gdb/testsuite/gdb.base/break-inline.exp
@@ -18,7 +18,7 @@ if { [prepare_for_testing "failed to prepare" "break-inline" {} {debug nowarning
return -1
}
-gdb_breakpoint "main" "temporary"
+gdb_breakpoint "main" -temporary
gdb_run_cmd
gdb_test "" "Temporary breakpoint.*foo\\(\\).*"
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index 2b9a66d9aa1c..fea58e55d522 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -133,7 +133,7 @@ proc reach_1 {func command displacement} {
# Breakpoint on _dl_debug_state can have problems due to its overlap
# with the existing internal breakpoint from GDB.
gdb_test_no_output "set stop-on-solib-events 1"
- } elseif {! [gdb_breakpoint $func allow-pending]} {
+ } elseif {! [gdb_breakpoint $func -allow-pending]} {
return
}
diff --git a/gdb/testsuite/gdb.base/condbreak-multi-context.exp b/gdb/testsuite/gdb.base/condbreak-multi-context.exp
index e351eb0e65b9..d85ec3eb5588 100644
--- a/gdb/testsuite/gdb.base/condbreak-multi-context.exp
+++ b/gdb/testsuite/gdb.base/condbreak-multi-context.exp
@@ -133,7 +133,7 @@ proc_with_prefix scenario_1 { start_before } {
clean_restart $::testfile
if { $start_before } {
- if {![runto_main temporary]} {
+ if {![runto_main -temporary]} {
return
}
}
@@ -168,7 +168,7 @@ proc_with_prefix scenario_1 { start_before } {
}
if { !$start_before } {
- if {![runto_main temporary no-delete-breakpoints]} {
+ if {![runto_main -temporary -no-delete-breakpoints]} {
return
}
}
@@ -245,7 +245,7 @@ proc_with_prefix scenario_2 { start_before } {
clean_restart $::testfile
if { $start_before } {
- if {![runto_main temporary]} {
+ if {![runto_main -temporary]} {
return
}
}
@@ -258,7 +258,7 @@ proc_with_prefix scenario_2 { start_before } {
}
if { !$start_before } {
- if {![runto_main temporary no-delete-breakpoints]} {
+ if {![runto_main -temporary -no-delete-breakpoints]} {
return
}
}
@@ -293,7 +293,7 @@ proc_with_prefix scenario_3 { start_before } {
clean_restart $::testfile
if { $start_before } {
- if {![runto_main temporary]} {
+ if {![runto_main -temporary]} {
return
}
}
@@ -348,7 +348,7 @@ proc_with_prefix scenario_3 { start_before } {
# Do not use runto_main, it deletes all breakpoints.
if { !$start_before } {
- if {![runto_main temporary no-delete-breakpoints]} {
+ if {![runto_main -temporary -no-delete-breakpoints]} {
return
}
}
@@ -370,7 +370,7 @@ proc_with_prefix scenario_4 { start_before } {
clean_restart $::testfile
if { $start_before } {
- if {![runto_main temporary]} {
+ if {![runto_main -temporary]} {
return
}
}
diff --git a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp
index e40bc213454b..25b98054053b 100644
--- a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp
+++ b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp
@@ -192,7 +192,7 @@ proc_with_prefix test_conv_vars {} {
gdb_test "print \$_linker_namespace" ".* = 0" \
"Still in the default namespace"
- gdb_breakpoint "inc" allow-pending
+ gdb_breakpoint "inc" -allow-pending
gdb_breakpoint [gdb_get_line_number "TAG: first dlclose"]
foreach_with_prefix dl {3 2 1} {
diff --git a/gdb/testsuite/gdb.base/dlmopen.exp b/gdb/testsuite/gdb.base/dlmopen.exp
index f3062e1122ba..edf2ab7fccf6 100644
--- a/gdb/testsuite/gdb.base/dlmopen.exp
+++ b/gdb/testsuite/gdb.base/dlmopen.exp
@@ -194,7 +194,7 @@ proc test_dlmopen_no_attach {} {
# Break in the to-be-loaded library and at the end of main.
delete_breakpoints
- gdb_breakpoint $::srcfile_lib:$::bp_inc allow-pending
+ gdb_breakpoint $::srcfile_lib:$::bp_inc -allow-pending
gdb_breakpoint $::srcfile:$::bp_main
test_dlmopen
diff --git a/gdb/testsuite/gdb.base/eh_return.exp b/gdb/testsuite/gdb.base/eh_return.exp
index 55cca9362d38..4cdd8e6b04e7 100644
--- a/gdb/testsuite/gdb.base/eh_return.exp
+++ b/gdb/testsuite/gdb.base/eh_return.exp
@@ -73,7 +73,7 @@ if { $address == -1 } {
clean_restart $testfile
-gdb_assert [gdb_breakpoint "*$address" no-message] "set breakpoint on address"
+gdb_assert [gdb_breakpoint "*$address" -no-message] "set breakpoint on address"
# The assert did not reproduce when running to main, and continuing to the
# breakpoint, so instead, run to the breakpoint.
diff --git a/gdb/testsuite/gdb.base/foll-exec-mode.exp b/gdb/testsuite/gdb.base/foll-exec-mode.exp
index c3f5390ca5c2..74317520645c 100644
--- a/gdb/testsuite/gdb.base/foll-exec-mode.exp
+++ b/gdb/testsuite/gdb.base/foll-exec-mode.exp
@@ -127,7 +127,7 @@ proc do_follow_exec_mode_tests { mode cmd infswitch } {
# past it.
#
if {$cmd == "continue"} {
- gdb_breakpoint "$execd_line" "allow-pending"
+ gdb_breakpoint "$execd_line" -allow-pending
}
# Execute past the exec call.
diff --git a/gdb/testsuite/gdb.base/foll-vfork.exp b/gdb/testsuite/gdb.base/foll-vfork.exp
index 1a387772c4cc..31283a75cc02 100644
--- a/gdb/testsuite/gdb.base/foll-vfork.exp
+++ b/gdb/testsuite/gdb.base/foll-vfork.exp
@@ -57,7 +57,7 @@ proc setup_gdb { binfile srcfile } {
return -code return
}
- gdb_breakpoint [gdb_get_line_number " VFORK " $srcfile] temporary
+ gdb_breakpoint [gdb_get_line_number " VFORK " $srcfile] -temporary
gdb_continue_to_breakpoint "at VFORK"
}
diff --git a/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp b/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp
index b3c240b8a8f3..3ae6ba87dad6 100644
--- a/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp
+++ b/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp
@@ -49,7 +49,7 @@ proc do_test {} {
gdb_test_no_output "set follow-fork-mode child"
gdb_test_no_output "set detach-on-fork off"
- runto "add" qualified allow-pending
+ runto "add" -qualified -allow-pending
# Since we have debug info in the shlib, we should have the file name available.
gdb_test "frame" "add \(.*\) at .*$::srcfile2:${::decimal}.*"
diff --git a/gdb/testsuite/gdb.base/fullname.exp b/gdb/testsuite/gdb.base/fullname.exp
index 8572eeaf5ab1..fd6c3fe6b630 100644
--- a/gdb/testsuite/gdb.base/fullname.exp
+++ b/gdb/testsuite/gdb.base/fullname.exp
@@ -48,7 +48,7 @@ set line [gdb_get_line_number "set breakpoint 1 here"]
clean_restart $testfile
set msg "set breakpoint by full path before loading symbols - built absolute"
-if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
+if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} -no-message] != 0 } {
pass $msg
} else {
fail $msg
@@ -58,7 +58,7 @@ gdb_test "break -q main" \
"Breakpoint.*at.*line.*" "set breakpoint at main - built absolute"
set msg "set breakpoint by full path after loading symbols - built absolute"
-if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
+if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} -no-message] != 0 } {
pass $msg
} else {
fail $msg
@@ -73,7 +73,7 @@ if { [gdb_compile [relative_filename [pwd] [build_standard_output_file tmp-${sr
clean_restart $testfile
set msg "set breakpoint by full path before loading symbols - built relative"
-if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
+if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} -no-message] != 0 } {
pass $msg
} else {
fail $msg
@@ -83,7 +83,7 @@ gdb_test "break -q main" \
"Breakpoint.*at.*line.*" "set breakpoint at main - built relative"
set msg "set breakpoint by full path after loading symbols - built relative"
-if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
+if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} -no-message] != 0 } {
pass $msg
} else {
fail $msg
@@ -102,7 +102,7 @@ with_cwd [standard_output_file {}] {
clean_restart $testfile
set msg "set breakpoint by full path before loading symbols - built other"
-if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
+if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} -no-message] != 0 } {
pass $msg
} else {
fail $msg
@@ -112,7 +112,7 @@ gdb_test "break -q main" \
"Breakpoint.*at.*line.*" "set breakpoint at main - built other"
set msg "set breakpoint by full path after loading symbols - built other"
-if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
+if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} -no-message] != 0 } {
pass $msg
} else {
fail $msg
diff --git a/gdb/testsuite/gdb.base/gdb-sigterm.exp b/gdb/testsuite/gdb.base/gdb-sigterm.exp
index ca3622d3462b..302dc745eae8 100644
--- a/gdb/testsuite/gdb.base/gdb-sigterm.exp
+++ b/gdb/testsuite/gdb.base/gdb-sigterm.exp
@@ -39,7 +39,7 @@ proc do_test { pass } {
}
gdb_breakpoint "${testfile}.c:[gdb_get_line_number "loop-line" ${testfile}.c]" \
- temporary
+ -temporary
gdb_test "continue" "Temporary breakpoint .* loop-line .*"
diff --git a/gdb/testsuite/gdb.base/gdb1250.exp b/gdb/testsuite/gdb.base/gdb1250.exp
index 15fb2780e0f6..83094a906a3e 100644
--- a/gdb/testsuite/gdb.base/gdb1250.exp
+++ b/gdb/testsuite/gdb.base/gdb1250.exp
@@ -28,7 +28,7 @@ if { [prepare_for_testing "prepare" $testfile $srcfile] != 0 } {
return
}
-if {![runto abort {allow-pending}]} {
+if {![runto abort -allow-pending]} {
return
}
diff --git a/gdb/testsuite/gdb.base/infcall-failure-2.exp b/gdb/testsuite/gdb.base/infcall-failure-2.exp
index e03b6be467a6..47fba196ccdc 100644
--- a/gdb/testsuite/gdb.base/infcall-failure-2.exp
+++ b/gdb/testsuite/gdb.base/infcall-failure-2.exp
@@ -23,7 +23,7 @@ if { ![runto_main] } {
return
}
-if { ![gdb_breakpoint "*0x1" message] } {
+if { ![gdb_breakpoint "*0x1" -message] } {
return
}
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
index b6aaa5855da1..b840766a7bb9 100644
--- a/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
+++ b/gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl
@@ -93,7 +93,7 @@ proc start_nested_structs_test { lang types } {
# Some targets only enable the FPU on first use, so ensure that we
# have used the FPU before we make calls from GDB to code that
# could use the FPU.
- gdb_breakpoint [gdb_get_line_number "Break Here"] temporary
+ gdb_breakpoint [gdb_get_line_number "Break Here"] -temporary
gdb_continue_to_breakpoint "breakpt" ".* Break Here\\. .*"
return 1
diff --git a/gdb/testsuite/gdb.base/inferior-args.exp b/gdb/testsuite/gdb.base/inferior-args.exp
index eacb93b292e7..e0d8b640ad13 100644
--- a/gdb/testsuite/gdb.base/inferior-args.exp
+++ b/gdb/testsuite/gdb.base/inferior-args.exp
@@ -76,7 +76,7 @@ proc do_test { method startup_with_shell inferior_args expected_results \
gdb_test "" "" "stop at first instruction"
# Put a breakpoint and continue until main.
- if { ![gdb_breakpoint "main" message] } {
+ if { ![gdb_breakpoint "main" -message] } {
fail "could not set breakpoint on main"
return -1
}
@@ -87,7 +87,7 @@ proc do_test { method startup_with_shell inferior_args expected_results \
}
} elseif { $method == "run" } {
- if { ![gdb_breakpoint "main" message] } {
+ if { ![gdb_breakpoint "main" -message] } {
fail "could not set breakpoint on main"
return -1
}
@@ -253,7 +253,7 @@ proc run_all_tests {} {
}
# Now place a breakpoint on main.
- if { ![gdb_breakpoint "main" message] } {
+ if { ![gdb_breakpoint "main" -message] } {
fail "could not set breakpoint on main"
continue
}
diff --git a/gdb/testsuite/gdb.base/info-shared.exp b/gdb/testsuite/gdb.base/info-shared.exp
index e792b4f98210..17fb0fc518cd 100644
--- a/gdb/testsuite/gdb.base/info-shared.exp
+++ b/gdb/testsuite/gdb.base/info-shared.exp
@@ -91,8 +91,8 @@ check_info_shared "info sharedlibrary #1" 0 0
# Set up breakpoints.
gdb_breakpoint "stop"
-gdb_breakpoint "foo" allow-pending
-gdb_breakpoint "bar" allow-pending
+gdb_breakpoint "foo" -allow-pending
+gdb_breakpoint "bar" -allow-pending
# Run to the first stop and check that only the first library is loaded.
gdb_continue_to_breakpoint "library load #1" "\\.?stop .*"
diff --git a/gdb/testsuite/gdb.base/jit-reader.exp b/gdb/testsuite/gdb.base/jit-reader.exp
index 26656549e31a..e82a87b0de58 100644
--- a/gdb/testsuite/gdb.base/jit-reader.exp
+++ b/gdb/testsuite/gdb.base/jit-reader.exp
@@ -302,7 +302,7 @@ proc jit_reader_test {} {
# Check that the DWARF unwinder does not crash in presence of
# JIT objfiles.
gdb_test "up"
- gdb_breakpoint "*function_add" temporary
+ gdb_breakpoint "*function_add" -temporary
gdb_test "cont" ".*Temporary breakpoint ${any} in jit_function_add .*"
gdb_test "bt" \
[multi_line \
diff --git a/gdb/testsuite/gdb.base/nostdlib.exp b/gdb/testsuite/gdb.base/nostdlib.exp
index 91a3de3fa235..8cbfc049ce9b 100644
--- a/gdb/testsuite/gdb.base/nostdlib.exp
+++ b/gdb/testsuite/gdb.base/nostdlib.exp
@@ -75,7 +75,7 @@ foreach_with_prefix pie { "nopie" "pie" } {
# Instead of trying to cater for all these possibilities in a controlled
# fashion, make the breakpoint temporary, ensuring that there will just be
# one stop.
- gdb_breakpoint "*_start" temporary
+ gdb_breakpoint "*_start" -temporary
gdb_run_cmd
diff --git a/gdb/testsuite/gdb.base/prologue.exp b/gdb/testsuite/gdb.base/prologue.exp
index cd7c1bf8e4a8..61334112afa6 100644
--- a/gdb/testsuite/gdb.base/prologue.exp
+++ b/gdb/testsuite/gdb.base/prologue.exp
@@ -29,7 +29,7 @@ if {![runto_main]} {
proc find_breakpoint_pc { sym } {
global decimal hex gdb_prompt
- if { [gdb_breakpoint $sym temporary] } {
+ if { [gdb_breakpoint $sym -temporary] } {
pass "setting breakpoint at $sym"
}
diff --git a/gdb/testsuite/gdb.base/run-attach-while-running.exp b/gdb/testsuite/gdb.base/run-attach-while-running.exp
index 6e3d039aa0cf..73154615b1a2 100644
--- a/gdb/testsuite/gdb.base/run-attach-while-running.exp
+++ b/gdb/testsuite/gdb.base/run-attach-while-running.exp
@@ -68,7 +68,7 @@ proc_with_prefix test { non-stop threaded run-or-attach } {
return
}
- gdb_breakpoint "all_started" "temporary"
+ gdb_breakpoint "all_started" -temporary
gdb_continue_to_breakpoint "continue to all_started"
# If all-stop, everything stopped when we hit the all_started
diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index bcee223874a2..1b2bc0dd5781 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -167,7 +167,7 @@ clean_restart $testfile
# PR's 16495, 18213
# test that we can re-set breakpoints in shared libraries
-gdb_breakpoint "shr1" "allow-pending"
+gdb_breakpoint "shr1" -allow-pending
set test "run to bp in shared library"
gdb_run_cmd
diff --git a/gdb/testsuite/gdb.base/solib-bad-entry-addr.exp b/gdb/testsuite/gdb.base/solib-bad-entry-addr.exp
index 39694bffe637..445b2f58fac1 100644
--- a/gdb/testsuite/gdb.base/solib-bad-entry-addr.exp
+++ b/gdb/testsuite/gdb.base/solib-bad-entry-addr.exp
@@ -94,6 +94,6 @@ if { $load_segment_count <= 2 } {
# then we will see an internal error once the inferior starts running.
clean_restart $testfile
-if {![runto_main message]} {
+if {![runto_main -message]} {
return 0
}
diff --git a/gdb/testsuite/gdb.base/solib-vanish.exp b/gdb/testsuite/gdb.base/solib-vanish.exp
index 152e41760a02..4d8a9658cee9 100644
--- a/gdb/testsuite/gdb.base/solib-vanish.exp
+++ b/gdb/testsuite/gdb.base/solib-vanish.exp
@@ -104,7 +104,7 @@ delete_breakpoints
set lib2_lineno [gdb_get_line_number "break here" ${srcfile_lib2}]
-gdb_breakpoint "${lib2name}.c:${lib2_lineno}" {allow-pending}
+gdb_breakpoint "${lib2name}.c:${lib2_lineno}" -allow-pending
# Verify that both the location and source code are displayed
gdb_continue_to_breakpoint "bar" \
diff --git a/gdb/testsuite/gdb.base/stale-infcall.exp b/gdb/testsuite/gdb.base/stale-infcall.exp
index b602bea56cfc..0609aa31af31 100644
--- a/gdb/testsuite/gdb.base/stale-infcall.exp
+++ b/gdb/testsuite/gdb.base/stale-infcall.exp
@@ -23,7 +23,7 @@ if {![runto_main]} {
return -1
}
-gdb_breakpoint [gdb_get_line_number "test-next"] temporary
+gdb_breakpoint [gdb_get_line_number "test-next"] -temporary
gdb_continue_to_breakpoint "test-next" ".* test-next .*"
gdb_breakpoint [gdb_get_line_number "test-fail"]
gdb_test_no_output {set $test_fail_bpnum=$bpnum}
diff --git a/gdb/testsuite/gdb.base/sym-file.exp b/gdb/testsuite/gdb.base/sym-file.exp
index fe7b5ad13fa0..19beaa7a0627 100644
--- a/gdb/testsuite/gdb.base/sym-file.exp
+++ b/gdb/testsuite/gdb.base/sym-file.exp
@@ -83,7 +83,7 @@ proc do_test { remove_expr } {
gdb_continue_to_breakpoint gdb_add_symbol_file
# 2) Set a pending breakpoint at bar in $srcfile3.
- set result [gdb_breakpoint bar allow-pending]
+ set result [gdb_breakpoint bar -allow-pending]
if {!$result} {
return
}
diff --git a/gdb/testsuite/gdb.base/symlink-sourcefile.exp b/gdb/testsuite/gdb.base/symlink-sourcefile.exp
index 7870e16acc91..f87de00ecde8 100644
--- a/gdb/testsuite/gdb.base/symlink-sourcefile.exp
+++ b/gdb/testsuite/gdb.base/symlink-sourcefile.exp
@@ -40,5 +40,5 @@ if {![runto_main]} {
}
# Using a line number ensures that the default symtab is used.
-gdb_breakpoint [gdb_get_line_number "break here" $srcfile] message
+gdb_breakpoint [gdb_get_line_number "break here" $srcfile] -message
gdb_continue_to_breakpoint "run to breakpoint marker"
diff --git a/gdb/testsuite/gdb.base/tls-dlobj.exp b/gdb/testsuite/gdb.base/tls-dlobj.exp
index 2e1b50145413..60fe4649fbc8 100644
--- a/gdb/testsuite/gdb.base/tls-dlobj.exp
+++ b/gdb/testsuite/gdb.base/tls-dlobj.exp
@@ -57,7 +57,7 @@ proc gdb_test_with_xfail { cmd re cond} {
proc do_tests {force_internal_tls} {
clean_restart $::testfile
- if {![runto main temporary]} {
+ if {![runto main -temporary]} {
return
}
@@ -65,7 +65,7 @@ proc do_tests {force_internal_tls} {
gdb_test_no_output "maint set force-internal-tls-address-lookup on"
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-1"] temporary
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-1"] -temporary
gdb_continue_to_breakpoint "main-breakpoint-1"
with_test_prefix "before assignments" {
@@ -100,7 +100,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-2"] temporary
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-2"] -temporary
gdb_continue_to_breakpoint "main-breakpoint-2"
with_test_prefix "at main-breakpoint-2" {
@@ -117,7 +117,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-3"] temporary
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-3"] -temporary
gdb_continue_to_breakpoint "main-breakpoint-3"
# At this point lib2 and lib3 have been unloaded. Also, TLS vars
@@ -137,7 +137,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-4"] temporary
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-4"] -temporary
gdb_continue_to_breakpoint "main-breakpoint-4"
# lib3 has been loaded again; lib2 is the only one not loaded.
@@ -157,7 +157,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-5"] temporary
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-5"] -temporary
gdb_continue_to_breakpoint "main-breakpoint-5"
# lib2 and lib3 are loaded; lib1 and lib4 are not.
@@ -177,7 +177,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-6"] temporary
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-6"] -temporary
gdb_continue_to_breakpoint "main-breakpoint-6"
# lib1, lib3 and lib4 are loaded; lib2 is not loaded.
@@ -197,7 +197,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-7"] temporary
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-7"] -temporary
gdb_continue_to_breakpoint "main-breakpoint-7"
# lib2 and lib3 are loaded; lib1 and lib4 are not.
@@ -217,7 +217,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-8"] temporary
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-8"] -temporary
gdb_continue_to_breakpoint "main-breakpoint-8"
# lib1, lib2, lib3, and lib4 are all loaded.
@@ -236,7 +236,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-9"] temporary
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-9"] -temporary
gdb_continue_to_breakpoint "main-breakpoint-9"
# lib2 is loaded; lib1, lib3, and lib4 are not.
@@ -255,7 +255,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-10"] temporary
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-10"] -temporary
gdb_continue_to_breakpoint "main-breakpoint-10"
# lib3 and lib4 are loaded; lib1 and lib2 are not.
diff --git a/gdb/testsuite/gdb.base/unload.exp b/gdb/testsuite/gdb.base/unload.exp
index bdfcc6724989..e9751023906a 100644
--- a/gdb/testsuite/gdb.base/unload.exp
+++ b/gdb/testsuite/gdb.base/unload.exp
@@ -63,8 +63,8 @@ gdb_load_shlib $lib_sl2
# manually loaded and unloaded
#
-gdb_breakpoint "shrfunc1" allow-pending
-gdb_breakpoint "shrfunc2" allow-pending
+gdb_breakpoint "shrfunc1" -allow-pending
+gdb_breakpoint "shrfunc2" -allow-pending
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What\r?
@@ -85,7 +85,7 @@ gdb_test "info break" \
2\[\t \]+breakpoint keep y *<PENDING> *shrfunc2.*" \
"pending breakpoint info on first run at shrfunc1"
-gdb_breakpoint "$testfile.c:[gdb_get_line_number "y-set-1" $testfile.c]" temporary
+gdb_breakpoint "$testfile.c:[gdb_get_line_number "y-set-1" $testfile.c]" -temporary
gdb_test "continue" \
"Continuing.*warning: Temporarily disabling breakpoints for.*${lib_syms}.*y-set-1.*" \
@@ -108,7 +108,7 @@ gdb_test "info break" \
2\[\t \]+breakpoint keep y *<PENDING> *shrfunc2.*" \
"pending breakpoint info on second run at shrfunc1"
-gdb_breakpoint "$testfile.c:[gdb_get_line_number "y-set-1" $testfile.c]" temporary
+gdb_breakpoint "$testfile.c:[gdb_get_line_number "y-set-1" $testfile.c]" -temporary
gdb_test "continue" \
"Continuing.*warning: Temporarily disabling breakpoints for.*${lib_syms}.*y-set-1.*" \
diff --git a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
index 58d40f6f732d..e72107df4c33 100644
--- a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
+++ b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
@@ -53,7 +53,7 @@ with_test_prefix "main" {
# debug information we may stop at the closing brace or at the return.
#
# instead, run to test
-gdb_breakpoint test {temporary}
+gdb_breakpoint test -temporary
gdb_test "reverse-continue" ".*test\.1.*"
with_test_prefix "test" {
diff --git a/gdb/testsuite/gdb.cp/anon-ns.exp b/gdb/testsuite/gdb.cp/anon-ns.exp
index 99f949cfc96c..4e6556c70368 100644
--- a/gdb/testsuite/gdb.cp/anon-ns.exp
+++ b/gdb/testsuite/gdb.cp/anon-ns.exp
@@ -55,9 +55,9 @@ foreach test $methods {
gdb_test "list $test" $result
gdb_test "list '$test'" $result
- gdb_assert { [gdb_breakpoint $test no-message] } \
+ gdb_assert { [gdb_breakpoint $test -no-message] } \
"break $test, unquoted"
- gdb_assert { [gdb_breakpoint '$test' no-message] } \
+ gdb_assert { [gdb_breakpoint '$test' -no-message] } \
"break $test, single-quoted"
}
diff --git a/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp b/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp
index aaa2a531c819..217d7d915705 100644
--- a/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp
+++ b/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp
@@ -48,7 +48,7 @@ gdb_test "break foo" "Breakpoint $decimal at $hex"
gdb_test "info breakpoints" "<foo\\(\\)@plt>"
# Runto main, but don't delete all the breakpoints.
-if {![runto_main no-delete-breakpoints]} {
+if {![runto_main -no-delete-breakpoints]} {
return -1
}
diff --git a/gdb/testsuite/gdb.cp/meth-typedefs.exp b/gdb/testsuite/gdb.cp/meth-typedefs.exp
index 898bdd499e76..201e7293d396 100644
--- a/gdb/testsuite/gdb.cp/meth-typedefs.exp
+++ b/gdb/testsuite/gdb.cp/meth-typedefs.exp
@@ -152,9 +152,9 @@ foreach test $methods {
gdb_test "list -qualified $func" $result
gdb_test "list -qualified '$func'" $result
- gdb_assert { [gdb_breakpoint "-qualified $func" no-message] } \
+ gdb_assert { [gdb_breakpoint "-qualified $func" -no-message] } \
"break -qualified $func, unquoted"
- gdb_assert { [gdb_breakpoint "-qualified '$func'" no-message] } \
+ gdb_assert { [gdb_breakpoint "-qualified '$func'" -no-message] } \
"break -qualified $func, single-quoted"
}
diff --git a/gdb/testsuite/gdb.cp/nextoverthrow.exp b/gdb/testsuite/gdb.cp/nextoverthrow.exp
index 2f34795d201b..9b55d34c95d9 100644
--- a/gdb/testsuite/gdb.cp/nextoverthrow.exp
+++ b/gdb/testsuite/gdb.cp/nextoverthrow.exp
@@ -37,7 +37,7 @@ proc tbreak_and_cont {text} {
global testfile
set line [gdb_get_line_number $text $testfile.cc]
- gdb_breakpoint "$testfile.cc:$line" temporary
+ gdb_breakpoint "$testfile.cc:$line" -temporary
gdb_test "continue" "Temporary breakpoint.*" "continuing to $text"
}
diff --git a/gdb/testsuite/gdb.cp/paramless.exp b/gdb/testsuite/gdb.cp/paramless.exp
index 65f4a461f6b7..7a3e1242a468 100644
--- a/gdb/testsuite/gdb.cp/paramless.exp
+++ b/gdb/testsuite/gdb.cp/paramless.exp
@@ -31,7 +31,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
}
foreach ordinary {"outer<int>::fn" "outer<char>::fn<short>" "toplev<char>"} {
- gdb_breakpoint $ordinary message
+ gdb_breakpoint $ordinary -message
clean_restart $testfile
}
diff --git a/gdb/testsuite/gdb.cp/save-bp-qualified.exp b/gdb/testsuite/gdb.cp/save-bp-qualified.exp
index a6ee09c6cdcb..6879f05fdf4e 100644
--- a/gdb/testsuite/gdb.cp/save-bp-qualified.exp
+++ b/gdb/testsuite/gdb.cp/save-bp-qualified.exp
@@ -41,7 +41,7 @@ with_test_prefix "save" {
return -1
}
- gdb_breakpoint "function" qualified
+ gdb_breakpoint "function" -qualified
gdb_breakpoint "function"
# Save the breakpoints into a file.
diff --git a/gdb/testsuite/gdb.cp/step-and-next-inline.exp b/gdb/testsuite/gdb.cp/step-and-next-inline.exp
index 08694a67afbf..856af7838bb4 100644
--- a/gdb/testsuite/gdb.cp/step-and-next-inline.exp
+++ b/gdb/testsuite/gdb.cp/step-and-next-inline.exp
@@ -74,7 +74,7 @@ proc do_test { use_header } {
clean_restart $executable
- if {![runto $main_location qualified]} {
+ if {![runto $main_location -qualified]} {
return
}
diff --git a/gdb/testsuite/gdb.cp/subtypes.exp b/gdb/testsuite/gdb.cp/subtypes.exp
index 31c8c2264928..c080ba88350b 100644
--- a/gdb/testsuite/gdb.cp/subtypes.exp
+++ b/gdb/testsuite/gdb.cp/subtypes.exp
@@ -70,14 +70,14 @@ foreach t { int char } {
}
}
-gdb_breakpoint "Outer::Inner::doit" message
+gdb_breakpoint "Outer::Inner::doit" -message
foreach s { Foo Bar Baz } {
- gdb_breakpoint "main::${s}::doit" message
+ gdb_breakpoint "main::${s}::doit" -message
}
foreach t { int char } {
foreach s { Foo Bar Baz } {
- gdb_breakpoint "foobar<$t>(int)::${s}::doit" message
+ gdb_breakpoint "foobar<$t>(int)::${s}::doit" -message
}
}
diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp
index 3531b231e5df..b705e08b463e 100644
--- a/gdb/testsuite/gdb.cp/templates.exp
+++ b/gdb/testsuite/gdb.cp/templates.exp
@@ -637,8 +637,8 @@ foreach t [list "int" "char" "Empty<int>"] {
gdb_test "break Foozle::fogey ($t)" "Breakpoint.*at.* \\(3 locations\\)"
gdb_test "break Foozle::fogey<$t>" "Breakpoint.*at.* \\(3 locations\\)"
foreach u [list "int" "char" "Empty<int>"] {
- gdb_breakpoint "Foozle<$t>::fogey<$u>" message
- gdb_assert { [gdb_breakpoint "Foozle<$t>::fogey<$u> ($u)" no-message] } \
+ gdb_breakpoint "Foozle<$t>::fogey<$u>" -message
+ gdb_assert { [gdb_breakpoint "Foozle<$t>::fogey<$u> ($u)" -no-message] } \
"break Foozle<$t>::fogey<$u> ($u), success"
}
}
@@ -660,19 +660,19 @@ gdb_test "break -source $srcfile -func operator<<" \
"Breakpoint.*at.* \\(2 locations\\)"
foreach t [list "Empty" "Foozle"] {
set tt "$t<int>"
- gdb_breakpoint "operator< <$tt>" message
- gdb_breakpoint "operator<< <$tt>" message
+ gdb_breakpoint "operator< <$tt>" -message
+ gdb_breakpoint "operator<< <$tt>" -message
# Try a specific instance, both with and without whitespace
# after the template-template parameter.
set loc "operator< <$tt> ($tt&, $tt&)"
- gdb_assert { [gdb_breakpoint $loc no-message] } "break $loc, success"
+ gdb_assert { [gdb_breakpoint $loc -no-message] } "break $loc, success"
set loc "operator< <$tt > ($tt&, $tt&)"
- gdb_assert { [gdb_breakpoint $loc no-message] } "break $loc, success"
+ gdb_assert { [gdb_breakpoint $loc -no-message] } "break $loc, success"
set loc "operator<< <$tt> ($tt&, $tt&)"
- gdb_assert { [gdb_breakpoint $loc no-message] } "break $loc, success"
+ gdb_assert { [gdb_breakpoint $loc -no-message] } "break $loc, success"
set loc "operator<< <$tt > ($tt&, $tt&)"
- gdb_assert { [gdb_breakpoint $loc no-message] } "break $loc, success"
+ gdb_assert { [gdb_breakpoint $loc -no-message] } "break $loc, success"
}
# Test that "-qualified" finds no matching locations.
diff --git a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
index eb1accc86d5e..6a79ceaa606f 100644
--- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
+++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
@@ -233,7 +233,7 @@ proc_with_prefix local_url { } {
gdb_breakpoint $lineno
# Run to main, but don't delete all breakpoints.
- if {![runto_main no-delete-breakpoints]} {
+ if {![runto_main -no-delete-breakpoints]} {
return
}
diff --git a/gdb/testsuite/gdb.dwarf2/ada-cold-name.exp b/gdb/testsuite/gdb.dwarf2/ada-cold-name.exp
index f4dc9acf4b1f..c069a0469095 100644
--- a/gdb/testsuite/gdb.dwarf2/ada-cold-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/ada-cold-name.exp
@@ -63,8 +63,8 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
}
gdb_test_no_output "set language ada"
-gdb_breakpoint "pck.xtra.function" message
-gdb_breakpoint "pck.xtra.function\[cold\]" message
+gdb_breakpoint "pck.xtra.function" -message
+gdb_breakpoint "pck.xtra.function\[cold\]" -message
gdb_test "complete break pck.xtra.function\[co" \
"break pck.xtra.function\\\[cold\\\]" \
"test completion of cold function"
diff --git a/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
index e50763109c48..9204b1af656a 100644
--- a/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
@@ -68,8 +68,8 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
with_test_prefix "first first" {
gdb_test_no_output "set language ada"
- gdb_breakpoint "<__gnat_namefirst>" message
- gdb_breakpoint "<__gnat_namesecond>" message
+ gdb_breakpoint "<__gnat_namefirst>" -message
+ gdb_breakpoint "<__gnat_namesecond>" -message
}
# Run the test again, but this time check the symbols in the other
@@ -80,6 +80,6 @@ clean_restart ${testfile}
with_test_prefix "second first" {
gdb_test_no_output "set language ada"
- gdb_breakpoint "<__gnat_namesecond>" message
- gdb_breakpoint "<__gnat_namefirst>" message
+ gdb_breakpoint "<__gnat_namesecond>" -message
+ gdb_breakpoint "<__gnat_namefirst>" -message
}
diff --git a/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp b/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp
index 45213468abb2..b1370582a18f 100644
--- a/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp
+++ b/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp
@@ -31,4 +31,4 @@ if { [skip_inline_frame_tests] } {
# Set a break-point in inline function bar, in a CU for which the partial
# symtab has not been expanded.
-gdb_breakpoint "bar" message
+gdb_breakpoint "bar" -message
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp b/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
index aaef7478f412..33e4fe323db6 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
@@ -53,5 +53,5 @@ if {![runto_main]} {
return -1
}
-set breakpoint_at_missing_lineno_set [gdb_breakpoint "1" no-message]
+set breakpoint_at_missing_lineno_set [gdb_breakpoint "1" -no-message]
gdb_assert { !$breakpoint_at_missing_lineno_set }
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
index d12b68311071..4d265f8b6840 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
@@ -71,4 +71,4 @@ if {![runto_main]} {
return -1
}
-gdb_breakpoint "$srcfile:27" message
+gdb_breakpoint "$srcfile:27" -message
diff --git a/gdb/testsuite/gdb.dwarf2/inlined_subroutine-inheritance.exp b/gdb/testsuite/gdb.dwarf2/inlined_subroutine-inheritance.exp
index 6a982acbdf6e..816f473cfbda 100644
--- a/gdb/testsuite/gdb.dwarf2/inlined_subroutine-inheritance.exp
+++ b/gdb/testsuite/gdb.dwarf2/inlined_subroutine-inheritance.exp
@@ -208,4 +208,4 @@ if {[prepare_for_testing "failed to prepare" $testfile \
# All we need to do is set a breakpoint, which causes the DWARF
# info to be read, to demonstrate the problem.
-gdb_breakpoint "bytes_repeat" message
+gdb_breakpoint "bytes_repeat" -message
diff --git a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
index 4305026089bf..e0d7ca8ca894 100644
--- a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
+++ b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
@@ -102,7 +102,7 @@ with_test_prefix "first session" {
gdb_load_shlib ${lib_so}
# Run to foo to make sure foo refers to the function, and not foo@PLT.
- if {![runto foo qualified]} {
+ if {![runto foo -qualified]} {
return
}
@@ -370,5 +370,5 @@ with_test_prefix "third session" {
# the same thing. It's at this step that an internal error would
# occur for PR28030. The "message" argument tells runto to turn on
# the printing of PASSes while runto is doing its job.
- runto "bar" message
+ runto "bar" -message
}
diff --git a/gdb/testsuite/gdb.dwarf2/struct-decl.exp b/gdb/testsuite/gdb.dwarf2/struct-decl.exp
index 789ecb36f9be..c6247799d4c0 100644
--- a/gdb/testsuite/gdb.dwarf2/struct-decl.exp
+++ b/gdb/testsuite/gdb.dwarf2/struct-decl.exp
@@ -69,4 +69,4 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \
return -1
}
-gdb_breakpoint "the_type::method" message
+gdb_breakpoint "the_type::method" -message
diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gdb/python-helper.exp
index b39f51de44fe..0030183968fc 100644
--- a/gdb/testsuite/gdb.gdb/python-helper.exp
+++ b/gdb/testsuite/gdb.gdb/python-helper.exp
@@ -66,8 +66,8 @@ proc test_python_helper {} {
# (a) is easy to reach by issuing a simple gdb command, and
# (b) is unlikely to be modified very often within gdb, and
# (c) has a parameter that is either a 'struct type *' or a 'struct value *'.
- gdb_breakpoint value_print qualified
- gdb_breakpoint c_print_type qualified
+ gdb_breakpoint value_print -qualified
+ gdb_breakpoint c_print_type -qualified
# With gdb build with -O2 -flto=auto and gcc 7.5.0, we can get the mangled
# names due to a problem in the debug info, so we work around this by less
diff --git a/gdb/testsuite/gdb.go/methods.exp b/gdb/testsuite/gdb.go/methods.exp
index b6caba424dcc..13db8d5773f4 100644
--- a/gdb/testsuite/gdb.go/methods.exp
+++ b/gdb/testsuite/gdb.go/methods.exp
@@ -72,7 +72,7 @@ if { $found_wrong_foo } {
# <6c46c> DW_AT_name : main.T.Foo
}
-if { [gdb_breakpoint ${bp_location1} message]} {
+if { [gdb_breakpoint ${bp_location1} -message]} {
gdb_test "cont" "Breakpoint .*, ${bp_location1}.*" \
"going to first breakpoint"
}
@@ -96,7 +96,7 @@ if { $found_wrong_bar == 1 } {
# diverge between gc and gccgo. So, we accept the main.T.Bar as valid.
}
-if { [gdb_breakpoint ${bp_location2} message] } {
+if { [gdb_breakpoint ${bp_location2} -message] } {
gdb_test "cont" "Breakpoint .*, ${bp_location2}.*" \
"going to second breakpoint"
}
diff --git a/gdb/testsuite/gdb.go/no-package.exp b/gdb/testsuite/gdb.go/no-package.exp
index aad011e55b02..28b9bab93b70 100644
--- a/gdb/testsuite/gdb.go/no-package.exp
+++ b/gdb/testsuite/gdb.go/no-package.exp
@@ -28,4 +28,4 @@ if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}]}
}
# The bug was that stopping in _start would crash.
-runto "*_start" message
+runto "*_start" -message
diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp
index faee27bab4a5..26f4b3b813b3 100644
--- a/gdb/testsuite/gdb.linespec/explicit.exp
+++ b/gdb/testsuite/gdb.linespec/explicit.exp
@@ -580,7 +580,7 @@ namespace eval $testfile {
set tst "pending invalid conditional explicit breakpoint"
if {![gdb_breakpoint "-func myfunction if foofoofoo == 1" \
- allow-pending]} {
+ -allow-pending]} {
fail "set $tst"
} else {
gdb_test "info break" ".*PENDING.*myfunction\r\n\\s+stop only if foofoofoo == 1.*" $tst
@@ -597,7 +597,7 @@ namespace eval $testfile {
set tst "pending valid conditional explicit breakpoint"
if {![gdb_breakpoint "-func myfunction if arg == 0" \
- allow-pending]} {
+ -allow-pending]} {
fail "set $tst"
} else {
gdb_test "info break" \
diff --git a/gdb/testsuite/gdb.linespec/keywords.exp b/gdb/testsuite/gdb.linespec/keywords.exp
index 36069868f444..c6f6da53a966 100644
--- a/gdb/testsuite/gdb.linespec/keywords.exp
+++ b/gdb/testsuite/gdb.linespec/keywords.exp
@@ -32,16 +32,16 @@ gdb_test_no_output "set breakpoint pending off"
# The linespec lexer ignores the language setting when lexing
# keywords.
gdb_test "break if" "Function \"if\" not defined."
-gdb_breakpoint "thread" "message"
-gdb_breakpoint "task" "message"
+gdb_breakpoint "thread" -message
+gdb_breakpoint "task" -message
# The lexer should prune any trailing whitesapce, so the expected
# outcome of the following tests should be the same as the previous
# tests.
with_test_prefix "trailing whitespace" {
gdb_test "break if " "Function \"if\" not defined."
- gdb_breakpoint "thread " "message"
- gdb_breakpoint "task " "message"
+ gdb_breakpoint "thread " -message
+ gdb_breakpoint "task " -message
}
# With a single keyword specified first in the location,
@@ -56,7 +56,7 @@ gdb_test "break thread 123" "Unknown thread 123\\."
gdb_test "break thread foo" "Invalid thread ID: foo"
gdb_test "break task 123" "Unknown task 123\\."
gdb_test "break task foo" "Junk 'foo' after task keyword\\."
-gdb_breakpoint "thread if 0" "message"
+gdb_breakpoint "thread if 0" -message
# These are also NULL locations, but using a subsequent keyword
# as the "junk".
@@ -86,7 +86,7 @@ foreach prefix {"" "thread 1 "} {
"You can specify only one thread\\."
} else {
gdb_breakpoint "main ${prefix}-force-condition${suffix}${cond}"\
- "message"
+ -message
}
}
}
diff --git a/gdb/testsuite/gdb.linespec/thread.exp b/gdb/testsuite/gdb.linespec/thread.exp
index 30a21e8fe2fd..e7c4e3d954ef 100644
--- a/gdb/testsuite/gdb.linespec/thread.exp
+++ b/gdb/testsuite/gdb.linespec/thread.exp
@@ -35,6 +35,6 @@ gdb_test "break $srcfile:$bp_location1" \
gdb_continue_to_breakpoint "$bp_location1"
-gdb_breakpoint "thread" "message"
+gdb_breakpoint "thread" -message
gdb_continue_to_breakpoint "thread function"
diff --git a/gdb/testsuite/gdb.multi/inferior-specific-bp.exp b/gdb/testsuite/gdb.multi/inferior-specific-bp.exp
index f6e7e970f89a..fc756a832522 100644
--- a/gdb/testsuite/gdb.multi/inferior-specific-bp.exp
+++ b/gdb/testsuite/gdb.multi/inferior-specific-bp.exp
@@ -187,7 +187,7 @@ check_info_breakpoints "first check for inferior specific breakpoint" \
$bp_number 2
# Create a multi-inferior breakpoint to stop at.
-gdb_breakpoint "stop_breakpt" message
+gdb_breakpoint "stop_breakpt" -message
set stop_bp_num [get_integer_valueof "\$bpnum" "INVALID" \
"get b/p number for stop_breakpt"]
diff --git a/gdb/testsuite/gdb.multi/multi-kill.exp b/gdb/testsuite/gdb.multi/multi-kill.exp
index 20d39adaae2c..6ed0230010d3 100644
--- a/gdb/testsuite/gdb.multi/multi-kill.exp
+++ b/gdb/testsuite/gdb.multi/multi-kill.exp
@@ -60,7 +60,7 @@ proc start_inferior {num} {
gdb_load $binfile
- gdb_breakpoint "initialized" {temporary}
+ gdb_breakpoint "initialized" -temporary
gdb_run_cmd
gdb_test "" ".*reakpoint .*, initialized .*${srcfile}.*" "run"
diff --git a/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp b/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp
index a78c04531b22..ff2bcc87ca70 100644
--- a/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp
+++ b/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp
@@ -107,7 +107,7 @@ proc do_bp_test { bp_type bp_pending } {
set bp_restriction "inferior 1"
}
- gdb_breakpoint "$bp_func $bp_restriction" allow-pending
+ gdb_breakpoint "$bp_func $bp_restriction" -allow-pending
set bp_number [get_integer_valueof "\$bpnum" "INVALID" \
"get b/p number for previous breakpoint"]
diff --git a/gdb/testsuite/gdb.multi/pending-bp.exp b/gdb/testsuite/gdb.multi/pending-bp.exp
index 6c75474fe574..808bd4c5d839 100644
--- a/gdb/testsuite/gdb.multi/pending-bp.exp
+++ b/gdb/testsuite/gdb.multi/pending-bp.exp
@@ -53,7 +53,7 @@ proc do_test_setup { inf_1_stop inf_2_stop } {
return false
}
- gdb_breakpoint [gdb_get_line_number ${inf_1_stop}] temporary
+ gdb_breakpoint [gdb_get_line_number ${inf_1_stop}] -temporary
gdb_continue_to_breakpoint "move inferior 1 into position"
gdb_test "add-inferior -exec ${::binfile}" \
@@ -64,7 +64,7 @@ proc do_test_setup { inf_1_stop inf_2_stop } {
return false
}
- gdb_breakpoint [gdb_get_line_number ${inf_2_stop}] temporary
+ gdb_breakpoint [gdb_get_line_number ${inf_2_stop}] -temporary
gdb_continue_to_breakpoint "move inferior 2 into position"
gdb_test_no_output "set breakpoint pending on"
@@ -125,7 +125,7 @@ proc_with_prefix test_no_inf_display {} {
# there will be no locations and the breakpoint will be created
# pending. Pass the 'allow-pending' flag so the gdb_breakpoint
# correctly expects the new breakpoint to be pending.
- gdb_breakpoint "foo" allow-pending
+ gdb_breakpoint "foo" -allow-pending
set bpnum [get_integer_valueof "\$bpnum" "*INVALID*" \
"get foo breakpoint number"]
@@ -138,7 +138,7 @@ proc_with_prefix test_no_inf_display {} {
# Now select inferior 1 and allow the inferior to run forward to the
# point where a breakpoint location for foo will have been created.
gdb_test "inferior 1" "Switching to inferior 1 .*"
- gdb_breakpoint [gdb_get_line_number "Break after open"] temporary
+ gdb_breakpoint [gdb_get_line_number "Break after open"] -temporary
gdb_continue_to_breakpoint \
"move inferior 1 until a location has been added"
@@ -151,7 +151,7 @@ proc_with_prefix test_no_inf_display {} {
# Continue inferior 1 until the shared library has been unloaded. The
# breakpoint on 'foo' will return to the pending state. We will need to
# 'continue' twice as the first time will hit the 'foo' breakpoint.
- gdb_breakpoint [gdb_get_line_number "Break after close"] temporary
+ gdb_breakpoint [gdb_get_line_number "Break after close"] -temporary
gdb_continue_to_breakpoint "hit the breakpoint in foo"
gdb_continue_to_breakpoint "after close library"
@@ -195,7 +195,7 @@ proc_with_prefix test_pending_toggle { } {
"\\s+breakpoint already hit 1 time"] \
"check thread-specific breakpoint is no longer pending"
- gdb_breakpoint [gdb_get_line_number "Break after close"] temporary
+ gdb_breakpoint [gdb_get_line_number "Break after close"] -temporary
gdb_continue_to_breakpoint "close library"
gdb_test "info breakpoints $bpnum" \
[multi_line \
@@ -264,7 +264,7 @@ proc_with_prefix py_test_toggle_thread {} {
"\\s+breakpoint already hit 1 time"] \
"check thread-specific breakpoint has returned to pending"
- gdb_breakpoint [gdb_get_line_number "Break after close"] temporary
+ gdb_breakpoint [gdb_get_line_number "Break after close"] -temporary
gdb_continue_to_breakpoint "stop after close in inferior 2" \
".* Break after close\\. .*"
@@ -315,7 +315,7 @@ proc_with_prefix py_test_clear_thread {} {
"\\s+breakpoint already hit 2 times"] \
"check for a location only in inferior 2"
- gdb_breakpoint [gdb_get_line_number "Break after close"] temporary
+ gdb_breakpoint [gdb_get_line_number "Break after close"] -temporary
gdb_continue_to_breakpoint "stop after close in inferior 1" \
".* Break after close\\. .*"
diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.exp b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
index ba10f93d6236..a68ece0bdbbe 100644
--- a/gdb/testsuite/gdb.multi/watchpoint-multi.exp
+++ b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
@@ -46,14 +46,14 @@ if {[support_displaced_stepping]} {
#gdb_test_no_output "maintenance set show-debug-regs on"
#gdb_test_no_output "set debug infrun 1"
-gdb_breakpoint main {temporary}
+gdb_breakpoint main -temporary
gdb_test "run" "Temporary breakpoint.* main .*" "start to main inferior 1"
gdb_test "add-inferior" "Added inferior 2 on connection .*" "add inferior 2"
gdb_test "inferior 2" "witching to inferior 2 .*" "switch to inferior 2, first time"
gdb_load $binfile
-gdb_breakpoint main {temporary}
+gdb_breakpoint main -temporary
gdb_test "run" "Temporary breakpoint.* main .*" "start to main inferior 2"
gdb_test "awatch c" \
diff --git a/gdb/testsuite/gdb.opt/inline-break.exp b/gdb/testsuite/gdb.opt/inline-break.exp
index f45f61a607b7..c794aa659b37 100644
--- a/gdb/testsuite/gdb.opt/inline-break.exp
+++ b/gdb/testsuite/gdb.opt/inline-break.exp
@@ -200,9 +200,9 @@ foreach_with_prefix cmd [list "break" "tbreak"] {
# Assemble flags to pass to gdb_breakpoint. Lame but this is just
# a test suite!
- set break_flags "message"
+ set break_flags "-message"
if {[string match $cmd "tbreak"]} {
- lappend break_flags "temporary"
+ lappend break_flags "-temporary"
}
# Insert breakpoints for all inline_func? and not_inline_func? and check
diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp
index 4215f3ca1de0..97812cb02bb5 100644
--- a/gdb/testsuite/gdb.python/py-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-breakpoint.exp
@@ -629,7 +629,7 @@ proc_with_prefix test_bkpt_address {} {
proc_with_prefix test_bkpt_pending {} {
delete_breakpoints
- gdb_breakpoint "nosuchfunction" allow-pending
+ gdb_breakpoint "nosuchfunction" -allow-pending
gdb_test "python print (gdb.breakpoints()\[0\].pending)" "True" \
"Check pending status of pending breakpoint"
}
diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp
index 1e0513b997bf..0ffe5a3c2adc 100644
--- a/gdb/testsuite/gdb.python/py-events.exp
+++ b/gdb/testsuite/gdb.python/py-events.exp
@@ -41,7 +41,7 @@ gdb_test_no_output "source ${pyfile}" "load python file"
gdb_test "test-objfile-events" "Object file events registered."
-gdb_breakpoint "main" {temporary}
+gdb_breakpoint "main" -temporary
gdb_test "run" ".*event type: new_objfile.*new objfile name.*" "new objfile notification"
diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
index eb0790523e82..9c7e2d6f4bcc 100644
--- a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
@@ -128,7 +128,7 @@ with_test_prefix "no debug symbol" {
}
gdb_test "print do_nothing" "no debug info.*" "ensure that shared lib has no debug info"
- gdb_breakpoint "do_nothing" {temporary}
+ gdb_breakpoint "do_nothing" -temporary
gdb_test "continue" "Temporary breakpoint .*in \\.?do_nothing.*" \
"continue to do_nothing"
diff --git a/gdb/testsuite/gdb.reverse/finish-reverse-next.exp b/gdb/testsuite/gdb.reverse/finish-reverse-next.exp
index 325282855c64..919056fbbe32 100644
--- a/gdb/testsuite/gdb.reverse/finish-reverse-next.exp
+++ b/gdb/testsuite/gdb.reverse/finish-reverse-next.exp
@@ -64,7 +64,7 @@ if {[supports_process_record]} {
# Set breakpoint at call to function1 in main.
set bp_LEP_test [gdb_get_line_number "CALL VIA LEP" $srcfile]
-gdb_breakpoint $srcfile:$bp_LEP_test temporary
+gdb_breakpoint $srcfile:$bp_LEP_test -temporary
# Continue to break point at function1 call in main.
gdb_continue_to_breakpoint \
@@ -93,7 +93,7 @@ gdb_test_no_output "record" "turn on process record for test2"
### TEST 2: reverse finish from the body of function1.
# Set breakpoint at call to function1 in main.
-gdb_breakpoint $srcfile:$bp_LEP_test temporary
+gdb_breakpoint $srcfile:$bp_LEP_test -temporary
# Continue to break point at function1 call in main.
gdb_continue_to_breakpoint \
@@ -124,7 +124,7 @@ gdb_test_no_output "record" "turn on process record for test3"
# Set breakpoint at call to funp in main.
set bp_GEP_test [gdb_get_line_number "CALL VIA GEP" $srcfile]
-gdb_breakpoint $srcfile:$bp_GEP_test temporary
+gdb_breakpoint $srcfile:$bp_GEP_test -temporary
# Continue to break point at funp call in main.
gdb_continue_to_breakpoint \
@@ -153,7 +153,7 @@ gdb_test_no_output "record" "turn on process record for test4"
# Set breakpoint at call to funp in main.
set bp_GEP_test [gdb_get_line_number "CALL VIA GEP" $srcfile]
-gdb_breakpoint $srcfile:$bp_GEP_test temporary
+gdb_breakpoint $srcfile:$bp_GEP_test -temporary
# Continue to break point at funp call in main.
gdb_continue_to_breakpoint \
@@ -184,7 +184,7 @@ gdb_test_no_output "record" "turn on process record for test5"
### TEST 5: reverse finish from the body of function 1 when calling using the
### alternate entrypoint (GEP).
-gdb_breakpoint $srcfile:$bp_GEP_test temporary
+gdb_breakpoint $srcfile:$bp_GEP_test -temporary
# Continue to break point at funp call.
gdb_continue_to_breakpoint \
diff --git a/gdb/testsuite/gdb.reverse/func-map-to-same-line.exp b/gdb/testsuite/gdb.reverse/func-map-to-same-line.exp
index dd36528eb3ef..d4b6ed26cc5d 100644
--- a/gdb/testsuite/gdb.reverse/func-map-to-same-line.exp
+++ b/gdb/testsuite/gdb.reverse/func-map-to-same-line.exp
@@ -46,7 +46,7 @@ proc run_tests {} {
# Set breakpoint at the line after the function calls.
set bp_start_reverse_test [gdb_get_line_number "START REVERSE TEST"]
- gdb_breakpoint $bp_start_reverse_test temporary
+ gdb_breakpoint $bp_start_reverse_test -temporary
# Continue to break point for reverse-next test.
# Command definition: reverse-next [count]
@@ -87,7 +87,7 @@ proc run_tests {} {
# Test 2, reverse-step command
# Set breakpoint at the line after the function calls.
- gdb_breakpoint $bp_start_reverse_test temporary
+ gdb_breakpoint $bp_start_reverse_test -temporary
# Continue to the start of the reverse-step test.
# Command definition: reverse-step [count]
diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
index bdb76733e959..1f52a930c721 100644
--- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp
@@ -105,8 +105,8 @@ proc test_one_memory {insn mem value {dynamic false} {prefix ""}} {
proc record_full_function {function} {
set end [gdb_get_line_number "end ${function}_test "]
set start [gdb_get_line_number "start ${function}_test"]
- gdb_breakpoint $start temporary
- gdb_breakpoint $end temporary
+ gdb_breakpoint $start -temporary
+ gdb_breakpoint $end -temporary
gdb_continue_to_breakpoint "start ${function}_test"
if {[supports_process_record]} {
diff --git a/gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu.exp b/gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu.exp
index d351555bfff5..aa85face8132 100644
--- a/gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu.exp
+++ b/gdb/testsuite/gdb.rocm/fork-exec-gpu-to-non-gpu.exp
@@ -65,7 +65,7 @@ proc do_test { detach-on-fork follow-fork-mode fork_func } {
gdb_test_no_output "set follow-fork-mode ${follow-fork-mode}"
if { ${follow-fork-mode} == "parent" } {
- runto break_here_execer allow-pending message
+ runto break_here_execer -allow-pending -message
gdb_continue_to_end "continue parent to end" "continue" 1
if { ${detach-on-fork} == "off" } {
@@ -73,7 +73,7 @@ proc do_test { detach-on-fork follow-fork-mode fork_func } {
gdb_continue_to_end "continue child to end" "continue" 1
}
} elseif { ${follow-fork-mode} == "child" } {
- runto break_here_execee allow-pending message
+ runto break_here_execee -allow-pending -message
gdb_continue_to_end "continue child to end" "continue" 1
if { ${detach-on-fork} == "off" } {
diff --git a/gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu.exp b/gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu.exp
index 57dfac9fcece..ca104e1cb07c 100644
--- a/gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu.exp
+++ b/gdb/testsuite/gdb.rocm/fork-exec-non-gpu-to-gpu.exp
@@ -62,7 +62,7 @@ proc do_test { detach-on-fork follow-fork-mode fork_func } {
gdb_test_no_output "set follow-fork-mode ${follow-fork-mode}"
if { ${follow-fork-mode} == "parent" } {
- runto break_here_execer allow-pending message
+ runto break_here_execer -allow-pending -message
gdb_continue_to_end "continue parent to end" "continue" 1
if { ${detach-on-fork} == "off" } {
@@ -70,7 +70,7 @@ proc do_test { detach-on-fork follow-fork-mode fork_func } {
gdb_continue_to_end "continue child to end" "continue" 1
}
} elseif { ${follow-fork-mode} == "child" } {
- runto break_here_execee allow-pending message
+ runto break_here_execee -allow-pending -message
gdb_continue_to_end "continue child to end" "continue" 1
if { ${detach-on-fork} == "off" } {
diff --git a/gdb/testsuite/gdb.rocm/multi-inferior-gpu.exp b/gdb/testsuite/gdb.rocm/multi-inferior-gpu.exp
index a978eb7cf95f..f632ca3bd852 100644
--- a/gdb/testsuite/gdb.rocm/multi-inferior-gpu.exp
+++ b/gdb/testsuite/gdb.rocm/multi-inferior-gpu.exp
@@ -36,7 +36,7 @@ proc do_test {} {
with_rocm_gpu_lock {
gdb_breakpoint [gdb_get_line_number "Break here"]
- gdb_breakpoint kern allow-pending
+ gdb_breakpoint kern -allow-pending
gdb_breakpoint [gdb_get_line_number "Last break here"]
# Run until we reach the first breakpoint where we can figure
diff --git a/gdb/testsuite/gdb.rocm/precise-memory-warning-watchpoint.exp b/gdb/testsuite/gdb.rocm/precise-memory-warning-watchpoint.exp
index 9f8dac68047b..15ab9a91e4ce 100644
--- a/gdb/testsuite/gdb.rocm/precise-memory-warning-watchpoint.exp
+++ b/gdb/testsuite/gdb.rocm/precise-memory-warning-watchpoint.exp
@@ -35,7 +35,7 @@ proc do_test { } {
gdb_load $::binfile
with_rocm_gpu_lock {
- if {![runto kernel allow-pending qualified]} {
+ if {![runto kernel -allow-pending -qualified]} {
fail "can't run to main"
return
}
diff --git a/gdb/testsuite/gdb.rocm/precise-memory.exp b/gdb/testsuite/gdb.rocm/precise-memory.exp
index 711060567643..fc6993e7d7b7 100644
--- a/gdb/testsuite/gdb.rocm/precise-memory.exp
+++ b/gdb/testsuite/gdb.rocm/precise-memory.exp
@@ -63,7 +63,7 @@ proc do_test { } {
# Get to the beginning of the GPU kernel without precise memory enabled.
with_test_prefix "goto gpu code" {
gdb_test_no_output "set amdgpu precise-memory off"
- gdb_breakpoint "kernel" allow-pending
+ gdb_breakpoint "kernel" -allow-pending
gdb_test "continue" "Thread ${::decimal}.* hit Breakpoint .*"
gdb_test_no_output "set amdgpu precise-memory on"
}
diff --git a/gdb/testsuite/gdb.rocm/watchpoint-at-end-of-shader.exp b/gdb/testsuite/gdb.rocm/watchpoint-at-end-of-shader.exp
index ff233c8b26a6..5874b09316f2 100644
--- a/gdb/testsuite/gdb.rocm/watchpoint-at-end-of-shader.exp
+++ b/gdb/testsuite/gdb.rocm/watchpoint-at-end-of-shader.exp
@@ -53,7 +53,7 @@ proc do_test {precise_memory has_xfail} {
gdb_load $::binfile
with_rocm_gpu_lock {
- if {![runto [gdb_get_line_number "Break here."] allow-pending]} {
+ if {![runto [gdb_get_line_number "Break here."] -allow-pending]} {
return
}
diff --git a/gdb/testsuite/gdb.rocm/watchpoint-basic.exp b/gdb/testsuite/gdb.rocm/watchpoint-basic.exp
index cd4b9c68f58a..8d19b0dcba2c 100644
--- a/gdb/testsuite/gdb.rocm/watchpoint-basic.exp
+++ b/gdb/testsuite/gdb.rocm/watchpoint-basic.exp
@@ -118,7 +118,7 @@ proc_with_prefix test_watchpoint_inside_kernel {} {
return
}
- gdb_breakpoint "kernel" allow-pending temporary
+ gdb_breakpoint "kernel" -allow-pending -temporary
gdb_test "continue" \
"hit Temporary breakpoint.*, kernel .*" \
"continue to kernel"
diff --git a/gdb/testsuite/gdb.rust/modules.exp b/gdb/testsuite/gdb.rust/modules.exp
index 4406b75b71b1..ab2957d63d3b 100644
--- a/gdb/testsuite/gdb.rust/modules.exp
+++ b/gdb/testsuite/gdb.rust/modules.exp
@@ -85,8 +85,8 @@ foreach mod {mod1::inner::innest mod1::inner mod1 {}} {
if {$mod != ""} {
append mod ::
}
- gdb_breakpoint modules::${mod}f2 message
- gdb_breakpoint "*::${mod}f2" message
+ gdb_breakpoint modules::${mod}f2 -message
+ gdb_breakpoint "*::${mod}f2" -message
}
gdb_test "print ::TWENTY_THREE" " = 23"
diff --git a/gdb/testsuite/gdb.threads/del-pending-thread-bp.exp b/gdb/testsuite/gdb.threads/del-pending-thread-bp.exp
index 1870adcde22a..0874c81cd372 100644
--- a/gdb/testsuite/gdb.threads/del-pending-thread-bp.exp
+++ b/gdb/testsuite/gdb.threads/del-pending-thread-bp.exp
@@ -56,7 +56,7 @@ gdb_continue_to_breakpoint "first breakpt call"
gdb_test "info threads" "\r\n\\s+2\\s+\[^\r\n\]+"
# Create a pending, thread-specific, breakpoint on 'foo'.
-gdb_breakpoint "foo thread 2" allow-pending
+gdb_breakpoint "foo thread 2" -allow-pending
set bpnum [get_integer_valueof "\$bpnum" "*INVALID*" \
"get breakpoint number"]
diff --git a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
index e394edf53ea7..edc15f25b064 100644
--- a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
+++ b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
@@ -127,7 +127,7 @@ proc detach_and_expect_exit {inf_output_re test} {
# Run to _exit in the child.
proc continue_to_exit_bp {} {
- gdb_breakpoint "_exit" temporary
+ gdb_breakpoint "_exit" -temporary
return [gdb_continue_to_breakpoint "_exit" ".*_exit.*"]
}
@@ -254,7 +254,7 @@ proc test_detach_watch {wp multi_process cmd} {
gdb_test_no_output "set detach-on-fork off"
gdb_test_no_output "set follow-fork-mode child"
- gdb_breakpoint "child_function" temporary
+ gdb_breakpoint "child_function" -temporary
gdb_continue_to_breakpoint "child_function" ".*"
}
diff --git a/gdb/testsuite/gdb.trace/actions-changed.exp b/gdb/testsuite/gdb.trace/actions-changed.exp
index 113f49779f6e..9dc2be66a77d 100644
--- a/gdb/testsuite/gdb.trace/actions-changed.exp
+++ b/gdb/testsuite/gdb.trace/actions-changed.exp
@@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
}
proc test_actions_changed { } {
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "trace subr" "Tracepoint .*" \
"tracepoint at subr"
diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp
index 2b995238f7ad..a046e38db034 100644
--- a/gdb/testsuite/gdb.trace/backtrace.exp
+++ b/gdb/testsuite/gdb.trace/backtrace.exp
@@ -146,7 +146,7 @@ gdb_trace_setactions "8.6: setup TP to collect stack mem cast expr" \
gdb_test_no_output "tstart" ""
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
diff --git a/gdb/testsuite/gdb.trace/circ.exp b/gdb/testsuite/gdb.trace/circ.exp
index d9ac46542005..e96000f2e247 100644
--- a/gdb/testsuite/gdb.trace/circ.exp
+++ b/gdb/testsuite/gdb.trace/circ.exp
@@ -66,7 +66,7 @@ proc run_trace_experiment { } {
global decimal
setup_tracepoints
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "tstart" "\[\r\n\]*" "start trace experiment"
gdb_test "continue" "Continuing.*Breakpoint ${::decimal}, end.*" \
"run to end"
@@ -187,7 +187,7 @@ set frame_size -1
with_test_prefix "frame size" {
set_a_tracepoint func0
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "tstart" "\[\r\n\]*" "start trace"
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
index 1b92f443e571..acec5624680d 100644
--- a/gdb/testsuite/gdb.trace/collection.exp
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -62,8 +62,8 @@ proc prepare_for_trace_test {} {
runto_main
- gdb_breakpoint "begin" qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "begin" -qualified
+ gdb_breakpoint "end" -qualified
}
proc run_trace_experiment { test_func } {
diff --git a/gdb/testsuite/gdb.trace/disconnected-tracing.exp b/gdb/testsuite/gdb.trace/disconnected-tracing.exp
index 729a9d3179a9..8202520b4821 100644
--- a/gdb/testsuite/gdb.trace/disconnected-tracing.exp
+++ b/gdb/testsuite/gdb.trace/disconnected-tracing.exp
@@ -60,7 +60,7 @@ proc disconnected_tracing { } {
gdb_test "trace start" ".*"
gdb_trace_setactions "collect on tracepoint 2" "2" \
"collect foo" "^$"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test_no_output "tstart"
@@ -122,7 +122,7 @@ proc disconnected_tfind { } {
gdb_test "trace start" ".*"
gdb_test_no_output "tstart"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*"
gdb_test_no_output "tstop"
diff --git a/gdb/testsuite/gdb.trace/ftrace-lock.exp b/gdb/testsuite/gdb.trace/ftrace-lock.exp
index 6ca3ceb57ad7..a05bb793aea8 100644
--- a/gdb/testsuite/gdb.trace/ftrace-lock.exp
+++ b/gdb/testsuite/gdb.trace/ftrace-lock.exp
@@ -68,8 +68,8 @@ if { [gdb_test "info sharedlibrary" ".*${remote_libipa}.*" "IPA loaded"] != 0 }
return 1
}
-gdb_breakpoint "end" qualified
-gdb_breakpoint "fail" qualified
+gdb_breakpoint "end" -qualified
+gdb_breakpoint "fail" -qualified
gdb_test "ftrace set_point" "Fast tracepoint .*" \
"fast tracepoint at a long insn"
diff --git a/gdb/testsuite/gdb.trace/ftrace.exp b/gdb/testsuite/gdb.trace/ftrace.exp
index bcc1c311b65b..3ceb6f88058c 100644
--- a/gdb/testsuite/gdb.trace/ftrace.exp
+++ b/gdb/testsuite/gdb.trace/ftrace.exp
@@ -107,9 +107,9 @@ proc test_fast_tracepoints {} {
set fourgood 0
- gdb_breakpoint "begin" qualified
+ gdb_breakpoint "begin" -qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "print gdb_agent_gdb_trampoline_buffer_error" ".*" ""
diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trace/infotrace.exp
index 90e75b817609..034411636dce 100644
--- a/gdb/testsuite/gdb.trace/infotrace.exp
+++ b/gdb/testsuite/gdb.trace/infotrace.exp
@@ -107,7 +107,7 @@ if {![gdb_target_supports_trace]} {
return 1
}
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test_no_output "tstart"
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
"continue to end"
diff --git a/gdb/testsuite/gdb.trace/packetlen.exp b/gdb/testsuite/gdb.trace/packetlen.exp
index 73b3a402a31d..ff9ae26fb891 100644
--- a/gdb/testsuite/gdb.trace/packetlen.exp
+++ b/gdb/testsuite/gdb.trace/packetlen.exp
@@ -58,7 +58,7 @@ gdb_trace_setactions "setup collect actions" \
"end" ""
gdb_test_no_output "tstart" "survive the long packet send"
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
diff --git a/gdb/testsuite/gdb.trace/passc-dyn.exp b/gdb/testsuite/gdb.trace/passc-dyn.exp
index b1270f3a4acc..32fa58166f07 100644
--- a/gdb/testsuite/gdb.trace/passc-dyn.exp
+++ b/gdb/testsuite/gdb.trace/passc-dyn.exp
@@ -82,7 +82,7 @@ gdb_test "passcount 3 $tdp4" "Setting tracepoint $tdp4's passcount to 3" \
gdb_test "tstart" ".*" ""
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
diff --git a/gdb/testsuite/gdb.trace/qtro.exp b/gdb/testsuite/gdb.trace/qtro.exp
index c4bf6ac981d9..ae6473839223 100644
--- a/gdb/testsuite/gdb.trace/qtro.exp
+++ b/gdb/testsuite/gdb.trace/qtro.exp
@@ -45,7 +45,7 @@ if {![gdb_target_supports_trace]} {
# frame (IOW, returns while tfind mode is active).
proc prepare_for_trace_disassembly { } {
global gdb_prompt
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "trace subr" "Tracepoint .*" \
"tracepoint at subr"
diff --git a/gdb/testsuite/gdb.trace/read-memory.exp b/gdb/testsuite/gdb.trace/read-memory.exp
index 352516cebe86..7d9b1c15d642 100644
--- a/gdb/testsuite/gdb.trace/read-memory.exp
+++ b/gdb/testsuite/gdb.trace/read-memory.exp
@@ -40,7 +40,7 @@ proc set_tracepoint_and_collect { } {
if {![runto_main]} {
return -1
}
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "trace start" "Tracepoint \[0-9\] at .*"
gdb_trace_setactions "set action for tracepoint" "" \
"collect testglob" "^$" \
diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp
index 5ddffad076fe..a2b58f30118e 100644
--- a/gdb/testsuite/gdb.trace/report.exp
+++ b/gdb/testsuite/gdb.trace/report.exp
@@ -154,7 +154,7 @@ gdb_trace_setactions "9.x: setup TP to collect expressions" \
gdb_test "tstart" ".*" ""
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
diff --git a/gdb/testsuite/gdb.trace/signal.exp b/gdb/testsuite/gdb.trace/signal.exp
index 1d9000d360dd..dd3958d7ffd2 100644
--- a/gdb/testsuite/gdb.trace/signal.exp
+++ b/gdb/testsuite/gdb.trace/signal.exp
@@ -66,7 +66,7 @@ if {![runto_main]} {
return -1
}
-gdb_breakpoint "kill" qualified
+gdb_breakpoint "kill" -qualified
gdb_test "handle SIGABRT nostop noprint pass" ".*" "pass SIGABRT"
# Hit the breakpoint on $syscall for the first time. In this time,
@@ -119,7 +119,7 @@ gdb_test_multiple $test $test {
}
delete_breakpoints
-gdb_breakpoint "start" qualified
+gdb_breakpoint "start" -qualified
gdb_continue_to_breakpoint "continue to start"
with_test_prefix "counter is zero" {
@@ -137,7 +137,7 @@ set tpnum [get_integer_valueof "\$bpnum" 0]
gdb_test "trace *$syscall_insn_next" "Tracepoint $decimal at .*" \
"tracepoint on instruction following syscall instruction"
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test_no_output "tstart"
gdb_test "continue" ".*Breakpoint.* end .*at.*$srcfile.*" \
diff --git a/gdb/testsuite/gdb.trace/status-stop.exp b/gdb/testsuite/gdb.trace/status-stop.exp
index 5206bf4dc5f0..e41ca4555aa6 100644
--- a/gdb/testsuite/gdb.trace/status-stop.exp
+++ b/gdb/testsuite/gdb.trace/status-stop.exp
@@ -50,7 +50,7 @@ proc test_tstart_tstop_tstart { } {
gdb_test_no_output "tstart" \
"first tstart"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
"continue to end"
@@ -107,7 +107,7 @@ proc test_buffer_full_tstart { } {
gdb_test_no_output "tstart" \
"first tstart"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end"
gdb_test "tstatus" ".*buffer was full.*"
diff --git a/gdb/testsuite/gdb.trace/strace.exp b/gdb/testsuite/gdb.trace/strace.exp
index b6fa8632bfe0..b596968ce7ff 100644
--- a/gdb/testsuite/gdb.trace/strace.exp
+++ b/gdb/testsuite/gdb.trace/strace.exp
@@ -178,7 +178,7 @@ proc strace_probe_marker { } {
gdb_test "info static-tracepoint-markers" \
"ust/bar\[\t \]+y\[\t \]+$hex .*ust/bar2\[\t \]+y\[\t \]+$hex.*"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test_no_output "tstart"
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
@@ -266,7 +266,7 @@ proc strace_trace_on_same_addr { type } {
}
}
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
if {[string equal $type "break"]} {
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
@@ -341,7 +341,7 @@ proc strace_trace_on_diff_addr { } {
gdb_test "trace *${marker_bar2_addr}" \
"Tracepoint ${::decimal} at ${hex}: file.*"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test_no_output "tstart"
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp
index 017e90c1411f..c008617834a7 100644
--- a/gdb/testsuite/gdb.trace/tfind.exp
+++ b/gdb/testsuite/gdb.trace/tfind.exp
@@ -123,7 +123,7 @@ if {$return_me == 1} {
# test tstatus (when trace on)
gdb_test "tstatus" "\[Tt\]race is running.*" "test tstatus on"
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
diff --git a/gdb/testsuite/gdb.trace/trace-break.exp b/gdb/testsuite/gdb.trace/trace-break.exp
index c5dd088ef741..27df24b70947 100644
--- a/gdb/testsuite/gdb.trace/trace-break.exp
+++ b/gdb/testsuite/gdb.trace/trace-break.exp
@@ -53,9 +53,9 @@ proc break_trace_same_addr_1 { trace_type option } \
gdb_test_no_output "set breakpoint always-inserted ${option}"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
- gdb_breakpoint "set_point" qualified
+ gdb_breakpoint "set_point" -qualified
gdb_test "${trace_type} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*"
gdb_test_no_output "tstart"
@@ -87,7 +87,7 @@ proc break_trace_same_addr_2 { trace_type1 trace_type2 option } \
gdb_test_no_output "set breakpoint always-inserted ${option}"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "${trace_type1} set_point" \
"\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
@@ -124,10 +124,10 @@ proc break_trace_same_addr_3 { trace_type option } \
}
gdb_test_no_output "set breakpoint always-inserted ${option}"
- gdb_breakpoint "marker" qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "marker" -qualified
+ gdb_breakpoint "end" -qualified
- gdb_breakpoint "set_point" qualified
+ gdb_breakpoint "set_point" -qualified
gdb_test "${trace_type} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*"
gdb_test_no_output "tstart"
@@ -161,10 +161,10 @@ proc break_trace_same_addr_4 { trace_type option } \
}
gdb_test_no_output "set breakpoint always-inserted ${option}"
- gdb_breakpoint "marker" qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "marker" -qualified
+ gdb_breakpoint "end" -qualified
- gdb_breakpoint "set_point" qualified
+ gdb_breakpoint "set_point" -qualified
gdb_test "${trace_type} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*"
gdb_test "continue" "Continuing\\.\[ \r\n\]+(Thread .* hit )?Breakpoint.*" \
@@ -203,8 +203,8 @@ proc break_trace_same_addr_5 { trace1 trace2 trace3 trace3_at_first_loc } \
return -1
}
- gdb_breakpoint "marker" qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "marker" -qualified
+ gdb_breakpoint "end" -qualified
gdb_test "${trace1} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
"${trace1} set_point 1"
@@ -276,8 +276,8 @@ proc break_trace_same_addr_6 { trace1 enable1 trace2 enable2 } \
return -1
}
- gdb_breakpoint "marker" qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "marker" -qualified
+ gdb_breakpoint "end" -qualified
gdb_test "continue" "Continuing\\.\[ \r\n\]+(Thread .* hit )?Breakpoint.*" \
"continue to marker"
diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp
index 55bea4439e77..7eb5df7ab7cf 100644
--- a/gdb/testsuite/gdb.trace/trace-condition.exp
+++ b/gdb/testsuite/gdb.trace/trace-condition.exp
@@ -73,9 +73,9 @@ proc test_tracepoints { trace_command condition num_frames { kfail_proc 0 } } {
return 0
}
- gdb_breakpoint "begin" qualified
+ gdb_breakpoint "begin" -qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
with_test_prefix "${trace_command}: ${condition}" {
diff --git a/gdb/testsuite/gdb.trace/trace-mt.exp b/gdb/testsuite/gdb.trace/trace-mt.exp
index 9315508f4f3a..90dd5284adc2 100644
--- a/gdb/testsuite/gdb.trace/trace-mt.exp
+++ b/gdb/testsuite/gdb.trace/trace-mt.exp
@@ -76,7 +76,7 @@ proc break_trace_same_addr { testfile trace_type option } \
gdb_test_no_output "set breakpoint always-inserted ${option}"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "break set_point1" "Breakpoint \[0-9\] at $hex: file.*"
gdb_test "${trace_type} set_point1" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*"
diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp
index 4ab6e2cbfc57..5f3fce8c9731 100644
--- a/gdb/testsuite/gdb.trace/tstatus.exp
+++ b/gdb/testsuite/gdb.trace/tstatus.exp
@@ -120,9 +120,9 @@ proc run_trace_experiment {} {
proc test_tracepoints {} {
global gdb_prompt
- gdb_breakpoint "begin" qualified
+ gdb_breakpoint "begin" -qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "trace gdb_c_test" "Tracepoint .*" \
"tracepoint at gdb_c_test"
diff --git a/gdb/testsuite/gdb.trace/tsv.exp b/gdb/testsuite/gdb.trace/tsv.exp
index 60f59f9ab89e..6947342bfda9 100644
--- a/gdb/testsuite/gdb.trace/tsv.exp
+++ b/gdb/testsuite/gdb.trace/tsv.exp
@@ -135,7 +135,7 @@ gdb_test "print \$tvar5" " = 15" \
"Print a trace state variable at start of run"
# Be sure not to fall off the end of the program.
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
diff --git a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
index 39b71b358775..1a118c920dac 100644
--- a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
+++ b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
@@ -303,7 +303,7 @@ if {![gdb_target_supports_trace]} {
return -1
}
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
with_test_prefix "tracing foo" {
gdb_test "trace *foo_start_lbl" ".*"
diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.trace/unavailable.exp
index 295b0b424674..3148da6d3f2c 100644
--- a/gdb/testsuite/gdb.trace/unavailable.exp
+++ b/gdb/testsuite/gdb.trace/unavailable.exp
@@ -59,8 +59,8 @@ proc prepare_for_trace_test {} {
runto_main
- gdb_breakpoint "begin" qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "begin" -qualified
+ gdb_breakpoint "end" -qualified
}
proc run_trace_experiment { test_func } {
diff --git a/gdb/testsuite/gdb.trace/while-dyn.exp b/gdb/testsuite/gdb.trace/while-dyn.exp
index eba431af4253..8b7472cfcf44 100644
--- a/gdb/testsuite/gdb.trace/while-dyn.exp
+++ b/gdb/testsuite/gdb.trace/while-dyn.exp
@@ -66,7 +66,7 @@ proc test_while_stepping { while_stepping } {
gdb_test "tstart" ".*"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 287090045707..601896457fea 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -696,44 +696,58 @@ proc gdb_starti_cmd { {inferior_args {}} } {
# Set a breakpoint using LINESPEC.
#
# If there is an additional argument it is a list of options; the supported
-# options are allow-pending, temporary, message, no-message and qualified.
+# options are -allow-pending, -temporary, -message, -no-message and -qualified.
#
# The result is 1 for success, 0 for failure.
#
# Note: The handling of message vs no-message is messed up, but it's based
# on historical usage. By default this function does not print passes,
# only fails.
-# no-message: turns off printing of fails (and passes, but they're already off)
-# message: turns on printing of passes (and fails, but they're already on)
+# -no-message: turns off printing of fails (and passes, but they're already off)
+# -message: turns on printing of passes (and fails, but they're already on)
proc gdb_breakpoint { linespec args } {
global gdb_prompt
global decimal
+ parse_args {
+ {allow-pending}
+ {temporary}
+ {qualified}
+ {message}
+ {no-message}
+ }
+
set pending_response n
- if {[lsearch -exact $args allow-pending] != -1} {
+
+ if {${allow-pending}} {
set pending_response y
}
set break_command "break"
set break_message "Breakpoint"
- if {[lsearch -exact $args temporary] != -1} {
+
+ if {$temporary} {
set break_command "tbreak"
set break_message "Temporary breakpoint"
}
- if {[lsearch -exact $args qualified] != -1} {
+ if {$qualified} {
append break_command " -qualified"
}
+ if {$message && ${no-message}} {
+ error "gdb_breakpoint: -message and -no-message are mutually exclusive"
+ }
+
set print_pass 0
set print_fail 1
- set no_message_loc [lsearch -exact $args no-message]
- set message_loc [lsearch -exact $args message]
- # The last one to appear in args wins.
- if { $no_message_loc > $message_loc } {
+
+ if {${no-message}} {
set print_fail 0
- } elseif { $message_loc > $no_message_loc } {
+ }
+
+ if {$message} {
set print_pass 1
}
@@ -775,12 +789,12 @@ proc gdb_breakpoint { linespec args } {
# single quoted C++ function specifier.
#
# If there are additional arguments, pass them to gdb_breakpoint.
-# We recognize no-message/message ourselves as well as no-delete-brekpoints.
+# We recognize -no-message/-message ourselves as well as -no-delete-breakpoints.
#
-# no-message is messed up here, like gdb_breakpoint: to preserve
+# -no-message is messed up here, like gdb_breakpoint: to preserve
# historical usage fails are always printed by default.
-# no-message: turns off printing of fails (and passes, but they're already off)
-# message: turns on printing of passes (and fails, but they're already on)
+# -no-message: turns off printing of fails (and passes, but they're already off)
+# -message: turns on printing of passes (and fails, but they're already on)
#
# The 'no-delete-brekpoints' option stops this proc from deleting all
# breakpoints.
@@ -790,24 +804,41 @@ proc runto { linespec args } {
global bkptno_numopt_re
global decimal
- if {[lsearch -exact $args no-delete-breakpoints] == -1} {
+ # Parse our own option only, forward the rest to gdb_breakpoint.
+ parse_some_args {
+ {no-delete-breakpoints}
+ {message}
+ {no-message}
+ }
+
+ if {!${no-delete-breakpoints}} {
delete_breakpoints
}
+ if {$message && ${no-message}} {
+ error "runto: -message and -no-message are mutually exclusive"
+ }
+
set print_pass 0
set print_fail 1
- set no_message_loc [lsearch -exact $args no-message]
- set message_loc [lsearch -exact $args message]
- # The last one to appear in args wins.
- if { $no_message_loc > $message_loc } {
+
+ # Re-insert -message or -no-message into the args we pass to gdb_breakpoint,
+ # since it uses them as well.
+ set gdb_breakpoint_args $args
+
+ if {${no-message}} {
set print_fail 0
- } elseif { $message_loc > $no_message_loc } {
+ lappend gdb_breakpoint_args -no-message
+ }
+
+ if {$message} {
set print_pass 1
+ lappend gdb_breakpoint_args -message
}
set test_name "runto: run to $linespec"
- if {![gdb_breakpoint $linespec {*}$args]} {
+ if {![gdb_breakpoint $linespec {*}$gdb_breakpoint_args]} {
return 0
}
@@ -873,7 +904,7 @@ proc runto { linespec args } {
# you don't want that then pass the 'no-delete-breakpoints' argument.
proc runto_main { args } {
- return [runto main qualified {*}$args]
+ return [runto main -qualified {*}$args]
}
### Continue, and expect to hit a breakpoint.
diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp
index ad31897737a4..8d402288c51b 100644
--- a/gdb/testsuite/lib/selftest-support.exp
+++ b/gdb/testsuite/lib/selftest-support.exp
@@ -142,7 +142,7 @@ proc _selftest_setup { } {
# Set a breakpoint at main
set function main
- if { [gdb_breakpoint $function "no-message"] != 1 } {
+ if { [gdb_breakpoint $function -no-message] != 1 } {
untested "Cannot set breakpoint at $function, skipping testcase."
return -2
}
--
2.54.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 3/7] gdb/testsuite: add -inferior-args option to runto
2026-05-06 20:27 [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board simon.marchi
2026-05-06 20:27 ` [PATCH 1/7] gdb/testsuite: remove unused arguments to gdb_breakpoint simon.marchi
2026-05-06 20:27 ` [PATCH 2/7] gdb/testsuite: make gdb_breakpoint, runto and runto_main use parse_args simon.marchi
@ 2026-05-06 20:27 ` simon.marchi
2026-05-12 13:02 ` Aktemur, Baris
2026-05-06 20:27 ` [PATCH 4/7] gdb/testsuite: fix step-over-thread-exit.exp with native-gdbserver simon.marchi
` (4 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: simon.marchi @ 2026-05-06 20:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
From: Simon Marchi <simon.marchi@polymtl.ca>
Add a new -inferior-args option to proc runto, to allow passing
arguments to the test program. Its value is forwarded to gdb_run_cmd,
which does the right thing, including with the native-gdbserver board,
where arguments need to be passed on the gdbserver command line.
The option is named -inferior-args (rather than the shorter -args)
because parse_args sets a variable in the caller's scope using the
option name. Naming it "-args" would clash with the "args" parameter.
Subsequent patches use this new option.
Change-Id: If2483c22302ed432ccd6cebef8d235e3e1d35bb8
---
gdb/testsuite/lib/gdb.exp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 601896457fea..60bcb582aeef 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -809,6 +809,7 @@ proc runto { linespec args } {
{no-delete-breakpoints}
{message}
{no-message}
+ {inferior-args ""}
}
if {!${no-delete-breakpoints}} {
@@ -842,7 +843,7 @@ proc runto { linespec args } {
return 0
}
- gdb_run_cmd
+ gdb_run_cmd ${inferior-args}
# the "at foo.c:36" output we get with -g.
# the "in func" output we get without -g.
--
2.54.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 4/7] gdb/testsuite: fix step-over-thread-exit.exp with native-gdbserver
2026-05-06 20:27 [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board simon.marchi
` (2 preceding siblings ...)
2026-05-06 20:27 ` [PATCH 3/7] gdb/testsuite: add -inferior-args option to runto simon.marchi
@ 2026-05-06 20:27 ` simon.marchi
2026-05-12 13:06 ` Aktemur, Baris
2026-05-06 20:27 ` [PATCH 5/7] gdb/testsuite: make pie-execl.exp work " simon.marchi
` (3 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: simon.marchi @ 2026-05-06 20:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi, Tankut Baris Aktemur
From: Simon Marchi <simon.marchi@polymtl.ca>
This test uses "set args N" to control how many threads the inferior
spawns: 1 in some cases and 100 in others. However, "set args" doesn't
work with the native-gdbserver board. As a result, with that board, the
inferior always uses its default of 100 threads. It sometimes causes
failures like:
p $_thread == 2
$1 = 1
(gdb) [New Thread 2790806.2790823 (id 3)]
Thread 3 "step-over-threa" hit Breakpoint 2, 0x00005555555552ab in my_exit_syscall () at /.../testsuite/lib/my-syscalls.S:85
85 SYSCALL (my_exit, __NR_exit)
FAIL: gdb.threads/step-over-thread-exit.exp: step_over_mode=inline: non-stop=on: target-non-stop=on: schedlock=off: cmd=next: ns_stop_all=0: selected thread didn't change (timeout)
Here, GDB steps over thread 2's exit. As soon as thread 2 exits, the
main thread spawns a new thread (thread 3), which hits the breakpoint
placed over the exit syscall, and that event gets reported
asynchronously, confusing the testsuite. The point of setting n_threads
to 1 is exactly to avoid things like that.
Fix it by passing the args via the new -inferior-args option, which
works correctly with the native-gdbserver board.
Change the test program to requiring the number of threads to be passed
as an argument, which would have caught this problem.
Change-Id: Ifc8856aa582706fd7207d0035d35dee749eb83a5
Reported-By: Tankut Baris Aktemur <Tankut.Aktemur@amd.com>
---
gdb/testsuite/gdb.threads/step-over-thread-exit.c | 15 ++++++++++-----
.../gdb.threads/step-over-thread-exit.exp | 8 ++------
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/gdb/testsuite/gdb.threads/step-over-thread-exit.c b/gdb/testsuite/gdb.threads/step-over-thread-exit.c
index 6cda1a4f1b0b..e52de2910a7a 100644
--- a/gdb/testsuite/gdb.threads/step-over-thread-exit.c
+++ b/gdb/testsuite/gdb.threads/step-over-thread-exit.c
@@ -31,16 +31,21 @@ thread_func (void *arg)
abort ();
}
-/* Number of threads we'll create. */
-int n_threads = 100;
-
int
main (int argc, char **argv)
{
int i;
- if (argc > 1)
- n_threads = atoi (argv[1]);
+ /* Number of threads we'll create. Set from argv[1]. */
+ int n_threads;
+
+ if (argc != 2)
+ {
+ fprintf (stderr, "Usage: %s N_THREADS\n", argv[0]);
+ return 1;
+ }
+
+ n_threads = atoi (argv[1]);
/* Spawn and join a thread, N_THREADS times. */
for (i = 0; i < n_threads; i++)
diff --git a/gdb/testsuite/gdb.threads/step-over-thread-exit.exp b/gdb/testsuite/gdb.threads/step-over-thread-exit.exp
index f398538058d4..aeca985dec0d 100644
--- a/gdb/testsuite/gdb.threads/step-over-thread-exit.exp
+++ b/gdb/testsuite/gdb.threads/step-over-thread-exit.exp
@@ -71,9 +71,7 @@ proc test {step_over_mode non-stop target-non-stop schedlock cmd ns_stop_all} {
if {$schedlock
|| (${non-stop} == "on" && $ns_stop_all)} {
- gdb_test_no_output "set args 1"
-
- if { ![runto my_exit_syscall] } {
+ if { ![runto my_exit_syscall -inferior-args 1] } {
return
}
@@ -148,9 +146,7 @@ proc test {step_over_mode non-stop target-non-stop schedlock cmd ns_stop_all} {
set n_threads 100
}
- gdb_test_no_output "set args $n_threads"
-
- if { ![runto_main] } {
+ if { ![runto_main -inferior-args $n_threads] } {
return
}
--
2.54.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 5/7] gdb/testsuite: make pie-execl.exp work with native-gdbserver
2026-05-06 20:27 [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board simon.marchi
` (3 preceding siblings ...)
2026-05-06 20:27 ` [PATCH 4/7] gdb/testsuite: fix step-over-thread-exit.exp with native-gdbserver simon.marchi
@ 2026-05-06 20:27 ` simon.marchi
2026-05-06 20:27 ` [PATCH 6/7] gdb/testsuite: use -inferior-args in gdb.base/gcore-buffer-overflow.exp simon.marchi
` (2 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: simon.marchi @ 2026-05-06 20:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
From: Simon Marchi <simon.marchi@polymtl.ca>
This test passes the path of an executable to execute as argv[1] to the
inferior. This test is currently skipped with remote targets (e.g.
native-gdbserver), because it previously wasn't possible to pass
arguments to inferiors on such targets in the testsuite. Remove that
check, and use the new -inferior-args runto option to pass the args to
the inferior.
Add
require {!target_info exists noargs}
to reflect that the test relies on inferior args.
Change-Id: If3b884421b453d6ca93c19ca13314bbb7869218c
---
gdb/testsuite/gdb.base/pie-execl.exp | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/gdb/testsuite/gdb.base/pie-execl.exp b/gdb/testsuite/gdb.base/pie-execl.exp
index 60d2270f8873..da75b47c23a4 100644
--- a/gdb/testsuite/gdb.base/pie-execl.exp
+++ b/gdb/testsuite/gdb.base/pie-execl.exp
@@ -20,21 +20,13 @@ global inferior_spawn_id
global gdb_spawn_id
require {istarget *-linux*}
-
-# In remote mode we cannot use the 'set args' command, and this
-# test requires it.
-if {[target_info exists gdb_protocol]} {
- if {[target_info gdb_protocol] == "remote"} {
- return
- }
-}
+require {!target_info exists noargs}
standard_testfile .c
set executable1 ${testfile}1
set executable2 ${testfile}2
set binfile1 ${binfile}1
set binfile2 ${binfile}2
-set binfile2_test_msg OBJDIR/${subdir}/${executable2}
# Use conditional compilation according to `BIN' as GDB remembers the source
# file name of the breakpoint.
@@ -47,9 +39,7 @@ if {[build_executable ${testfile}.exp $executable1 $srcfile [concat $opts {addit
clean_restart ${executable1}
-gdb_test_no_output "set args ${binfile2}" "set args ${binfile2_test_msg}"
-
-if {![runto_main]} {
+if {![runto_main -inferior-args $binfile2]} {
return -1
}
--
2.54.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 6/7] gdb/testsuite: use -inferior-args in gdb.base/gcore-buffer-overflow.exp
2026-05-06 20:27 [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board simon.marchi
` (4 preceding siblings ...)
2026-05-06 20:27 ` [PATCH 5/7] gdb/testsuite: make pie-execl.exp work " simon.marchi
@ 2026-05-06 20:27 ` simon.marchi
2026-05-06 20:27 ` [PATCH 7/7] gdb/testsuite: fix gdb.rocm/code-object-load-while-breakpoint-hit.exp with native-gdbserver simon.marchi
2026-05-12 13:18 ` [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board Aktemur, Baris
7 siblings, 0 replies; 16+ messages in thread
From: simon.marchi @ 2026-05-06 20:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
From: Simon Marchi <simon.marchi@polymtl.ca>
This test passes arguments to the inferior using "set args". This
doesn't work under the native-gdbserver board. It doesn't appear to
cause a failure though, because the test only verifies that a core dump
is successfully saved, which happens even if the test fails to pass the
argument to the test program.
Nevertheless, use the new -inferior-args option, that feels more
correct.
Change-Id: I8ef5b57d84b1b0c5b35d2636c4331a37bc159661
---
gdb/testsuite/gdb.base/gcore-buffer-overflow.exp | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
index 3dcc4f00d0a6..f922cc5a4a61 100644
--- a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
+++ b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
@@ -28,10 +28,7 @@ if { [prepare_for_testing "prepare" $filename $srcfile] != 0 } {
return
}
-gdb_test_no_output "set args ${pattern}" \
- "set buffer exceeding arguments"
-
-if {![runto_main]} {
+if {![runto_main -inferior-args $pattern]} {
return -1
}
--
2.54.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 7/7] gdb/testsuite: fix gdb.rocm/code-object-load-while-breakpoint-hit.exp with native-gdbserver
2026-05-06 20:27 [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board simon.marchi
` (5 preceding siblings ...)
2026-05-06 20:27 ` [PATCH 6/7] gdb/testsuite: use -inferior-args in gdb.base/gcore-buffer-overflow.exp simon.marchi
@ 2026-05-06 20:27 ` simon.marchi
2026-05-12 13:18 ` [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board Aktemur, Baris
7 siblings, 0 replies; 16+ messages in thread
From: simon.marchi @ 2026-05-06 20:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
From: Simon Marchi <simon.marchi@polymtl.ca>
ROCm tests don't work under the native-gdbserver board, but switch it to
use the new -inferior-args option anyway, to give the good example.
Change-Id: I684cd5e4328e033072735d5feca8037ca77b57c1
---
.../gdb.rocm/code-object-load-while-breakpoint-hit.exp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.rocm/code-object-load-while-breakpoint-hit.exp b/gdb/testsuite/gdb.rocm/code-object-load-while-breakpoint-hit.exp
index f9120a9cad03..c06038863837 100644
--- a/gdb/testsuite/gdb.rocm/code-object-load-while-breakpoint-hit.exp
+++ b/gdb/testsuite/gdb.rocm/code-object-load-while-breakpoint-hit.exp
@@ -55,9 +55,8 @@ proc do_test { } {
with_rocm_gpu_lock {
clean_restart
gdb_load $::binfile
- gdb_test_no_output "set args $::hipmodule_path" "set args"
- if { ![runto_main] } {
+ if { ![runto_main -inferior-args $::hipmodule_path] } {
return
}
--
2.54.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH 3/7] gdb/testsuite: add -inferior-args option to runto
2026-05-06 20:27 ` [PATCH 3/7] gdb/testsuite: add -inferior-args option to runto simon.marchi
@ 2026-05-12 13:02 ` Aktemur, Baris
2026-06-19 19:29 ` Simon Marchi
0 siblings, 1 reply; 16+ messages in thread
From: Aktemur, Baris @ 2026-05-12 13:02 UTC (permalink / raw)
To: simon.marchi, gdb-patches
AMD General
Hi Simon,
> From: Simon Marchi <simon.marchi@polymtl.ca>
>
> Add a new -inferior-args option to proc runto, to allow passing
> arguments to the test program. Its value is forwarded to gdb_run_cmd,
> which does the right thing, including with the native-gdbserver board,
> where arguments need to be passed on the gdbserver command line.
>
> The option is named -inferior-args (rather than the shorter -args)
> because parse_args sets a variable in the caller's scope using the
> option name. Naming it "-args" would clash with the "args" parameter.
>
> Subsequent patches use this new option.
>
> Change-Id: If2483c22302ed432ccd6cebef8d235e3e1d35bb8
> ---
> gdb/testsuite/lib/gdb.exp | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 601896457fea..60bcb582aeef 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -809,6 +809,7 @@ proc runto { linespec args } {
> {no-delete-breakpoints}
> {message}
> {no-message}
> + {inferior-args ""}
I think this needs to be documented in the proc comment.
-Baris
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH 4/7] gdb/testsuite: fix step-over-thread-exit.exp with native-gdbserver
2026-05-06 20:27 ` [PATCH 4/7] gdb/testsuite: fix step-over-thread-exit.exp with native-gdbserver simon.marchi
@ 2026-05-12 13:06 ` Aktemur, Baris
2026-06-19 19:31 ` Simon Marchi
0 siblings, 1 reply; 16+ messages in thread
From: Aktemur, Baris @ 2026-05-12 13:06 UTC (permalink / raw)
To: simon.marchi, gdb-patches
AMD General
Hi Simon,
> From: Simon Marchi <simon.marchi@polymtl.ca>
>
> This test uses "set args N" to control how many threads the inferior
> spawns: 1 in some cases and 100 in others. However, "set args" doesn't
> work with the native-gdbserver board. As a result, with that board, the
> inferior always uses its default of 100 threads. It sometimes causes
> failures like:
>
> p $_thread == 2
> $1 = 1
> (gdb) [New Thread 2790806.2790823 (id 3)]
>
> Thread 3 "step-over-threa" hit Breakpoint 2, 0x00005555555552ab in my_exit_syscall
> () at /.../testsuite/lib/my-syscalls.S:85
> 85 SYSCALL (my_exit, __NR_exit)
> FAIL: gdb.threads/step-over-thread-exit.exp: step_over_mode=inline: non-stop=on:
> target-non-stop=on: schedlock=off: cmd=next: ns_stop_all=0: selected thread didn't
> change (timeout)
>
> Here, GDB steps over thread 2's exit. As soon as thread 2 exits, the
> main thread spawns a new thread (thread 3), which hits the breakpoint
> placed over the exit syscall, and that event gets reported
> asynchronously, confusing the testsuite. The point of setting n_threads
> to 1 is exactly to avoid things like that.
>
> Fix it by passing the args via the new -inferior-args option, which
> works correctly with the native-gdbserver board.
>
> Change the test program to requiring the number of threads to be passed
> as an argument, which would have caught this problem.
>
> Change-Id: Ifc8856aa582706fd7207d0035d35dee749eb83a5
> Reported-By: Tankut Baris Aktemur <Tankut.Aktemur@amd.com>
I was at Intel when I reported it. Could you please use
tankut.baris.aktemur@intel.com here?
Thanks,
-Baris
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board
2026-05-06 20:27 [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board simon.marchi
` (6 preceding siblings ...)
2026-05-06 20:27 ` [PATCH 7/7] gdb/testsuite: fix gdb.rocm/code-object-load-while-breakpoint-hit.exp with native-gdbserver simon.marchi
@ 2026-05-12 13:18 ` Aktemur, Baris
2026-06-15 9:54 ` Aktemur, Baris
7 siblings, 1 reply; 16+ messages in thread
From: Aktemur, Baris @ 2026-05-12 13:18 UTC (permalink / raw)
To: simon.marchi, gdb-patches
AMD General
Hi Simon,
> From: Simon Marchi <simon.marchi@polymtl.ca>
>
> I started looking into this while revieweing this patch from Baris [1].
> The problem was that a set was attempting to pass args to the inferior
> using "set args", which does not work with the native-gdbserver board.
> I tried to implement proper support for passing arguments to inferior
> programs in the testsuite, and this series is the result.
>
> [1] https://inbox.sourceware.org/20260424141955.4083734-1-
> tankut.baris.aktemur%40intel.com
Thank you for digging in and finding out a more fundamental issue.
I looked at the series and it seemed fine to me. I sent two minor
comments to patches 3 and 4.
Reviewed-By: Tankut Baris Aktemur <TankutBaris.Aktemur@amd.com>
There is one improvement you could maybe consider:
The new -inferior-args parameter to runto is used in places where
there is only one argument is passed. It may help future patch authors
if in the proc comment you could write how to pass multiple args.
E.g. an example with quotations.
Regards,
-Baris
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board
2026-05-12 13:18 ` [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board Aktemur, Baris
@ 2026-06-15 9:54 ` Aktemur, Baris
2026-06-19 20:09 ` Simon Marchi
0 siblings, 1 reply; 16+ messages in thread
From: Aktemur, Baris @ 2026-06-15 9:54 UTC (permalink / raw)
To: simon.marchi, gdb-patches
AMD General
Hi Simon,
> > From: Simon Marchi <simon.marchi@polymtl.ca>
> >
> > I started looking into this while revieweing this patch from Baris [1].
> > The problem was that a set was attempting to pass args to the inferior
> > using "set args", which does not work with the native-gdbserver board.
> > I tried to implement proper support for passing arguments to inferior
> > programs in the testsuite, and this series is the result.
> >
> > [1] https://inbox.sourceware.org/20260424141955.4083734-1-
> > tankut.baris.aktemur%40intel.com
>
> Thank you for digging in and finding out a more fundamental issue.
>
> I looked at the series and it seemed fine to me. I sent two minor
> comments to patches 3 and 4.
>
> Reviewed-By: Tankut Baris Aktemur <TankutBaris.Aktemur@amd.com>
>
> There is one improvement you could maybe consider:
> The new -inferior-args parameter to runto is used in places where
> there is only one argument is passed. It may help future patch authors
> if in the proc comment you could write how to pass multiple args.
> E.g. an example with quotations.
Will you have a chance to merge this series? Perhaps it was forgotten.
In that case, this is just a kindly reminder.
-Baris
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/7] gdb/testsuite: add -inferior-args option to runto
2026-05-12 13:02 ` Aktemur, Baris
@ 2026-06-19 19:29 ` Simon Marchi
2026-06-19 19:54 ` Simon Marchi
0 siblings, 1 reply; 16+ messages in thread
From: Simon Marchi @ 2026-06-19 19:29 UTC (permalink / raw)
To: Aktemur, Baris, gdb-patches
On 5/12/26 9:02 AM, Aktemur, Baris wrote:
> AMD General
>
> Hi Simon,
>
>> From: Simon Marchi <simon.marchi@polymtl.ca>
>>
>> Add a new -inferior-args option to proc runto, to allow passing
>> arguments to the test program. Its value is forwarded to gdb_run_cmd,
>> which does the right thing, including with the native-gdbserver board,
>> where arguments need to be passed on the gdbserver command line.
>>
>> The option is named -inferior-args (rather than the shorter -args)
>> because parse_args sets a variable in the caller's scope using the
>> option name. Naming it "-args" would clash with the "args" parameter.
>>
>> Subsequent patches use this new option.
>>
>> Change-Id: If2483c22302ed432ccd6cebef8d235e3e1d35bb8
>> ---
>> gdb/testsuite/lib/gdb.exp | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
>> index 601896457fea..60bcb582aeef 100644
>> --- a/gdb/testsuite/lib/gdb.exp
>> +++ b/gdb/testsuite/lib/gdb.exp
>> @@ -809,6 +809,7 @@ proc runto { linespec args } {
>> {no-delete-breakpoints}
>> {message}
>> {no-message}
>> + {inferior-args ""}
>
> I think this needs to be documented in the proc comment.
Ack, I will modify it like so:
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 31bb1c0fe59f..e9fd43aed846 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -817,16 +817,20 @@ proc gdb_breakpoint { linespec args } {
# just compare to "function" because it might be a fully qualified,
# single quoted C++ function specifier.
#
-# If there are additional arguments, pass them to gdb_breakpoint.
-# We recognize -no-message/-message ourselves as well as -no-delete-breakpoints.
+# This proc recognizes the -no-message/-message, -no-delete-breakpoints
+# and -inferior-args options. If there are additional arguments, pass
+# them to gdb_breakpoint.
#
# -no-message is messed up here, like gdb_breakpoint: to preserve
# historical usage fails are always printed by default.
# -no-message: turns off printing of fails (and passes, but they're already off)
# -message: turns on printing of passes (and fails, but they're already on)
#
-# The 'no-delete-brekpoints' option stops this proc from deleting all
+# The 'no-delete-breakpoints' option stops this proc from deleting all
# breakpoints.
+#
+# The 'inferior-args' option allows to specify arguments to pass to the
+# inferior.
Simon
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 4/7] gdb/testsuite: fix step-over-thread-exit.exp with native-gdbserver
2026-05-12 13:06 ` Aktemur, Baris
@ 2026-06-19 19:31 ` Simon Marchi
0 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2026-06-19 19:31 UTC (permalink / raw)
To: Aktemur, Baris, gdb-patches
On 5/12/26 9:06 AM, Aktemur, Baris wrote:
> AMD General
>
> Hi Simon,
>
>> From: Simon Marchi <simon.marchi@polymtl.ca>
>>
>> This test uses "set args N" to control how many threads the inferior
>> spawns: 1 in some cases and 100 in others. However, "set args" doesn't
>> work with the native-gdbserver board. As a result, with that board, the
>> inferior always uses its default of 100 threads. It sometimes causes
>> failures like:
>>
>> p $_thread == 2
>> $1 = 1
>> (gdb) [New Thread 2790806.2790823 (id 3)]
>>
>> Thread 3 "step-over-threa" hit Breakpoint 2, 0x00005555555552ab in my_exit_syscall
>> () at /.../testsuite/lib/my-syscalls.S:85
>> 85 SYSCALL (my_exit, __NR_exit)
>> FAIL: gdb.threads/step-over-thread-exit.exp: step_over_mode=inline: non-stop=on:
>> target-non-stop=on: schedlock=off: cmd=next: ns_stop_all=0: selected thread didn't
>> change (timeout)
>>
>> Here, GDB steps over thread 2's exit. As soon as thread 2 exits, the
>> main thread spawns a new thread (thread 3), which hits the breakpoint
>> placed over the exit syscall, and that event gets reported
>> asynchronously, confusing the testsuite. The point of setting n_threads
>> to 1 is exactly to avoid things like that.
>>
>> Fix it by passing the args via the new -inferior-args option, which
>> works correctly with the native-gdbserver board.
>>
>> Change the test program to requiring the number of threads to be passed
>> as an argument, which would have caught this problem.
>>
>> Change-Id: Ifc8856aa582706fd7207d0035d35dee749eb83a5
>> Reported-By: Tankut Baris Aktemur <Tankut.Aktemur@amd.com>
>
> I was at Intel when I reported it. Could you please use
> tankut.baris.aktemur@intel.com here?
Ack.
Simon
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/7] gdb/testsuite: add -inferior-args option to runto
2026-06-19 19:29 ` Simon Marchi
@ 2026-06-19 19:54 ` Simon Marchi
0 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2026-06-19 19:54 UTC (permalink / raw)
To: Aktemur, Baris, gdb-patches
On 6/19/26 3:29 PM, Simon Marchi wrote:
> On 5/12/26 9:02 AM, Aktemur, Baris wrote:
>> AMD General
>>
>> Hi Simon,
>>
>>> From: Simon Marchi <simon.marchi@polymtl.ca>
>>>
>>> Add a new -inferior-args option to proc runto, to allow passing
>>> arguments to the test program. Its value is forwarded to gdb_run_cmd,
>>> which does the right thing, including with the native-gdbserver board,
>>> where arguments need to be passed on the gdbserver command line.
>>>
>>> The option is named -inferior-args (rather than the shorter -args)
>>> because parse_args sets a variable in the caller's scope using the
>>> option name. Naming it "-args" would clash with the "args" parameter.
>>>
>>> Subsequent patches use this new option.
>>>
>>> Change-Id: If2483c22302ed432ccd6cebef8d235e3e1d35bb8
>>> ---
>>> gdb/testsuite/lib/gdb.exp | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
>>> index 601896457fea..60bcb582aeef 100644
>>> --- a/gdb/testsuite/lib/gdb.exp
>>> +++ b/gdb/testsuite/lib/gdb.exp
>>> @@ -809,6 +809,7 @@ proc runto { linespec args } {
>>> {no-delete-breakpoints}
>>> {message}
>>> {no-message}
>>> + {inferior-args ""}
>>
>> I think this needs to be documented in the proc comment.
>
> Ack, I will modify it like so:
>
> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 31bb1c0fe59f..e9fd43aed846 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -817,16 +817,20 @@ proc gdb_breakpoint { linespec args } {
> # just compare to "function" because it might be a fully qualified,
> # single quoted C++ function specifier.
> #
> -# If there are additional arguments, pass them to gdb_breakpoint.
> -# We recognize -no-message/-message ourselves as well as -no-delete-breakpoints.
> +# This proc recognizes the -no-message/-message, -no-delete-breakpoints
> +# and -inferior-args options. If there are additional arguments, pass
> +# them to gdb_breakpoint.
> #
> # -no-message is messed up here, like gdb_breakpoint: to preserve
> # historical usage fails are always printed by default.
> # -no-message: turns off printing of fails (and passes, but they're already off)
> # -message: turns on printing of passes (and fails, but they're already on)
> #
> -# The 'no-delete-brekpoints' option stops this proc from deleting all
> +# The 'no-delete-breakpoints' option stops this proc from deleting all
> # breakpoints.
> +#
> +# The 'inferior-args' option allows to specify arguments to pass to the
> +# inferior.
I saw later your comment in the cover letter about saying how to pass
multiple arguments. I had to give it a try to be sure it works.
I will change the last paragraph above to read:
# The 'inferior-args' option allows to specify arguments to pass to the
# inferior. For example, this would pass three arguments:
#
# runto func -inferior-args "one two three"
Simon
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board
2026-06-15 9:54 ` Aktemur, Baris
@ 2026-06-19 20:09 ` Simon Marchi
0 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2026-06-19 20:09 UTC (permalink / raw)
To: Aktemur, Baris, gdb-patches
On 6/15/26 5:54 AM, Aktemur, Baris wrote:
> AMD General
>
> Hi Simon,
>
>>> From: Simon Marchi <simon.marchi@polymtl.ca>
>>>
>>> I started looking into this while revieweing this patch from Baris [1].
>>> The problem was that a set was attempting to pass args to the inferior
>>> using "set args", which does not work with the native-gdbserver board.
>>> I tried to implement proper support for passing arguments to inferior
>>> programs in the testsuite, and this series is the result.
>>>
>>> [1] https://inbox.sourceware.org/20260424141955.4083734-1-
>>> tankut.baris.aktemur%40intel.com
>>
>> Thank you for digging in and finding out a more fundamental issue.
>>
>> I looked at the series and it seemed fine to me. I sent two minor
>> comments to patches 3 and 4.
>>
>> Reviewed-By: Tankut Baris Aktemur <TankutBaris.Aktemur@amd.com>
>>
>> There is one improvement you could maybe consider:
>> The new -inferior-args parameter to runto is used in places where
>> there is only one argument is passed. It may help future patch authors
>> if in the proc comment you could write how to pass multiple args.
>> E.g. an example with quotations.
>
> Will you have a chance to merge this series? Perhaps it was forgotten.
> In that case, this is just a kindly reminder.
Yes, I had forgotten about it, thanks for the reminder.
I addressed your comments and pushed it.
Simon
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-06-19 20:10 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-06 20:27 [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board simon.marchi
2026-05-06 20:27 ` [PATCH 1/7] gdb/testsuite: remove unused arguments to gdb_breakpoint simon.marchi
2026-05-06 20:27 ` [PATCH 2/7] gdb/testsuite: make gdb_breakpoint, runto and runto_main use parse_args simon.marchi
2026-05-06 20:27 ` [PATCH 3/7] gdb/testsuite: add -inferior-args option to runto simon.marchi
2026-05-12 13:02 ` Aktemur, Baris
2026-06-19 19:29 ` Simon Marchi
2026-06-19 19:54 ` Simon Marchi
2026-05-06 20:27 ` [PATCH 4/7] gdb/testsuite: fix step-over-thread-exit.exp with native-gdbserver simon.marchi
2026-05-12 13:06 ` Aktemur, Baris
2026-06-19 19:31 ` Simon Marchi
2026-05-06 20:27 ` [PATCH 5/7] gdb/testsuite: make pie-execl.exp work " simon.marchi
2026-05-06 20:27 ` [PATCH 6/7] gdb/testsuite: use -inferior-args in gdb.base/gcore-buffer-overflow.exp simon.marchi
2026-05-06 20:27 ` [PATCH 7/7] gdb/testsuite: fix gdb.rocm/code-object-load-while-breakpoint-hit.exp with native-gdbserver simon.marchi
2026-05-12 13:18 ` [PATCH 0/7] gdb/testsuite: allow passing inferior arguments with native-gdbserver board Aktemur, Baris
2026-06-15 9:54 ` Aktemur, Baris
2026-06-19 20:09 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox