gdb/testsuite: remove use of then keyword from gdb.base/*.exp

The canonical form of 'if' in modern TCL is 'if {} {}'.  But there's
still a bunch of places in the testsuite where we make use of the
'then' keyword, and sometimes these get copies into new tests, which
just spreads poor practice.

This commit removes all use of the 'then' keyword from the gdb.base/
test script directory.

There should be no changes in what is tested after this commit.
This commit is contained in:
Andrew Burgess
2022-11-14 11:31:04 +00:00
parent ed7fbdd033
commit 65a33d75c2
216 changed files with 435 additions and 435 deletions

View File

@ -124,7 +124,7 @@ if {$res == 0} {
# The remaining tests don't work for targets can't take arguments...
if [target_info exists noargs] then {
if {[target_info exists noargs]} {
verbose "Skipping rest of a2-run.exp because of noargs."
return
}
@ -166,7 +166,7 @@ gdb_test_stdio "" "720" "" "run \"$testfile\" again after setting args"
# GOAL: Test that shell is being used with "run". For remote debugging
# targets, there is no guarantee that a "shell" (whatever that is) is used.
if ![is_remote target] then {
if {![is_remote target]} {
gdb_test_stdio "run `echo 8`" \
"40320" "" "run \"$testfile\" with shell"
}

View File

@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -32,7 +32,7 @@ proc test_abbrev_not_present { alias_name } {
exp_continue
}
-re ".*$gdb_prompt $" {
if { !$alias_present } then {
if {!$alias_present} {
pass $test_name
} else {
fail $test_name

View File

@ -37,7 +37,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
# set it up at a breakpoint so we can play with the variable values
#
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug] == -1} {
# Because runto_main doesn't know how to handle the prompt with annotations,
# run to main before we set the annotation level.
if ![runto_main] then {
if {![runto_main]} {
return 1
}

View File

@ -501,7 +501,7 @@ proc thread_test {} {
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if { ![runto_main] } then {
if {![runto_main]} {
return
}

View File

@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] } {
return -1
}
if { ![runto_main] } then {
if {![runto_main]} {
return
}

View File

@ -37,7 +37,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarning
# set it up at a breakpoint so we can play with the variable values
#
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -26,7 +26,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
clean_restart ${binfile}
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -40,7 +40,7 @@ clean_restart ${binfile}
# set it up at a breakpoint so we can play with the variable values
#
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
#
# set it up at a breakpoint so we can play with it
#
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -47,7 +47,7 @@ proc start_program {binfile} {
clean_restart $binfile
if ![runto setup_done] then {
if {![runto setup_done]} {
return 0
}

View File

@ -453,7 +453,7 @@ proc_with_prefix do_command_attach_tests {} {
global gdb_prompt
global binfile
if ![isnative] then {
if {![isnative]} {
unsupported "command attach test"
return 0
}

View File

@ -68,7 +68,7 @@ if { $topmost != "exec" } {
# Check which target this board connects to. If testing with a native
# target board, this should cause the native target to auto connect.
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -56,7 +56,7 @@ if {$core_works} {
}
}
if ![runto_main] then {
if {![runto_main]} {
return 0
}
set print_core_line [gdb_get_line_number "ABORT;"]

View File

@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
return -1
}
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -25,7 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
clean_restart ${binfile}
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -20,7 +20,7 @@
# Are we on a target board? As of 2004-02-12, GDB didn't have a
# mechanism that would let it efficiently access a remote corefile.
if ![isnative] then {
if {![isnative]} {
untested "remote system"
return
}
@ -55,7 +55,7 @@ gdb_test_no_output "set width 0"
# Get the core into the output directory.
set_inferior_cwd_to_output_dir
if ![runto_main] then {
if {![runto_main]} {
return 0
}
set print_core_line [gdb_get_line_number "Dump core"]

View File

@ -160,7 +160,7 @@ proc bitfield_signedness {} {
}
set test "most negative signed bitfield values"
if $has_signed_bitfields then {
if {$has_signed_bitfields} {
gdb_test "print flags" "u1 = 0, u2 = 0, u3 = 0, s1 = -16384, s2 = -4294967296, s3 = -32768.*" $test
} else {
unsupported $test
@ -169,7 +169,7 @@ proc bitfield_signedness {} {
continue_test break4 "#2"
set test "signed bitfields containing -1"
if $has_signed_bitfields then {
if {$has_signed_bitfields} {
gdb_test "print flags" "u1 = 0, u2 = 0, u3 = 0, s1 = -1, s2 = -1, s3 = -1.*" $test
} else {
unsupported $test
@ -212,7 +212,7 @@ proc bitfield_set {} {
gdb_test "print flags" "u1 = 0, u2 = 4294967296, u3 = 0, s1 = 0, s2 = 2147483648, s3 = 0.*" "long long bitfield values after set"
set test "set long long signed bitfield negative"
if $has_signed_bitfields then {
if {$has_signed_bitfields} {
gdb_test_multiple "print flags.s2 = -1" $test {
-re "warning: Value does not fit.*$gdb_prompt $" {
fail "$test"
@ -226,7 +226,7 @@ proc bitfield_set {} {
}
set test "long long bitfield values after set negative"
if $has_signed_bitfields then {
if {$has_signed_bitfields} {
gdb_test "print flags" "u1 = 0, u2 = 4294967296, u3 = 0, s1 = 0, s2 = -1, s3 = 0.*" $test
} else {
unsupported $test

View File

@ -44,7 +44,7 @@ proc test {always_inserted sw_watchpoint} {
clean_restart $binfile
if ![runto_main] then {
if {![runto_main]} {
return -1
}

View File

@ -115,7 +115,7 @@ proc test_break { always_inserted break_command } {
with_test_prefix "$cmd" {
delete_breakpoints
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -59,7 +59,7 @@ proc test_break { initial_load always_inserted break_command } {
gdb_reload
set GDBFLAGS $saved_gdbflags
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -161,7 +161,7 @@ proc_with_prefix test_break {} {
exp_continue
}
-re ".*$::gdb_prompt $" {
if { !$see1 && $see2 && !$see3 && $see4 && !$see5 && $see6 } then {
if {!$see1 && $see2 && !$see3 && $see4 && !$see5 && $see6} {
pass "info break 2 4 6"
} else {
fail "info break 2 4 6"
@ -202,7 +202,7 @@ proc_with_prefix test_break {} {
exp_continue
}
-re ".*$::gdb_prompt $" {
if { !$see1 && !$see2 && $see3 && $see4 && $see5 && !$see6 } then {
if {!$see1 && !$see2 && $see3 && $see4 && $see5 && !$see6} {
pass "info break 3-5"
} else {
fail "info break 3-5"
@ -260,7 +260,7 @@ proc_with_prefix test_break {} {
exp_continue
}
-re ".*$::gdb_prompt $" {
if { $see1 && $see2 && $see3 && $see4 && $see5 && $see6 } then {
if {$see1 && $see2 && $see3 && $see4 && $see5 && $see6} {
pass "check disable with history values"
} else {
fail "check disable with history values"
@ -308,7 +308,7 @@ proc_with_prefix test_break {} {
exp_continue
}
-re ".*$::gdb_prompt $" {
if { $see1 && $see2 && $see3 && $see4 && $see5 && $see6 } then {
if {$see1 && $see2 && $see3 && $see4 && $see5 && $see6} {
pass "check disable with convenience values"
} else {
fail "check disable with convenience values"
@ -458,7 +458,7 @@ test_tbreak
proc_with_prefix test_no_break_on_catchpoint {} {
clean_restart break
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -482,7 +482,7 @@ test_no_break_on_catchpoint
proc_with_prefix test_break_nonexistent_line {} {
clean_restart break
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -497,7 +497,7 @@ test_break_nonexistent_line
proc_with_prefix test_break_default {} {
clean_restart break
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -541,7 +541,7 @@ test_break_default
proc_with_prefix test_break_silent_and_more {} {
clean_restart break
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -686,7 +686,7 @@ test_break_user_call
proc_with_prefix test_finish_arguments {} {
clean_restart break
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
# Check we can run to main. If this works this time then we just
# assume that it will work later on (when we repeatedly restart GDB).
if ![runto_main] then {
if {![runto_main]} {
return -1
}

View File

@ -34,7 +34,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
# Check we can run to main. If this works this time then we just
# assume that it will work later on (when we repeatedly restart GDB).
if ![runto_main] then {
if {![runto_main]} {
return -1
}

View File

@ -28,7 +28,7 @@ proc check_selected_frame_after_bt { bt_cmd stack_pattern } {
with_test_prefix $bt_cmd {
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -44,7 +44,7 @@ gdb_test_no_output "set print address off"
gdb_test_no_output "set width 0"
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}
@ -432,7 +432,7 @@ if {!$skip_float_test && \
# On 32-bit SPARC, some of the args are passed by ref, others by
# value, and GDB gets confused and says "Invalid cast" because it
# thinks it has to cast the structure into a pointer to structure.
if { [test_debug_format "stabs"] } then {
if {[test_debug_format "stabs"]} {
setup_kfail "gdb/1539" "sparc-*-*"
}

View File

@ -45,7 +45,7 @@ gdb_test_no_output "set print address off"
gdb_test_no_output "set width 0"
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -61,7 +61,7 @@ proc start_scalars_test { type } {
}
# Advance to main
if { ![runto_main] } then {
if {![runto_main]} {
return
}

View File

@ -42,7 +42,7 @@ gdb_test_no_output "set print address off"
gdb_test_no_output "set print symbol off"
gdb_test_no_output "set width 0"
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -368,7 +368,7 @@ proc perform_all_tests {prototypes} {
# Check if all registers still have the same value.
set new_reg_content [fetch_all_registers \
"register contents after gdb function calls"]
if {$old_reg_content == $new_reg_content} then {
if {$old_reg_content == $new_reg_content} {
pass "gdb function calls preserve register contents"
} else {
set old_reg_content $new_reg_content
@ -394,7 +394,7 @@ proc perform_all_tests {prototypes} {
"bt after continuing from call dummy breakpoint"] then {
set new_reg_content [fetch_all_registers \
"register contents after stop in call dummy"]
if {$old_reg_content == $new_reg_content} then {
if {$old_reg_content == $new_reg_content} {
pass "continue after stop in call dummy preserves register contents"
} else {
fail "continue after stop in call dummy preserves register contents"
@ -420,7 +420,7 @@ proc perform_all_tests {prototypes} {
"bt after finishing from call dummy breakpoint"] then {
set new_reg_content [fetch_all_registers \
"register contents after finish in call dummy"]
if {$old_reg_content == $new_reg_content} then {
if {$old_reg_content == $new_reg_content} {
pass "finish after stop in call dummy preserves register contents"
} else {
fail "finish after stop in call dummy preserves register contents"
@ -445,7 +445,7 @@ proc perform_all_tests {prototypes} {
"y"] then {
set new_reg_content [fetch_all_registers \
"register contents after return in call dummy"]
if {$old_reg_content == $new_reg_content} then {
if {$old_reg_content == $new_reg_content} {
pass "return after stop in call dummy preserves register contents"
} else {
fail "return after stop in call dummy preserves register contents"
@ -508,7 +508,7 @@ proc perform_all_tests {prototypes} {
set new_reg_content [fetch_all_registers \
"register contents after nested call dummies"]
if {$old_reg_content == $new_reg_content} then {
if {$old_reg_content == $new_reg_content} {
pass "nested call dummies preserve register contents"
} else {
fail "nested call dummies preserve register contents"

View File

@ -23,7 +23,7 @@
# Until "catch fork" is implemented on other targets...
#
if { ![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"] } then {
if {![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"]} {
return
}

View File

@ -41,7 +41,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" $srcfile {debug}] }
return -1
}
if ![runto_main] then {
if {![runto_main]} {
return -1
}

View File

@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile ${testfile}.c] } {
}
# Check target supports catch syscall or not.
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -464,40 +464,40 @@ proc do_syscall_tests {} {
# Testing the 'catch syscall' command without arguments.
# This test should catch any syscalls.
if [runto_main] then { test_catch_syscall_without_args }
if {[runto_main]} { test_catch_syscall_without_args }
# Testing the 'catch syscall' command with arguments.
# This test should only catch the specified syscall.
if [runto_main] then { test_catch_syscall_with_args }
if {[runto_main]} { test_catch_syscall_with_args }
# Testing the 'catch syscall' command with many arguments.
# This test should catch $all_syscalls.
if [runto_main] then { test_catch_syscall_with_many_args }
if {[runto_main]} { test_catch_syscall_with_many_args }
# Testing the 'catch syscall' command with WRONG arguments.
# This test should not trigger any catchpoints.
if [runto_main] then { test_catch_syscall_with_wrong_args }
if {[runto_main]} { test_catch_syscall_with_wrong_args }
# Testing the 'catch syscall' command during a restart of
# the inferior.
if [runto_main] then { test_catch_syscall_restarting_inferior }
if {[runto_main]} { test_catch_syscall_restarting_inferior }
# Testing the 'catch syscall' command toggling off past a
# syscall return, then resuming entry/return as normal.
if [runto_main] then { test_catch_syscall_skipping_return }
if {[runto_main]} { test_catch_syscall_skipping_return }
# Testing the 'catch syscall' command starting mid-vfork.
if [runto_main] then { test_catch_syscall_mid_vfork }
if {[runto_main]} { test_catch_syscall_mid_vfork }
# Testing that 'catch syscall' entry/return tracks across execve.
if [runto_main] then { test_catch_syscall_execve }
if {[runto_main]} { test_catch_syscall_execve }
# Testing if the 'catch syscall' command works when switching to
# different architectures on-the-fly (PR gdb/10737).
if [runto_main] then { test_catch_syscall_multi_arch }
if {[runto_main]} { test_catch_syscall_multi_arch }
# Testing the 'catch' syscall command for a group of syscalls.
if [runto_main] then { test_catch_syscall_group }
if {[runto_main]} { test_catch_syscall_group }
}
proc test_catch_syscall_without_args_noxml {} {
@ -662,16 +662,16 @@ proc do_syscall_tests_without_xml {} {
# Let's test if we can catch syscalls without XML support.
# We should succeed, but GDB is not supposed to print syscall names.
if [runto_main] then { test_catch_syscall_without_args_noxml }
if {[runto_main]} { test_catch_syscall_without_args_noxml }
# The only valid argument "catch syscall" should accept is the
# syscall number, and not the name (since it can't translate a
# name to a number).
if [runto_main] then { test_catch_syscall_with_args_noxml }
if {[runto_main]} { test_catch_syscall_with_args_noxml }
# Now, we'll try to provide a syscall name (valid or not) to the command,
# and expect it to fail.
if [runto_main] then { test_catch_syscall_with_wrong_args_noxml }
if {[runto_main]} { test_catch_syscall_with_wrong_args_noxml }
}
# This procedure fills the vector "all_syscalls_numbers" with the proper

View File

@ -16,7 +16,7 @@
# Until "set follow-fork-mode" and "catch fork" are implemented on
# other targets...
#
if {![istarget "*-*-linux*"]} then {
if {![istarget "*-*-linux*"]} {
return
}

View File

@ -49,7 +49,7 @@ if { [gdb_compile "${srcdir}/${subdir}/main.c" "${binfile}" executable {debug}]
# Start with a fresh gdb.
clean_restart ${binfile}
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -79,7 +79,7 @@ gdb_test_multiple $command $test {
}
# Now get past startup code.
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -57,7 +57,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
return -1
}
if ![runto_main] then {
if {![runto_main]} {
perror "tests suppressed"
}

View File

@ -19,7 +19,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
if { ![runto_main] } then {
if {![runto_main]} {
return 0
}

View File

@ -20,16 +20,16 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
if [runto f2] then {
if {[runto f2]} {
get_debug_format
if { [test_compiler_info gcc-2-*] && [test_debug_format "DWARF \[0-9\]"] } then {
if {[test_compiler_info gcc-2-*] && [test_debug_format "DWARF \[0-9\]"]} {
setup_xfail "*-*-*"
}
gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
"print complex packed value in C"
}
if [runto f4] then {
if {[runto f4]} {
gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
"print complex value in C"
}

View File

@ -29,7 +29,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -42,7 +42,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
clean_restart ${binfile}
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarning
return -1
}
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}
@ -55,7 +55,7 @@ gdb_test "break \*$bp_addr" "Breakpoint $decimal at $bp_addr: file .*" \
gdb_test_multiple "step" "stopped at bp, 2nd instr" {
-re -wrap "Breakpoint $decimal, ($hex) in foo.*" {
set stop_addr $expect_out(1,string)
if [eval expr "$bp_addr == $stop_addr"] then {
if {[eval expr "$bp_addr == $stop_addr"]} {
pass "stopped at bp, 2nd instr"
} else {
fail "stopped at bp, 2nd instr (wrong address)"
@ -64,9 +64,9 @@ gdb_test_multiple "step" "stopped at bp, 2nd instr" {
-re -wrap "Breakpoint $decimal, foo.*" {
set stop_addr [get_valueof "/x" "\$pc" "" "value of pc"]
set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
if { ! $stop_addr_is_stmt } {
if {!$stop_addr_is_stmt} {
fail "stopped at bp, 2nd instr (missing hex prefix)"
} elseif [eval expr "$bp_addr == $stop_addr"] then {
} elseif {[eval expr "$bp_addr == $stop_addr"]} {
pass "stopped at bp, 2nd instr"
} else {
fail "stopped at bp, 2nd instr (wrong address)"

View File

@ -40,7 +40,7 @@ clean_restart ${binfile}
#
# set it up at a breakpoint so we can play with the variable values
#
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}
@ -51,7 +51,7 @@ get_debug_format
# TODO: check out the hp side of this.
proc local_compiler_xfail_check { } {
if { [test_compiler_info gcc-2-*] } then {
if {[test_compiler_info gcc-2-*]} {
if { ![test_debug_format "HP"] \
&& ![test_debug_format "DWARF \[0-9\]"] } then {
setup_xfail "*-*-*"

View File

@ -16,7 +16,7 @@
standard_testfile
# This test is Linux-only.
if ![istarget *-*-linux*] then {
if {![istarget *-*-linux*]} {
untested "coredump-filter.exp"
return -1
}

View File

@ -17,7 +17,7 @@
# are we on a target board
if ![isnative] then {
if {![isnative]} {
return
}
@ -49,7 +49,7 @@ if {$corefile == ""} {
# it a pass, but note that the program name is bad.
gdb_exit
if $verbose>1 then {
if {$verbose>1} {
send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS -core=$corefile\n"
}
@ -82,7 +82,7 @@ expect {
close
if $verbose>1 then {
if {$verbose>1} {
send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$corefile\n"
}

View File

@ -18,7 +18,7 @@
# coremaker2.c for details.
# are we on a target board
if ![isnative] then {
if {![isnative]} {
return
}
@ -174,7 +174,7 @@ with_test_prefix "renamed binfile" {
clean_restart $binfile
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -46,7 +46,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
#
# set it up at a breakpoint so we can play with the variable values
#
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -64,16 +64,16 @@ gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\] (unsign
# Test the equivalence between '.' and '->' for struct member references.
if [gdb_test "ptype v_struct1.v_float_member" "type = float"]<0 then {
if {[gdb_test "ptype v_struct1.v_float_member" "type = float"] < 0} {
return -1
}
if [gdb_test "ptype v_struct1->v_float_member" "type = float"]<0 then {
if {[gdb_test "ptype v_struct1->v_float_member" "type = float"] < 0} {
return -1
}
if [gdb_test "ptype v_t_struct_p.v_float_member" "type = float"]<0 then {
if {[gdb_test "ptype v_t_struct_p.v_float_member" "type = float"] < 0} {
return -1
}
if [gdb_test "ptype v_t_struct_p->v_float_member" "type = float"]<0 then {
if {[gdb_test "ptype v_t_struct_p->v_float_member" "type = float"] < 0} {
return -1
}
@ -278,7 +278,7 @@ ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \
# requires a running process. These call malloc, and can take a long
# time to execute over a slow serial link, so increase the timeout.
if [runto_main] then {
if {[runto_main]} {
if [target_info exists gdb,cannot_call_functions] {
unsupported "this target can not call functions"

View File

@ -25,7 +25,7 @@ gdb_test "maint expand-symtabs"
gdb_test "p a" { = \{1, 2\}} "no running process: p a"
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -184,7 +184,7 @@ gdb_expect {
}
-re "exec-file.*A program is being debugged already. Kill it. .y or n.*$" {
send_gdb "n\n"
if $verbose>1 then {
if {$verbose > 1} {
send_user "\tDidn't kill program being debugged\n"
}
gdb_expect -re "$gdb_prompt $" { }
@ -208,7 +208,7 @@ gdb_expect {
{ pass "file" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send_gdb "n\n"
if $verbose>1 then {
if {$verbose > 1} {
send_user "\t\tDidn't kill program being debugged\n"
}
gdb_expect -re "$gdb_prompt $" { }
@ -748,7 +748,7 @@ gdb_expect {
-re "No core file specified..*$gdb_prompt $" { pass "target core" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send_gdb "n\n"
if $verbose>1 then {
if {$verbose > 1} {
send_user "\t\tDidn't kill program being debugged\n"
}
gdb_expect -re "$gdb_prompt $" { }
@ -766,7 +766,7 @@ gdb_expect {
{ pass "target exec" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send_gdb "n\n"
if $verbose>1 then {
if {$verbose > 1} {
send_user "\t\tDidn't kill program being debugged\n"
}
gdb_expect -re "$gdb_prompt $" { }
@ -783,7 +783,7 @@ gdb_expect {
{ pass "target remote" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send_gdb "n\n"
if $verbose>1 then {
if {$verbose > 1} {
send_user "\t\tDidn't kill program being debugged\n"
}
gdb_expect -re "$gdb_prompt $" { }

View File

@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -30,7 +30,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quie
clean_restart ${binfile}
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
return -1
}
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -60,7 +60,7 @@ if !$use_gdb_stub {
# Ok, on to real life
#
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -21,7 +21,7 @@
load_lib gdbserver-support.exp
# The test relies on "detach/attach".
if { [use_gdb_stub] } then {
if {[use_gdb_stub]} {
return 0
}

View File

@ -26,7 +26,7 @@ set endian "auto"
set formats {binary ihex srec tekhex verilog}
if [istarget "alpha*-*-*"] then {
if {[istarget "alpha*-*-*"]} {
# SREC etc cannot handle 64-bit addresses. Force the test
# program into the low 31 bits of the address space.
lappend options "ldflags=-Wl,-taso"
@ -68,7 +68,7 @@ gdb_load ${binfile}
# IHEX and TEKHEX. We skip those tests then.
set max_32bit_address "0xffffffff"
set data_address [get_hexadecimal_valueof "&intarray" 0x100000000]
if {${data_address} > ${max_32bit_address}} then {
if {${data_address} > ${max_32bit_address}} {
set is64bitonly "yes"
}
@ -105,7 +105,7 @@ remote_exec host "rm -f $filenames"
# Run target program until data structs are initialized.
if { ! [ runto checkpoint1 ] } then {
if {![runto checkpoint1]} {
untested "couldn't run to checkpoint"
return -1
}
@ -283,7 +283,7 @@ proc test_restore_saved_value { restore_args msg oldval newval } {
}
}
if ![string compare $is64bitonly "no"] then {
if {![string compare $is64bitonly "no"]} {
test_restore_saved_value "[set intarr1.srec]" "array as value, srec" \
@ -365,7 +365,7 @@ set struct2_offset \
print_zero_all
if ![string compare $is64bitonly "no"] then {
if {![string compare $is64bitonly "no"]} {
test_restore_saved_value "[set intarr1.srec] $array2_offset" \
"array copy, srec" \
$array_val "intarray2"
@ -421,7 +421,7 @@ set element3_offset \
set element4_offset \
[capture_value "/x (char *) &intarray\[4\] - (char *) &intarray\[0\]"]
if ![string compare $is64bitonly "no"] then {
if {![string compare $is64bitonly "no"]} {
print_zero_all
test_restore_saved_value "[set intarr1.srec] 0 $element3_start $element4_start" \
@ -456,7 +456,7 @@ test_restore_saved_value \
gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 4"
gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 4"
if ![string compare $is64bitonly "no"] then {
if {![string compare $is64bitonly "no"]} {
print_zero_all
# restore with expressions
@ -520,7 +520,7 @@ proc test_reload_saved_value { filename msg oldval newval } {
}
# srec format can not be loaded for 64-bit-only platforms
if ![string compare $is64bitonly "no"] then {
if {![string compare $is64bitonly "no"]} {
test_reload_saved_value "[set intarr1.srec]" "reload array as value, srec" \
$array_val "\*$array_ptr_type"
test_reload_saved_value "[set intstr1.srec]" "reload struct as value, srec" \
@ -532,7 +532,7 @@ if ![string compare $is64bitonly "no"] then {
}
# ihex format can not be loaded for 64-bit-only platforms
if ![string compare $is64bitonly "no"] then {
if {![string compare $is64bitonly "no"]} {
test_reload_saved_value "[set intarr1.ihex]" \
"reload array as value, intel hex" \
@ -549,7 +549,7 @@ if ![string compare $is64bitonly "no"] then {
}
# tekhex format can not be loaded for 64-bit-only platforms
if ![string compare $is64bitonly "no"] then {
if {![string compare $is64bitonly "no"]} {
test_reload_saved_value "[set intarr1.tekhex]" \
"reload array as value, tekhex" \
$array_val "\*$array_ptr_type"

View File

@ -26,7 +26,7 @@ proc test_setup { count } {
clean_restart ${binfile}
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -19,7 +19,7 @@
standard_testfile
# Set compiler flags.
if {[istarget "powerpc*"]} then {
if {[istarget "powerpc*"]} {
# PowerPC generates a Traceback Table, as defined in the PPC64 ABI,
# following each function by default. The Traceback Table information is
# typically interpreted by the disassembler as data represented with

View File

@ -34,7 +34,7 @@ set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile2]
set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile2]
set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile2]
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -123,7 +123,7 @@ gdb_continue_to_end "no stop at auto-disabled break marker2"
# Verify that we can set a breakpoint to be self-deleting after the
# first time it triggers.
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -154,7 +154,7 @@ gdb_test "info break $bp" \
"\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+n.*" \
"info break marker4"
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -193,7 +193,7 @@ gdb_test "continue" \
# should cause the next N triggers of the bp to be ignored. (This is
# a flavor of enablement/disablement, after all.)
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -254,7 +254,7 @@ gdb_test_multiple "continue" "$test" {
# Verify that we can specify both an ignore count and an auto-delete.
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -286,7 +286,7 @@ gdb_test "continue" \
# Verify that a disabled breakpoint's ignore count isn't updated when
# the bp is encountered.
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -315,7 +315,7 @@ gdb_test "info break $bp" \
# (Also verify that GDB gracefully handles the case where the inferior
# isn't stopped at a breakpoint.)
#
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -343,7 +343,7 @@ gdb_test_multiple "continue 2" "$test" {
# Verify that GDB correctly handles the "enable/disable" command
# with arguments, that include multiple locations.
#
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
}
set bp_location [gdb_get_line_number "START"]
if ![runto "endianity.c:$bp_location" ] then {
if {![runto "endianity.c:$bp_location"]} {
return -1
}

View File

@ -27,7 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts
clean_restart $testfile
if ![runto_main] then {
if {![runto_main]} {
perror "could not run to main"
return
}

View File

@ -42,7 +42,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
clean_restart ${binfile}
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -37,7 +37,7 @@ if { ! [file exists $binfile] } {
return -1
}
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -50,7 +50,7 @@ proc do_exec_sysroot_test {} {
# Start the program running, and stop at main.
#
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -42,7 +42,7 @@ if { [gdb_compile $objfile $exec1 executable {debug text_segment=0x1000000}] !=
# exec2. If it is, then skip the test as unsupported.
clean_restart ${exec1}
if ![runto_main] then {
if {![runto_main]} {
return -1
}
@ -56,7 +56,7 @@ gdb_test_multiple "p/x &main" $test {
}
clean_restart ${exec2}
if ![runto_main] then {
if {![runto_main]} {
return -1
}
@ -88,7 +88,7 @@ proc test { always_inserted } {
gdb_test_no_output "set breakpoint always-inserted $always_inserted"
if ![runto_main] then {
if {![runto_main]} {
return -1
}

View File

@ -32,7 +32,7 @@ clean_restart ${binfile}
# set it up at a breakpoint so we can play with the variable values
#
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -55,7 +55,7 @@ gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
gdb_test_no_output "set width 0"
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -76,7 +76,7 @@ proc finish_void { } {
proc finish_abbreviation { abbrev } {
if { ! [ runto "int_func" ] } then {
if {![runto "int_func"]} {
return -1
}
@ -102,7 +102,7 @@ proc finish_no_print {} {
proc finish_tests { } {
global gdb_prompt skip_float_test
if { ! [ runto_main ] } then {
if {![runto_main]} {
return -1
}

View File

@ -42,7 +42,7 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_load_shlib ${lib_sl}
if ![runto_main] then {
if {![runto_main]} {
return 1
}

View File

@ -29,18 +29,18 @@ if { [prepare_for_testing "failed to prepare" float float.c] } {
# Set it up at a breakpoint so we have its registers.
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}
# Test "info float".
if { [is_aarch64_target] } then {
if {[is_aarch64_target]} {
gdb_test "info float" "d0.*d1.*d31.*s0.*s1.*s31.*"
} elseif { [istarget "alpha*-*-*"] } then {
} elseif {[istarget "alpha*-*-*"]} {
gdb_test "info float" "f0.*"
} elseif { [is_aarch32_target] } then {
} elseif {[is_aarch32_target]} {
gdb_test_multiple "info float" "info float" {
-re "Software FPU type.*mask:.*flags:.*$gdb_prompt $" {
pass "info float (FPA)"
@ -54,11 +54,11 @@ if { [is_aarch64_target] } then {
pass "info float (without FPU)"
}
}
} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } then {
} elseif {[istarget "i?86-*-*"] || [istarget "x86_64-*-*"]} {
gdb_test "info float" "R7:.*Status Word:.*Opcode:.*"
} elseif [istarget "ia64-*-*"] then {
} elseif {[istarget "ia64-*-*"]} {
gdb_test "info float" "f0.*f1.*f127.*"
} elseif [istarget "m68k-*-*"] then {
} elseif {[istarget "m68k-*-*"]} {
gdb_test_multiple "info float" "info_float" {
-re "fp0.*fp1.*fp7.*$gdb_prompt $" {
pass "info float (with FPU)"
@ -67,7 +67,7 @@ if { [is_aarch64_target] } then {
pass "info float (without FPU)"
}
}
} elseif [istarget "mips*-*-*"] then {
} elseif {[istarget "mips*-*-*"]} {
gdb_test_multiple "info float" "info float" {
-re "fpu type: none / unused\r\n$gdb_prompt $" {
pass "info float (without FPU)"
@ -76,7 +76,7 @@ if { [is_aarch64_target] } then {
pass "info float (with FPU)"
}
}
} elseif [istarget "nds32*-*-*"] then {
} elseif {[istarget "nds32*-*-*"]} {
gdb_test_multiple "info float" "info_float" {
-re "fd0.*fd3.*$gdb_prompt $" {
pass "info float (with FPU)"
@ -85,7 +85,7 @@ if { [is_aarch64_target] } then {
pass "info float (without FPU)"
}
}
} elseif [istarget "powerpc*-*-*"] then {
} elseif {[istarget "powerpc*-*-*"]} {
gdb_test_multiple "info float" "info_float" {
-re "f0.*f1.*f31.*fpscr.*$gdb_prompt $" {
pass "info float (with FPU)"
@ -94,9 +94,9 @@ if { [is_aarch64_target] } then {
pass "info float (without FPU)"
}
}
} elseif [istarget "s390*-*-*"] then {
} elseif {[istarget "s390*-*-*"]} {
gdb_test "info float" "fpc.*f0.*f1.*f15.*" "info float"
} elseif [istarget "sh*-*"] then {
} elseif {[istarget "sh*-*"]} {
# SH may or may not have an FPU
gdb_test_multiple "info float" "info float" {
-re "fpul.*fr0.*fr1.*fr15.*$gdb_prompt $" {
@ -106,11 +106,11 @@ if { [is_aarch64_target] } then {
pass "info float (without FPU)"
}
}
} elseif [istarget "hppa*-*"] then {
} elseif {[istarget "hppa*-*"]} {
gdb_test "info float" "fr4.*fr4R.*fr31R.*" "info float"
} elseif [istarget "sparc*-*-*"] then {
} elseif {[istarget "sparc*-*-*"]} {
gdb_test "info float" "f0.*f1.*f31.*d0.*d30.*" "info float"
} elseif [istarget "riscv*-*-*"] then {
} elseif {[istarget "riscv*-*-*"]} {
# RISC-V may or may not have an FPU. Additionally, the order of
# fcsr relative to fflags and frm can change depending on whether
# the fflags and frm registers are implemented as real registers

View File

@ -32,7 +32,7 @@ if { [do_compile] != "" && [do_compile {-mfloat128}] != "" } {
clean_restart ${binfile}
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -32,7 +32,7 @@ if { [do_compile] != "" && [do_compile {-mfloat128}] != "" } {
clean_restart ${binfile}
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -35,7 +35,7 @@ if { [target_info exists gdb_protocol]
# Until "catch exec" is implemented on other targets...
#
if {![istarget "*-linux*"]} then {
if {![istarget "*-linux*"]} {
return
}
@ -68,7 +68,7 @@ proc do_catch_exec_test { } {
# Start the program running, and stop at main.
#
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -107,7 +107,7 @@ proc do_follow_exec_mode_tests { mode cmd infswitch } {
# Start the program running, and stop at main.
#
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -18,7 +18,7 @@
# Until "catch exec" is implemented on other targets...
#
if { ![istarget "*-linux*"] } then {
if {![istarget "*-linux*"]} {
return
}
@ -51,7 +51,7 @@ proc do_exec_tests {} {
# Start the program running, and stop at main.
#
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -77,7 +77,7 @@ proc do_exec_tests {} {
# Start the program running, and stop at main.
#
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -166,7 +166,7 @@ proc do_exec_tests {} {
# Start the program running, and stop at main.
#
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -234,7 +234,7 @@ proc do_exec_tests {} {
# Start the program running, and stop at main.
#
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -301,7 +301,7 @@ proc do_exec_tests {} {
# Start the program running, and stop at main.
#
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -362,7 +362,7 @@ proc do_exec_tests {} {
# Start the program running, and stop at main.
#
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -21,7 +21,7 @@
# Until "set follow-fork-mode" and "catch vfork" are implemented on
# other targets...
#
if {![istarget "*-linux*"]} then {
if {![istarget "*-linux*"]} {
continue
}

View File

@ -35,7 +35,7 @@ proc do_test { detach_on_fork follow_fork non_stop schedule_multiple } {
}
}
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -21,7 +21,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
clean_restart ${binfile}
if ![runto break_me] then {
if {![runto break_me]} {
perror "Couldn't run ${testfile}"
return
}

View File

@ -97,7 +97,7 @@ proc test {dwarf_unwinder} {
gdb_test_no_output "maint set dwarf unwinder $dwarf_unwinder"
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
return -1
}
if ![runto setup_done] then {
if {![runto setup_done]} {
return 0
}

View File

@ -49,7 +49,7 @@ proc_with_prefix integral_args {} {
gdb_breakpoint call0e
# Run; should stop at call0a and print actual arguments.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_run_cmd
gdb_test "" " call0a \\(c=97 'a', s=1, i=2, l=3\\) .*" "run to call0a"
@ -91,7 +91,7 @@ proc unsigned_integral_args {} {
gdb_breakpoint call1e
# Run; should stop at call1a and print actual arguments.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_run_cmd
gdb_test "" " call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*" "run to call1a"
@ -137,7 +137,7 @@ proc float_and_integral_args {} {
# Run; should stop at call2a and print actual arguments.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_run_cmd
set test "run to call2a"
gdb_test_multiple "" $test {
@ -637,7 +637,7 @@ proc_with_prefix shuffle_round_robin {} {
gdb_run_cmd
gdb_test "" "Breakpoint $decimal, call7a .*" "run to call7a"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test_multiple "backtrace 100" "backtrace from call7a" {
-re " call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .* main \\(.*\\) .*$gdb_prompt $" {
pass "backtrace from call7a"
@ -652,7 +652,7 @@ proc_with_prefix shuffle_round_robin {} {
gdb_continue call7b
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test_sequence "backtrace 100" "backtrace from call7b" {
"\[\r\n\]#0 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
@ -853,9 +853,9 @@ proc_with_prefix localvars_after_alloca { } {
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test "print c" " = 97 'a'" "print c after runto localvars_after_alloca"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test "print s" " = 1" "print s after runto localvars_after_alloca"
gdb_test "print i" " = 2" "print i after runto localvars_after_alloca"
gdb_test "print l" " = 3" "print l after runto localvars_after_alloca"
@ -887,14 +887,14 @@ proc_with_prefix call_after_alloca { } {
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test "print c" " = 97 'a'" "print c in call_after_alloca"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test "print s" " = 1" "print s in call_after_alloca"
gdb_test "print i" " = 2" "print i in call_after_alloca"
gdb_test "print l" " = 3" "print l in call_after_alloca"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test "backtrace 8" "#0.*call_after_alloca_subr \\(c=97 'a', s=1, i=2, l=3, uc=98 'b', us=11, ui=12, ul=13\\).*#1.*call_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#2.*main.*" "backtrace from call_after_alloca_subr"
}
@ -925,14 +925,14 @@ proc_with_prefix localvars_in_indirect_call { } {
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test "print c" " = 97 'a'" "print c in localvars_in_indirect_call"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test "print s" " = 1" "print s in localvars_in_indirect_call"
gdb_test "print i" " = 2" "print i in localvars_in_indirect_call"
gdb_test "print l" " = 3" "print l in localvars_in_indirect_call"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test "backtrace 8" \
"#0.*call0a \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" \
"backtrace in indirectly called function"
@ -965,7 +965,7 @@ proc_with_prefix localvars_in_indirect_call { } {
}
}
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
gdb_test "step" "call0a \\(c=97 'a', s=1, i=2, l=3\\).*" \
"stepping into indirectly called function"
}

View File

@ -34,7 +34,7 @@ clean_restart ${binfile}
gdb_test_no_output "set args ${pattern}" \
"set buffer exceeding arguments"
if { ! [ runto_main ] } then {
if {![runto_main]} {
return -1
}

View File

@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
if { ! [ runto_main ] } then {
if {![runto_main]} {
return -1
}
@ -81,21 +81,21 @@ gdb_test_sequence "where" "where in corefile" {
}
set post_corefile_regs [capture_command_output "info registers" ""]
if ![string compare $pre_corefile_regs $post_corefile_regs] then {
if {![string compare $pre_corefile_regs $post_corefile_regs]} {
pass "corefile restored general registers"
} else {
fail "corefile restored general registers"
}
set post_corefile_allregs [capture_command_output "info all-reg" ""]
if ![string compare $pre_corefile_allregs $post_corefile_allregs] then {
if {![string compare $pre_corefile_allregs $post_corefile_allregs]} {
pass "corefile restored all registers"
} else {
fail "corefile restored all registers"
}
set post_corefile_sysregs [capture_command_output "info reg system" ""]
if ![string compare $pre_corefile_sysregs $post_corefile_sysregs] then {
if {![string compare $pre_corefile_sysregs $post_corefile_sysregs]} {
pass "corefile restored system registers"
} else {
fail "corefile restored system registers"

View File

@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
if ![runto_main] then {
if {![runto_main]} {
return 1
}

View File

@ -31,7 +31,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $testfile.c {debug}] } {
}
if { ![runto_main] } then {
if {![runto_main]} {
return
}

View File

@ -38,7 +38,7 @@ if {$skip_hw_watchpoint_tests_p} {
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
}
if { ![runto_main] } then {
if {![runto_main]} {
return
}

View File

@ -31,7 +31,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
clean_restart ${binfile}
if ![runto abort {allow-pending}] then {
if {![runto abort {allow-pending}]} {
return
}

View File

@ -39,7 +39,7 @@ if { [gdb_compile_shlib $libsrc $libobj {debug}] != ""
clean_restart ${binfile}
gdb_load_shlib $libobj
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
if ![runto_main] then {
if {![runto_main]} {
perror "couldn't run to breakpoint"
return
}

View File

@ -105,7 +105,7 @@ proc_with_prefix set-break {resolver_attr resolver_debug final_debug} {
clean_restart $binfile-$suffix
gdb_load_shlib ${lib_so}
if ![runto_main] then {
if {![runto_main]} {
return 1
}
@ -227,7 +227,7 @@ proc misc_tests {resolver_attr resolver_debug final_debug} {
clean_restart $binfile-$suffix
gdb_load_shlib ${lib_so}
if ![runto_main] then {
if {![runto_main]} {
return 1
}

View File

@ -105,7 +105,7 @@ gdb_test "ptype (char4) 0x01010101" \
gdb_test "ptype (int2) lla" \
"type = int __attribute__ \\(\\(vector_size\\(2\\)\\)\\)"
if { ![string compare $endian big] } then {
if {![string compare $endian big]} {
gdb_test "print (char4) ia" "\\\$$decimal = \\{0, 0, 0, 2\\}"
} else {
gdb_test "print (char4) ia" "\\\$$decimal = \\{2, 0, 0, 0\\}"

View File

@ -34,7 +34,7 @@ if { [have_index $binfile] != "gdb_index" } {
gdb_test_no_output "set auto-solib-add off"
if ![runto_main] then {
if {![runto_main]} {
return 0
}

View File

@ -39,7 +39,7 @@ if { [gdb_compile_shlib ${srcdir}/${subdir}/${lib_src} ${lib_so} $lib_opts] != "
clean_restart $binfile
gdb_load_shlib $lib_so
if ![runto_main] then {
if {![runto_main]} {
return -1
}

View File

@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" "hbreak2" {break.c break1.c} {debu
set srcfile break.c
set srcfile1 break1.c
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -287,7 +287,7 @@ gdb_test "info break" \
#***********
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -315,7 +315,7 @@ gdb_test "hbreak" "Hardware assisted breakpoint \[0-9\]*.*" \
# Verify that a "silent" breakpoint can be set, and that GDB is indeed
# "silent" about its triggering.
#
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -520,7 +520,7 @@ if { [prepare_for_testing "failed to prepare" "hbreak2o2" {break.c break1.c} {de
return -1
}
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -39,7 +39,7 @@ proc setup {commands} {
clean_restart $binfile
if ![runto_main] then {
if {![runto_main]} {
return -code return
}

View File

@ -42,7 +42,7 @@ clean_restart ${binfile}
set prev_timeout $timeout
set timeout 30
if { ! [ runto_main ] } then {
if {![runto_main]} {
return -1
}

View File

@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
}
if ![runto_main] then {
if {![runto_main]} {
return -1
}

View File

@ -16,7 +16,7 @@
# Test running an inferior with arguments.
# This does not work on boards that don't support inferior arguments.
if [target_info exists noargs] then {
if {[target_info exists noargs]} {
verbose "skipping gdb.base/inferior-args.exp because of noargs"
return
}

Some files were not shown because too many files have changed in this diff Show More