diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-11-14 14:20:53 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-11-28 21:04:09 +0000 |
commit | bde43e8dbeaf4c9b05514f0c749623db453747bb (patch) | |
tree | 503dc5f53f91f5367401f15522dfa10885abbc09 | |
parent | 89c6d320b24567b6385e9dd92b3d4671c9796143 (diff) | |
download | gdb-bde43e8dbeaf4c9b05514f0c749623db453747bb.zip gdb-bde43e8dbeaf4c9b05514f0c749623db453747bb.tar.gz gdb-bde43e8dbeaf4c9b05514f0c749623db453747bb.tar.bz2 |
gdb/testsuite: remove use of then keyword from gdb.reverse/*.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.reverse/
test script directory.
There should be no changes in what is tested after this commit.
-rw-r--r-- | gdb/testsuite/gdb.reverse/consecutive-precsave.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/consecutive-reverse.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/i386-precsave.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/i386-reverse.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/i386-sse-reverse.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/i387-env-reverse.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/i387-stack-reverse.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/insn-reverse.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/ppc_record_test_isa_2_06.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/sigall-precsave.exp | 10 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/sigall-reverse.exp | 10 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp | 2 |
15 files changed, 31 insertions, 31 deletions
diff --git a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp index 5d2c810..d1d1aa2 100644 --- a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp +++ b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp @@ -83,7 +83,7 @@ set testmsg "stopped at bp, 2nd instr" gdb_test_multiple "step" $testmsg { -re -wrap "Breakpoint $decimal, ($hex) in foo.*" { set stop_addr $expect_out(1,string) - if [eval expr "$foo2_addr == $stop_addr"] then { + if {[eval expr "$foo2_addr == $stop_addr"]} { pass "stopped at bp, 2nd instr" } else { fail "stopped at bp, 2nd instr (wrong address)" @@ -94,7 +94,7 @@ gdb_test_multiple "step" $testmsg { set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt] if { ! $stop_addr_is_stmt } { fail "stopped at bp, 2nd instr (missing hex prefix)" - } elseif [eval expr "$foo2_addr == $stop_addr"] then { + } elseif {[eval expr "$foo2_addr == $stop_addr"]} { pass "stopped at bp, 2nd instr" } else { fail "stopped at bp, 2nd instr (wrong address)" @@ -116,7 +116,7 @@ set test_msg "stopped at bp in reverse, 1st instr" gdb_test_multiple "step" "$test_msg" { -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" { set stop_addr $expect_out(1,string) - if [eval expr "$foo1_addr == $stop_addr"] then { + if {[eval expr "$foo1_addr == $stop_addr"]} { pass "$test_msg" } else { fail "$test_msg (wrong address)" diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp index 955cb49..99d8332 100644 --- a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp +++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp @@ -63,7 +63,7 @@ set testmsg "stopped at bp, 2nd instr" gdb_test_multiple "step" $testmsg { -re -wrap "Breakpoint $decimal, ($hex) in foo.*" { set stop_addr $expect_out(1,string) - if [eval expr "$foo2_addr == $stop_addr"] then { + if {[eval expr "$foo2_addr == $stop_addr"]} { pass "stopped at bp, 2nd instr" } else { fail "stopped at bp, 2nd instr (wrong address)" @@ -74,7 +74,7 @@ gdb_test_multiple "step" $testmsg { set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt] if { ! $stop_addr_is_stmt } { fail "stopped at bp, 2nd instr (missing hex prefix)" - } elseif [eval expr "$foo2_addr == $stop_addr"] then { + } elseif {[eval expr "$foo2_addr == $stop_addr"]} { pass "stopped at bp, 2nd instr" } else { fail "stopped at bp, 2nd instr (wrong address)" @@ -96,7 +96,7 @@ set test_msg "stopped at bp in reverse, 1st instr" gdb_test_multiple "step" "$test_msg" { -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" { set stop_addr $expect_out(1,string) - if [eval expr "$foo1_addr == $stop_addr"] then { + if {[eval expr "$foo1_addr == $stop_addr"]} { pass "$test_msg" } else { fail "$test_msg (wrong address)" diff --git a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp index 2a20474..5bfe147 100644 --- a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp +++ b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp @@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" "$testfile" $srcfile] } { return -1 } -if ![runto_main] then { +if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.reverse/i386-precsave.exp b/gdb/testsuite/gdb.reverse/i386-precsave.exp index 5458047..fbf80b8 100644 --- a/gdb/testsuite/gdb.reverse/i386-precsave.exp +++ b/gdb/testsuite/gdb.reverse/i386-precsave.exp @@ -25,7 +25,7 @@ if ![supports_process_record] { } -if ![is_x86_like_target] then { +if {![is_x86_like_target]} { verbose "Skipping i386 reverse tests." return } diff --git a/gdb/testsuite/gdb.reverse/i386-reverse.exp b/gdb/testsuite/gdb.reverse/i386-reverse.exp index 15c18da..6f6458c 100644 --- a/gdb/testsuite/gdb.reverse/i386-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-reverse.exp @@ -24,7 +24,7 @@ if ![supports_reverse] { } -if ![is_x86_like_target] then { +if {![is_x86_like_target]} { verbose "Skipping i386 reverse tests." return } diff --git a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp index 9713e89..ac56cd4 100644 --- a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp @@ -24,7 +24,7 @@ if ![supports_reverse] { } -if ![istarget "*86*-*linux*"] then { +if {![istarget "*86*-*linux*"]} { verbose "Skipping i386 reverse tests." return } diff --git a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp index 53fee098..efc7c84 100644 --- a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp @@ -16,7 +16,7 @@ # This file is part of the gdb testsuite. -if ![is_x86_like_target] then { +if {![is_x86_like_target]} { verbose "Skipping i387 reverse float tests." return } diff --git a/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp b/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp index cadd4f7..f88c1dc 100644 --- a/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp @@ -16,7 +16,7 @@ # This file is part of the gdb testsuite. -if ![is_x86_like_target] then { +if {![is_x86_like_target]} { verbose "Skipping i387 reverse float tests." return } diff --git a/gdb/testsuite/gdb.reverse/insn-reverse.exp b/gdb/testsuite/gdb.reverse/insn-reverse.exp index c5437ec..82ae39f 100644 --- a/gdb/testsuite/gdb.reverse/insn-reverse.exp +++ b/gdb/testsuite/gdb.reverse/insn-reverse.exp @@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ [list debug]]} { return -1 } -if { ![runto_main] } then { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp index 6ef56d3..71d915d 100644 --- a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp +++ b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp @@ -33,7 +33,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { return -1 } -if ![runto_main] then { +if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.reverse/ppc_record_test_isa_2_06.exp b/gdb/testsuite/gdb.reverse/ppc_record_test_isa_2_06.exp index 066d307..bca7399 100644 --- a/gdb/testsuite/gdb.reverse/ppc_record_test_isa_2_06.exp +++ b/gdb/testsuite/gdb.reverse/ppc_record_test_isa_2_06.exp @@ -37,18 +37,18 @@ set gen_src record_test_isa_2_06.c set executable record_test_isa_2_06 set options [list debug] -if {![istarget "powerpc*"]} then { +if {![istarget "powerpc*"]} { verbose "Skipping PowerPC ISA 2.06 instruction record_test_2_06." return } -if {[build_executable "failed to prepare" $executable $srcfile $options] == -1} then { +if {[build_executable "failed to prepare" $executable $srcfile $options] == -1} { return -1 } clean_restart $executable -if ![runto_main] then { +if {![runto_main]} { untested "could not run to main" return } diff --git a/gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp b/gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp index 79f04f6..b4cddfa 100644 --- a/gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp +++ b/gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp @@ -37,19 +37,19 @@ standard_testfile set gen_src record_test_isa_3_1.c set executable record_test_isa_3_1 -if {![istarget "powerpc*"] || [skip_power_isa_3_1_tests] } then { +if {![istarget "powerpc*"] || [skip_power_isa_3_1_tests]} { verbose "Skipping PowerPC ISA 3.1 instruction record_test." return } set options [list additional_flags=-mcpu=power10 debug] -if {[build_executable "failed to prepare" $executable $srcfile $options] == -1} then { +if {[build_executable "failed to prepare" $executable $srcfile $options] == -1} { return -1 } clean_restart $executable -if ![runto_main] then { +if {![runto_main]} { untested "could not run to main" return } diff --git a/gdb/testsuite/gdb.reverse/sigall-precsave.exp b/gdb/testsuite/gdb.reverse/sigall-precsave.exp index 991a6b0..d876175 100644 --- a/gdb/testsuite/gdb.reverse/sigall-precsave.exp +++ b/gdb/testsuite/gdb.reverse/sigall-precsave.exp @@ -47,7 +47,7 @@ proc test_one_sig {nextsig} { set need_another_continue 1 set missed_handler 0 - if $this_sig_supported then { + if {$this_sig_supported} { if { $thissig == "IO" } { setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu" } @@ -66,7 +66,7 @@ proc test_one_sig {nextsig} { } } - if $need_another_continue then { + if {$need_another_continue} { if { $thissig == "URG" } { setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu" } @@ -86,7 +86,7 @@ proc test_one_sig {nextsig} { } } - if { $missed_handler == "0" } then { + if {$missed_handler == "0"} { set testmsg "advance to $nextsig" gdb_test_multiple "signal 0" $testmsg { -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" { @@ -132,14 +132,14 @@ proc test_one_sig_reverse {prevsig} { exp_continue } -re "Breakpoint.*kill.*$gdb_prompt " { - if { $saw_signal } then { + if {$saw_signal} { pass "$testmsg (handled)" } else { xfail "$testmsg (handled)" } } -re "No more reverse-execution history.*kill.*$gdb_prompt " { - if { $saw_signal } then { + if {$saw_signal} { pass "$testmsg (handled)" } else { xfail "$testmsg (handled)" diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.exp b/gdb/testsuite/gdb.reverse/sigall-reverse.exp index 36fdb74..7078067 100644 --- a/gdb/testsuite/gdb.reverse/sigall-reverse.exp +++ b/gdb/testsuite/gdb.reverse/sigall-reverse.exp @@ -47,7 +47,7 @@ proc test_one_sig {nextsig} { set need_another_continue 1 set missed_handler 0 - if $this_sig_supported then { + if {$this_sig_supported} { if { $thissig == "IO" } { setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu" } @@ -72,7 +72,7 @@ proc test_one_sig {nextsig} { } } - if $need_another_continue then { + if {$need_another_continue} { if { $thissig == "URG" } { setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu" } @@ -92,7 +92,7 @@ proc test_one_sig {nextsig} { } } - if { $missed_handler == "0" } then { + if {$missed_handler == "0"} { set testmsg "advance to $nextsig" gdb_test_multiple "signal 0" $testmsg { -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" { @@ -138,14 +138,14 @@ proc test_one_sig_reverse {prevsig} { exp_continue } -re "Breakpoint.*kill.*$gdb_prompt " { - if { $saw_signal } then { + if {$saw_signal} { pass "$testmsg (handled)" } else { xfail "$testmsg (handled)" } } -re "No more reverse-execution history.*kill.*$gdb_prompt " { - if { $saw_signal } then { + if {$saw_signal} { pass "$testmsg (handled)" } else { xfail "$testmsg (handled)" diff --git a/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp index 4a81a61..21844e5 100644 --- a/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp +++ b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp @@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] then { +if {![runto_main]} { untested "could not run to main" continue } |