# 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
}
}
clean_restart ${testfile}
-runto "pck.get" temporary
+runto "pck.get" -temporary
set value [string_to_regexp "= (defined => true, payload => true)"]
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:
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
}
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.
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
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).
# 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"
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).
# 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"
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.*" \
{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.*" \
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.*" \
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).
# 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"
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).
# 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"
# 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
clean_restart $testfile
-gdb_breakpoint [gdb_get_line_number "first marker"] temporary
+gdb_breakpoint [gdb_get_line_number "first marker"] -temporary
gdb_run_cmd
return
}
-gdb_breakpoint func message
+gdb_breakpoint func -message
gdb_test_no_output "set annotate 1"
# 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.
return
}
-gdb_breakpoint "main" "temporary"
+gdb_breakpoint "main" -temporary
gdb_run_cmd
gdb_test "" "Temporary breakpoint.*foo\\(\\).*"
# 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
}
clean_restart $::testfile
if { $start_before } {
- if {![runto_main temporary]} {
+ if {![runto_main -temporary]} {
return
}
}
}
if { !$start_before } {
- if {![runto_main temporary no-delete-breakpoints]} {
+ if {![runto_main -temporary -no-delete-breakpoints]} {
return
}
}
clean_restart $::testfile
if { $start_before } {
- if {![runto_main temporary]} {
+ if {![runto_main -temporary]} {
return
}
}
}
if { !$start_before } {
- if {![runto_main temporary no-delete-breakpoints]} {
+ if {![runto_main -temporary -no-delete-breakpoints]} {
return
}
}
clean_restart $::testfile
if { $start_before } {
- if {![runto_main temporary]} {
+ if {![runto_main -temporary]} {
return
}
}
# 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
}
}
clean_restart $::testfile
if { $start_before } {
- if {![runto_main temporary]} {
+ if {![runto_main -temporary]} {
return
}
}
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} {
# 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
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.
# past it.
#
if {$cmd == "continue"} {
- gdb_breakpoint "$execd_line" "allow-pending"
+ gdb_breakpoint "$execd_line" -allow-pending
}
# Execute past the exec call.
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"
}
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}.*"
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
"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
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
"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
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
"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
}
gdb_breakpoint "${testfile}.c:[gdb_get_line_number "loop-line" ${testfile}.c]" \
- temporary
+ -temporary
gdb_test "continue" "Temporary breakpoint .* loop-line .*"
return
}
-if {![runto abort {allow-pending}]} {
+if {![runto abort -allow-pending]} {
return
}
return
}
-if { ![gdb_breakpoint "*0x1" message] } {
+if { ![gdb_breakpoint "*0x1" -message] } {
return
}
# 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
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
}
}
} elseif { $method == "run" } {
- if { ![gdb_breakpoint "main" message] } {
+ if { ![gdb_breakpoint "main" -message] } {
fail "could not set breakpoint on main"
return -1
}
}
# Now place a breakpoint on main.
- if { ![gdb_breakpoint "main" message] } {
+ if { ![gdb_breakpoint "main" -message] } {
fail "could not set breakpoint on main"
continue
}
# 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 .*"
# 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 \
# 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
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"
}
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
# 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
# then we will see an internal error once the inferior starts running.
clean_restart $testfile
-if {![runto_main message]} {
- return
+if {![runto_main -message]} {
+ return
}
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" \
return
}
-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}
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
}
}
# 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"
proc do_tests {force_internal_tls} {
clean_restart $::testfile
- if {![runto main temporary]} {
+ if {![runto main -temporary]} {
return
}
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" {
}
}
- 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" {
}
}
- 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
}
}
- 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.
}
}
- 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.
}
}
- 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.
}
}
- 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.
}
}
- 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.
}
}
- 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.
}
}
- 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.
# 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?
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.*" \
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.*" \
# 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" {
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"
}
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
}
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"
}
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"
}
}
foreach ordinary {"outer<int>::fn" "outer<char>::fn<short>" "toplev<char>"} {
- gdb_breakpoint $ordinary message
+ gdb_breakpoint $ordinary -message
clean_restart $testfile
}
return
}
- gdb_breakpoint "function" qualified
+ gdb_breakpoint "function" -qualified
gdb_breakpoint "function"
# Save the breakpoints into a file.
clean_restart $executable
- if {![runto $main_location qualified]} {
+ if {![runto $main_location -qualified]} {
return
}
}
}
-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
}
}
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"
}
}
"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.
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
}
}
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"
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
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
}
# 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
return
}
-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 }
return
}
-gdb_breakpoint "$srcfile:27" message
+gdb_breakpoint "$srcfile:27" -message
# 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
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
}
# 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
}
return
}
-gdb_breakpoint "the_type::method" message
+gdb_breakpoint "the_type::method" -message
# (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
# <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"
}
# 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"
}
}
# The bug was that stopping in _start would crash.
-runto "*_start" message
+runto "*_start" -message
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
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" \
# 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,
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".
"You can specify only one thread\\."
} else {
gdb_breakpoint "main ${prefix}-force-condition${suffix}${cond}"\
- "message"
+ -message
}
}
}
gdb_continue_to_breakpoint "$bp_location1"
-gdb_breakpoint "thread" "message"
+gdb_breakpoint "thread" -message
gdb_continue_to_breakpoint "thread function"
$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"]
gdb_load $binfile
- gdb_breakpoint "initialized" {temporary}
+ gdb_breakpoint "initialized" -temporary
gdb_run_cmd
gdb_test "" ".*reakpoint .*, initialized .*${srcfile}.*" "run"
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"]
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}" \
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"
# 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"]
# 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"
# 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"
"\\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 \
"\\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\\. .*"
"\\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\\. .*"
#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" \
# 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
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"
}
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"
}
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"
# 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 \
### 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 \
# 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 \
# 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 \
### 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 \
# 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]
# 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]
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]} {
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" } {
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" } {
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" } {
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" } {
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
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
}
# 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"
}
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
}
return
}
- gdb_breakpoint "kernel" allow-pending temporary
+ gdb_breakpoint "kernel" -allow-pending -temporary
gdb_test "continue" \
"hit Temporary breakpoint.*, kernel .*" \
"continue to kernel"
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"
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"]
# 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.*"]
}
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" ".*"
}
}
proc test_actions_changed { } {
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "trace subr" "Tracepoint .*" \
"tracepoint at subr"
gdb_test_no_output "tstart" ""
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"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"
with_test_prefix "frame size" {
set_a_tracepoint func0
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "tstart" "\[\r\n\]*" "start trace"
runto_main
- gdb_breakpoint "begin" qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "begin" -qualified
+ gdb_breakpoint "end" -qualified
}
proc run_trace_experiment { test_func } {
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"
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"
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"
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" ".*" ""
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"
"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"
gdb_test "tstart" ".*" ""
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
# 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"
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" "^$" \
gdb_test "tstart" ".*" ""
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
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,
}
delete_breakpoints
-gdb_breakpoint "start" qualified
+gdb_breakpoint "start" -qualified
gdb_continue_to_breakpoint "continue to start"
with_test_prefix "counter is zero" {
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.*" \
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_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.*"
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.*" \
}
}
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
if {[string equal $type "break"]} {
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
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.*" \
# 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"
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"
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.*" \
}
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"
}
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.*" \
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"
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"
return 0
}
- gdb_breakpoint "begin" qualified
+ gdb_breakpoint "begin" -qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
with_test_prefix "${trace_command}: ${condition}" {
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.*"
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"
"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"
return -1
}
-gdb_breakpoint "end" qualified
+gdb_breakpoint "end" -qualified
with_test_prefix "tracing foo" {
gdb_test "trace *foo_start_lbl" ".*"
runto_main
- gdb_breakpoint "begin" qualified
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "begin" -qualified
+ gdb_breakpoint "end" -qualified
}
proc run_trace_experiment { test_func } {
gdb_test "tstart" ".*"
- gdb_breakpoint "end" qualified
+ gdb_breakpoint "end" -qualified
gdb_test "continue" \
"Continuing.*Breakpoint $decimal, end.*" \
"run trace experiment"
# 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
}
# 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.
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
}
# 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.
# 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
}