From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 600E4385516B; Mon, 28 Nov 2022 21:05:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 600E4385516B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669669510; bh=DKfFP4Ygfmgz9GUfLAupIrqzh2jb0QvdVG3nH6FL9po=; h=From:To:Subject:Date:From; b=KJicWX73TqXWqYTAPLDek4dl81Qvc7C6vl4Gjo8qtlbRuFymj4ssJsX6oc7xTQiK2 aM+Gq2RKLe0ZA655MlCoFNrA7++bPmg1QK8M4T2HelABAXD99362RWAbf/MhbaCLJV a7kj/6huBBAha198UdNlsdHXp36WOFZ3cj30G3DQ= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: remove use of then keyword from gdb.trace/*.exp X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: b8ffa8b32737636f1579fc164c625fe41abd61d8 X-Git-Newrev: 89c6d320b24567b6385e9dd92b3d4671c9796143 Message-Id: <20221128210510.600E4385516B@sourceware.org> Date: Mon, 28 Nov 2022 21:05:10 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D89c6d320b245= 67b6385e9dd92b3d4671c9796143 commit 89c6d320b24567b6385e9dd92b3d4671c9796143 Author: Andrew Burgess Date: Mon Nov 14 14:18:33 2022 +0000 gdb/testsuite: remove use of then keyword from gdb.trace/*.exp =20 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. =20 This commit removes all use of the 'then' keyword from the gdb.trace/ test script directory. =20 There should be no changes in what is tested after this commit. Diff: --- gdb/testsuite/gdb.trace/actions.exp | 4 ++-- gdb/testsuite/gdb.trace/backtrace.exp | 4 ++-- gdb/testsuite/gdb.trace/change-loc.exp | 2 +- gdb/testsuite/gdb.trace/collection.exp | 2 +- gdb/testsuite/gdb.trace/deltrace.exp | 6 +++--- gdb/testsuite/gdb.trace/infotrace.exp | 4 ++-- gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp | 2 +- gdb/testsuite/gdb.trace/mi-tsv-changed.exp | 2 +- gdb/testsuite/gdb.trace/no-attach-trace.exp | 2 +- gdb/testsuite/gdb.trace/packetlen.exp | 2 +- gdb/testsuite/gdb.trace/passc-dyn.exp | 6 +++--- gdb/testsuite/gdb.trace/passcount.exp | 4 ++-- gdb/testsuite/gdb.trace/report.exp | 4 ++-- gdb/testsuite/gdb.trace/save-trace.exp | 2 +- gdb/testsuite/gdb.trace/strace.exp | 2 +- gdb/testsuite/gdb.trace/tfind.exp | 10 +++++----- gdb/testsuite/gdb.trace/tracecmd.exp | 2 +- gdb/testsuite/gdb.trace/tspeed.exp | 4 ++-- gdb/testsuite/gdb.trace/tsv.exp | 6 +++--- gdb/testsuite/gdb.trace/unavailable.exp | 2 +- gdb/testsuite/gdb.trace/while-dyn.exp | 2 +- gdb/testsuite/gdb.trace/while-stepping.exp | 2 +- 22 files changed, 38 insertions(+), 38 deletions(-) diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/= actions.exp index c14fb27e3f6..397b30e484b 100644 --- a/gdb/testsuite/gdb.trace/actions.exp +++ b/gdb/testsuite/gdb.trace/actions.exp @@ -42,7 +42,7 @@ gdb_file_cmd $binfile # all subsequent line numbers are relative to this first one (baseline) =20 set baseline [gdb_find_recursion_test_baseline $srcfile] -if { $baseline =3D=3D -1 } then { +if {$baseline =3D=3D -1} { fail "could not find gdb_recursion_test function" return } @@ -57,7 +57,7 @@ gdb_delete_tracepoints set trcpt1 [gdb_gettpnum gdb_c_test] set trcpt2 [gdb_gettpnum gdb_asm_test] set trcpt3 [gdb_gettpnum $testline1] -if { $trcpt1 <=3D 0 || $trcpt2 <=3D 0 || $trcpt3 <=3D 0 } then { +if {$trcpt1 <=3D 0 || $trcpt2 <=3D 0 || $trcpt3 <=3D 0} { fail "setting tracepoints" return } diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trac= e/backtrace.exp index ec068b20d4a..20f0a388afc 100644 --- a/gdb/testsuite/gdb.trace/backtrace.exp +++ b/gdb/testsuite/gdb.trace/backtrace.exp @@ -35,7 +35,7 @@ if ![runto_main] { return -1 } =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 =20 @@ -106,7 +106,7 @@ all tests in this module will fail." } } =20 -if { $return_me =3D=3D 1 } then { +if {$return_me =3D=3D 1} { return -1 } =20 diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.tra= ce/change-loc.exp index 5e31d0c77f6..4710b8d0952 100644 --- a/gdb/testsuite/gdb.trace/change-loc.exp +++ b/gdb/testsuite/gdb.trace/change-loc.exp @@ -53,7 +53,7 @@ if ![runto_main] { return -1 } =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return -1 } diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.tra= ce/collection.exp index c261b3c824d..c290684e0d8 100644 --- a/gdb/testsuite/gdb.trace/collection.exp +++ b/gdb/testsuite/gdb.trace/collection.exp @@ -796,7 +796,7 @@ proc gdb_trace_collection_test {} { =20 runto_main =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 } diff --git a/gdb/testsuite/gdb.trace/deltrace.exp b/gdb/testsuite/gdb.trace= /deltrace.exp index 1e2f10f7636..605223aa3db 100644 --- a/gdb/testsuite/gdb.trace/deltrace.exp +++ b/gdb/testsuite/gdb.trace/deltrace.exp @@ -43,7 +43,7 @@ gdb_file_cmd $binfile # define relative source line numbers: # all subsequent line numbers are relative to this first one (baseline) set baseline [gdb_find_recursion_test_baseline $srcfile] -if { $baseline =3D=3D -1 } then { +if {$baseline =3D=3D -1} { fail "could not find gdb_recursion_test function" return } @@ -81,7 +81,7 @@ gdb_delete_tracepoints set trcpt1 [gdb_gettpnum gdb_c_test] set trcpt2 [gdb_gettpnum gdb_asm_test] set trcpt3 [gdb_gettpnum $testline1] -if { $trcpt1 <=3D 0 || $trcpt2 <=3D 0 || $trcpt3 <=3D 0 } then { +if {$trcpt1 <=3D 0 || $trcpt2 <=3D 0 || $trcpt3 <=3D 0} { fail "setting tracepoints" return } @@ -159,7 +159,7 @@ gdb_delete_tracepoints set trcpt1 [gdb_gettpnum gdb_c_test] set trcpt2 [gdb_gettpnum gdb_asm_test] set trcpt3 [gdb_gettpnum $testline1] -if { $trcpt1 <=3D 0 || $trcpt2 <=3D 0 || $trcpt3 <=3D 0 } then { +if {$trcpt1 <=3D 0 || $trcpt2 <=3D 0 || $trcpt3 <=3D 0} { fail "setting tracepoints" return } diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trac= e/infotrace.exp index 1504fb36508..912e29123d3 100644 --- a/gdb/testsuite/gdb.trace/infotrace.exp +++ b/gdb/testsuite/gdb.trace/infotrace.exp @@ -47,7 +47,7 @@ gdb_file_cmd $binfile gdb_delete_tracepoints set c_test_num [gdb_gettpnum gdb_c_test] set asm_test_num [gdb_gettpnum gdb_asm_test] -if { $c_test_num <=3D 0 || $asm_test_num <=3D 0 } then { +if {$c_test_num <=3D 0 || $asm_test_num <=3D 0} { fail "setting tracepoints" return } @@ -111,7 +111,7 @@ if {[gdb_test "" "Breakpoint ${decimal}, main.*" "run t= o main"] !=3D 0} { return -1 } =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 } diff --git a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp b/gdb/testsu= ite/gdb.trace/mi-tracepoint-changed.exp index 517e0394e06..abf5fec1ba2 100644 --- a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp +++ b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp @@ -69,7 +69,7 @@ proc test_reconnect { } { clean_restart $executable gdb_load_shlib $lib_sl1 gdb_load_shlib $lib_sl2 - if ![runto_main] then { + if {![runto_main]} { return 0 } # Create tracepoints on marker and main, and leave them in the diff --git a/gdb/testsuite/gdb.trace/mi-tsv-changed.exp b/gdb/testsuite/gdb= .trace/mi-tsv-changed.exp index 96251c900e7..a2cfa70b8f3 100644 --- a/gdb/testsuite/gdb.trace/mi-tsv-changed.exp +++ b/gdb/testsuite/gdb.trace/mi-tsv-changed.exp @@ -151,7 +151,7 @@ proc test_upload_tsv { } { } =20 clean_restart $testfile - if ![runto_main] then { + if {![runto_main]} { return 0 } =20 diff --git a/gdb/testsuite/gdb.trace/no-attach-trace.exp b/gdb/testsuite/gd= b.trace/no-attach-trace.exp index b16ca83afa6..67a908de575 100644 --- a/gdb/testsuite/gdb.trace/no-attach-trace.exp +++ b/gdb/testsuite/gdb.trace/no-attach-trace.exp @@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $s= rcfile debug]} { # can start programs ("run"), such as e.g., extended-remote gdbserver. clean_restart $testfile =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 } diff --git a/gdb/testsuite/gdb.trace/packetlen.exp b/gdb/testsuite/gdb.trac= e/packetlen.exp index 9f019acaa00..0330e82c1a0 100644 --- a/gdb/testsuite/gdb.trace/packetlen.exp +++ b/gdb/testsuite/gdb.trace/packetlen.exp @@ -37,7 +37,7 @@ gdb_test "tfind none" ".*" "" runto_main gdb_reinitialize_dir $srcdir/$subdir =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 =20 diff --git a/gdb/testsuite/gdb.trace/passc-dyn.exp b/gdb/testsuite/gdb.trac= e/passc-dyn.exp index 747e4207dd0..63f4788d07b 100644 --- a/gdb/testsuite/gdb.trace/passc-dyn.exp +++ b/gdb/testsuite/gdb.trace/passc-dyn.exp @@ -34,7 +34,7 @@ gdb_load $binfile runto_main gdb_reinitialize_dir $srcdir/$subdir =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 =20 @@ -50,7 +50,7 @@ if { ![gdb_target_supports_trace] } then { =20 set baseline [gdb_find_recursion_test_baseline $srcfile] =20 -if { $baseline =3D=3D -1 } then { +if {$baseline =3D=3D -1} { fail "could not find gdb_recursion_test function" return } @@ -74,7 +74,7 @@ gdb_delete_tracepoints set tdp2 [gdb_gettpnum "$testline2"] set tdp3 [gdb_gettpnum "$testline3"] set tdp4 [gdb_gettpnum "$testline4"] -if { $tdp2 <=3D 0 || $tdp3 <=3D 0 || $tdp4 <=3D 0 } then { +if {$tdp2 <=3D 0 || $tdp3 <=3D 0 || $tdp4 <=3D 0} { fail "setting tracepoints" return } diff --git a/gdb/testsuite/gdb.trace/passcount.exp b/gdb/testsuite/gdb.trac= e/passcount.exp index 52c95c53367..bbb3be7d583 100644 --- a/gdb/testsuite/gdb.trace/passcount.exp +++ b/gdb/testsuite/gdb.trace/passcount.exp @@ -40,7 +40,7 @@ gdb_file_cmd $binfile # define relative source line numbers: # all subsequent line numbers are relative to this first one (baseline) set baseline [gdb_find_recursion_test_baseline $srcfile] -if { $baseline =3D=3D -1 } then { +if {$baseline =3D=3D -1} { fail "could not find gdb_recursion_test function" return } @@ -55,7 +55,7 @@ gdb_delete_tracepoints set trcpt1 [gdb_gettpnum gdb_c_test] set trcpt2 [gdb_gettpnum gdb_asm_test] set trcpt3 [gdb_gettpnum $testline1] -if { $trcpt1 <=3D 0 || $trcpt2 <=3D 0 || $trcpt3 <=3D 0 } then { +if {$trcpt1 <=3D 0 || $trcpt2 <=3D 0 || $trcpt3 <=3D 0} { fail "setting tracepoints" return } diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/r= eport.exp index 7b3678d29f3..33e803bd4fe 100644 --- a/gdb/testsuite/gdb.trace/report.exp +++ b/gdb/testsuite/gdb.trace/report.exp @@ -35,7 +35,7 @@ gdb_load $binfile runto_main gdb_reinitialize_dir $srcdir/$subdir =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 =20 @@ -111,7 +111,7 @@ all tests in this module will fail." }=20 } =20 -if { $return_me =3D=3D 1 } then { +if {$return_me =3D=3D 1} { return -1 } =20 diff --git a/gdb/testsuite/gdb.trace/save-trace.exp b/gdb/testsuite/gdb.tra= ce/save-trace.exp index 0eac0b5503c..ddeb20360aa 100644 --- a/gdb/testsuite/gdb.trace/save-trace.exp +++ b/gdb/testsuite/gdb.trace/save-trace.exp @@ -41,7 +41,7 @@ gdb_file_cmd $binfile # define relative source line numbers: # all subsequent line numbers are relative to this first one (baseline) set baseline [gdb_find_recursion_test_baseline $srcfile] -if { $baseline =3D=3D -1 } then { +if {$baseline =3D=3D -1} { fail "could not find gdb_recursion_test function" return } diff --git a/gdb/testsuite/gdb.trace/strace.exp b/gdb/testsuite/gdb.trace/s= trace.exp index d015381899b..2e754891903 100644 --- a/gdb/testsuite/gdb.trace/strace.exp +++ b/gdb/testsuite/gdb.trace/strace.exp @@ -370,7 +370,7 @@ gdb_load_shlib $libipa if ![runto_main] { return -1 } -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { # At this point, the socket file has been created. We must make sure = it is # removed when we return here. GDB detaches inferior so that the sock= et # file can be removed. Note that GDB simply kill inferior doesn't rem= ove diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tf= ind.exp index 57b7b2fad70..66b744fc11b 100644 --- a/gdb/testsuite/gdb.trace/tfind.exp +++ b/gdb/testsuite/gdb.trace/tfind.exp @@ -65,7 +65,7 @@ gdb_test "help tfind trace" "Select a trace frame by trac= epoint number.*" \ runto_main gdb_reinitialize_dir $srcdir/$subdir =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 =20 @@ -77,7 +77,7 @@ if { ![gdb_target_supports_trace] } then { # define relative source line numbers: # all subsequent line numbers are relative to this first one (baseline) set baseline [gdb_find_recursion_test_baseline $srcfile] -if { $baseline =3D=3D -1 } then { +if {$baseline =3D=3D -1} { fail "could not find gdb_recursion_test function" return } @@ -123,7 +123,7 @@ gdb_test_multiple "tstart" "6.1: tstart" { } } =20 -if { $return_me =3D=3D 1 } then { +if {$return_me =3D=3D 1} { return -1 } =20 @@ -154,7 +154,7 @@ gdb_test_multiple "tstop" "7.1: tstop" { } } =20 -if { $return_me =3D=3D 1 } then { +if {$return_me =3D=3D 1} { return -1 } =20 @@ -164,7 +164,7 @@ gdb_test "tstatus" "Trace stopped by a tstop command.*"= \ =20 ## record starting PC set save_pc [gdb_readexpr "(unsigned long) \$pc"] -if { $save_pc =3D=3D -1 } then { +if {$save_pc =3D=3D -1} { fail "could not read PC" return } diff --git a/gdb/testsuite/gdb.trace/tracecmd.exp b/gdb/testsuite/gdb.trace= /tracecmd.exp index c2ec95a7a4e..4bc16b1d344 100644 --- a/gdb/testsuite/gdb.trace/tracecmd.exp +++ b/gdb/testsuite/gdb.trace/tracecmd.exp @@ -40,7 +40,7 @@ gdb_file_cmd $binfile # define relative source line numbers: # all subsequent line numbers are relative to this first one (baseline) set baseline [gdb_find_recursion_test_baseline $srcfile] -if { $baseline =3D=3D -1 } then { +if {$baseline =3D=3D -1} { fail "could not find gdb_recursion_test function" return } diff --git a/gdb/testsuite/gdb.trace/tspeed.exp b/gdb/testsuite/gdb.trace/t= speed.exp index ba64176596b..80ec962c042 100644 --- a/gdb/testsuite/gdb.trace/tspeed.exp +++ b/gdb/testsuite/gdb.trace/tspeed.exp @@ -139,7 +139,7 @@ proc_with_prefix gdb_fast_trace_speed_test { } { } =20 # If the fast tracepoint couldn't be set, don't bother with the run. - if { $run_ftrace =3D=3D 1 } then { + if {$run_ftrace =3D=3D 1} { =20 # Begin the test. run_trace_experiment @@ -160,7 +160,7 @@ gdb_load_shlib $ipalib =20 runto_main =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 } diff --git a/gdb/testsuite/gdb.trace/tsv.exp b/gdb/testsuite/gdb.trace/tsv.= exp index abf858963de..e51e7d654b1 100644 --- a/gdb/testsuite/gdb.trace/tsv.exp +++ b/gdb/testsuite/gdb.trace/tsv.exp @@ -113,7 +113,7 @@ runto_main gdb_reinitialize_dir $srcdir/$subdir =20 # The rest of the testing needs actual tracing to work. -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 } @@ -121,7 +121,7 @@ if { ![gdb_target_supports_trace] } then { gdb_delete_tracepoints set trcpt1 [gdb_gettpnum gdb_c_test] =20 -if { $trcpt1 <=3D 0 } then { +if {$trcpt1 <=3D 0} { fail "setting tracepoints" return } @@ -200,7 +200,7 @@ gdb_test_multiple "target ctf ${tracefile}.ctf" "" { # Restart. clean_restart ${binfile} =20 -if ![runto_main] then { +if {![runto_main]} { return } =20 diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.tr= ace/unavailable.exp index 9e1124edc6e..82a6014c1bc 100644 --- a/gdb/testsuite/gdb.trace/unavailable.exp +++ b/gdb/testsuite/gdb.trace/unavailable.exp @@ -731,7 +731,7 @@ proc gdb_trace_collection_test {} { =20 runto_main =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 } diff --git a/gdb/testsuite/gdb.trace/while-dyn.exp b/gdb/testsuite/gdb.trac= e/while-dyn.exp index c77bad73c2d..0085e0aad48 100644 --- a/gdb/testsuite/gdb.trace/while-dyn.exp +++ b/gdb/testsuite/gdb.trace/while-dyn.exp @@ -36,7 +36,7 @@ gdb_load $binfile runto_main gdb_reinitialize_dir $srcdir/$subdir =20 -if { ![gdb_target_supports_trace] } then { +if {![gdb_target_supports_trace]} { unsupported "current target does not support trace" return 1 } diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb= .trace/while-stepping.exp index 77641b8a130..3d1b29bab02 100644 --- a/gdb/testsuite/gdb.trace/while-stepping.exp +++ b/gdb/testsuite/gdb.trace/while-stepping.exp @@ -44,7 +44,7 @@ gdb_file_cmd $binfile =20 gdb_delete_tracepoints set trcpt1 [gdb_gettpnum gdb_c_test] -if { $trcpt1 <=3D 0 } then { +if {$trcpt1 <=3D 0} { fail "could not find gdb_c_test function" return }