gdb/testsuite: remove use of then keyword from gdb.multi/*.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.multi/
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 14:28:22 +00:00
parent 49bb47443c
commit 0216141ac3
9 changed files with 18 additions and 18 deletions

View File

@ -85,7 +85,7 @@ gdb_test_multiple "info inferior 2 3" "info inferior 2 3" {
exp_continue
}
-re "$gdb_prompt $" {
if { !$see1 && $see2 && $see3 } then {
if {!$see1 && $see2 && $see3} {
pass "info inferior 2 3"
} else {
fail "info inferior 2 3"
@ -111,7 +111,7 @@ gdb_test_multiple "info inferior 1-2" "info inferior 1-2" {
exp_continue
}
-re "$gdb_prompt $" {
if { $see1 && $see2 && !$see3 } then {
if {$see1 && $see2 && !$see3} {
pass "info inferior 1-2"
} else {
fail "info inferior 1-2"
@ -154,7 +154,7 @@ gdb_test "list commonfun" "from goodbye.*" "list commonfun in goodbye"
# Let's run the hello program.
gdb_test "inferior 1" ".*" "switch to inferior 1 to run it"
if { ![runto_main] } then {
if {![runto_main]} {
return -1
}
@ -183,7 +183,7 @@ gdb_test_multiple "info inferiors" "check remove-inferiors" {
exp_continue
}
-re "$gdb_prompt $" {
if { $see1 && !$see2 && !$see3 } then {
if {$see1 && !$see2 && !$see3} {
pass "check remove-inferiors"
} else {
fail "check remove-inferiors"

View File

@ -19,7 +19,7 @@ if ![target_can_use_run_cmd] {
# Until "catch exec" is implemented on other targets...
#
if {![istarget "*-linux*"]} then {
if {![istarget "*-linux*"]} {
return
}
@ -49,7 +49,7 @@ clean_restart ${exec1}
# Start the program running, and stop at main.
#
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
# Inferior 1 stops at f1.
if ![runto f1] then {
if {![runto f1]} {
return 0
}
@ -40,7 +40,7 @@ delete_breakpoints
# Inferior 2 stops at f2.
if ![runto f2] then {
if {![runto f2]} {
return 0
}

View File

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

View File

@ -152,7 +152,7 @@ proc do_test { first_arch mode selected_thread } {
set from_exec "$first_arch-multi-arch-exec"
clean_restart ${from_exec}
if ![runto all_started] then {
if {![runto all_started]} {
return -1
}

View File

@ -78,7 +78,7 @@ if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \
# Start inferior 1
clean_restart ${exec1}
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -88,7 +88,7 @@ gdb_test "add-inferior" "Added inferior 2.*" "add empty inferior 2"
gdb_test "inferior 2" "Switching to inferior 2.*" "switch to inferior 2"
gdb_load ${binfile2}
if ![runto_main] then {
if {![runto_main]} {
return
}

View File

@ -80,7 +80,7 @@ proc test_re_run {re_run_inf} {
# Run the steady inferior to a breakpoint, and let it stay stopped
# there.
if ![runto all_started] then {
if {![runto all_started]} {
return 0
}

View File

@ -31,7 +31,7 @@ with_test_prefix "single-inferior" {
with_test_prefix "before restart" {
clean_restart ${testfile}
if { ![runto_main] } then {
if {![runto_main]} {
return -1
}
@ -40,7 +40,7 @@ with_test_prefix "single-inferior" {
with_test_prefix "restart" {
gdb_continue_to_end
if { ![runto_main] } then {
if {![runto_main]} {
return -1
}
}
@ -66,7 +66,7 @@ with_test_prefix "multi-inferior" {
gdb_test "inferior 2" "Switching to inferior 2 .*" "switch to inferior 2"
gdb_load ${binfile}
if ![runto_main] then {
if {![runto_main]} {
return
}
@ -82,7 +82,7 @@ with_test_prefix "multi-inferior" {
with_test_prefix "restart" {
gdb_continue_to_end
if { ![runto_main] } then {
if {![runto_main]} {
return -1
}
}

View File

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