]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Further tclint fixing
authorTom de Vries <tdevries@suse.de>
Tue, 30 Sep 2025 19:32:50 +0000 (21:32 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 30 Sep 2025 19:32:50 +0000 (21:32 +0200)
Currently stable tclint (v6.0.1) as used in pre-commit doesn't check code that
is passed as arguments to commands specific to the gdb testsuite [1], like
with_test_prefix:
...
with_test_prefix foo {
  ...
}
...

I wrote a rudimentary tclint patch handling this, skipping the dwarf assembler
procs.

Fix the additional issues found.

[1] https://github.com/nmoroze/tclint/issues/121

48 files changed:
gdb/testsuite/gdb.ada/big_packed_array.exp
gdb/testsuite/gdb.ada/finish-var-size.exp
gdb/testsuite/gdb.ada/huge.exp
gdb/testsuite/gdb.ada/import.exp
gdb/testsuite/gdb.ada/uninitialized-variable-record.exp
gdb/testsuite/gdb.ada/verylong.exp
gdb/testsuite/gdb.base/args.exp
gdb/testsuite/gdb.base/fission-macro.exp
gdb/testsuite/gdb.base/huge.exp
gdb/testsuite/gdb.base/inferior-args.exp
gdb/testsuite/gdb.base/startup-with-shell.exp
gdb/testsuite/gdb.base/utf8-identifiers.exp
gdb/testsuite/gdb.btrace/vdso.exp
gdb/testsuite/gdb.compile/compile-ifunc.exp
gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
gdb/testsuite/gdb.dwarf2/dw-form-strx-out-of-bounds.exp
gdb/testsuite/gdb.dwarf2/dw-form-strx.exp
gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
gdb/testsuite/gdb.fortran/array-slices.exp
gdb/testsuite/gdb.fortran/associated.exp
gdb/testsuite/gdb.fortran/assumedrank.exp
gdb/testsuite/gdb.fortran/huge.exp
gdb/testsuite/gdb.fortran/lbound-ubound.exp
gdb/testsuite/gdb.fortran/rank.exp
gdb/testsuite/gdb.fortran/shape.exp
gdb/testsuite/gdb.fortran/size.exp
gdb/testsuite/gdb.fortran/sizeof.exp
gdb/testsuite/gdb.gdb/unittest.exp
gdb/testsuite/gdb.linespec/cpcompletion.exp
gdb/testsuite/gdb.linespec/cpls-abi-tag.exp
gdb/testsuite/gdb.multi/multi-arch.exp
gdb/testsuite/gdb.multi/multi-re-run.exp
gdb/testsuite/gdb.opt/inline-cmds.exp
gdb/testsuite/gdb.opt/inline-entry.exp
gdb/testsuite/gdb.perf/skip-command.exp
gdb/testsuite/gdb.python/py-record-btrace.exp
gdb/testsuite/gdb.python/py-section-script.exp
gdb/testsuite/gdb.rocm/displaced-stepping.exp
gdb/testsuite/gdb.rocm/precise-memory-exec.exp
gdb/testsuite/gdb.rocm/precise-memory-fork.exp
gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.exp
gdb/testsuite/gdb.rocm/precise-memory.exp
gdb/testsuite/gdb.rocm/simple.exp
gdb/testsuite/gdb.server/exit-multiple-threads.exp
gdb/testsuite/gdb.server/reconnect-ctrl-c.exp
gdb/testsuite/gdb.server/server-kill.exp
gdb/testsuite/gdb.tui/winheight.exp
gdb/testsuite/gdb.tui/wrap-line.exp

index b1566afc5345976c37c9aa9d38ce646abed41946..aa328a56921c63ac449b5ef2b65385308f6973fb 100644 (file)
@@ -38,7 +38,7 @@ foreach_gnat_encoding scenario flags {all minimal} {
     gdb_test "print good" \
        "= \\(false <repeats 196 times>\\)" \
 
-    set have_xfail [expr $old_gcc && [string equal "$scenario" "minimal"]]
+    set have_xfail [expr {$old_gcc && [string equal "$scenario" "minimal"]}]
 
     set re "= \\(false <repeats 196 times>\\)"
     set re_xfail "= \\(0 => 0 <repeats 25 times>\\)"
index 6365c95890576e6568edbdc6f4f6b93219f01060..895a24821c05691ce9159ba4370122a6b45f7a10 100644 (file)
@@ -18,7 +18,7 @@ load_lib "ada.exp"
 require allow_ada_tests
 
 # GCC 12 has the needed fix.
-require {expr [gcc_major_version] >= 12}
+require {expr {[gcc_major_version] >= 12}}
 
 standard_ada_testfile p
 
index fa94fa00d75ac9eb778a64cd19c84e9fe9b217f7..7bf70037f385212a13ee1dfc631e61217bb32a7c 100644 (file)
@@ -46,7 +46,7 @@ for { set size $max } { $size >= $min } { set size [expr {$size / 2}] } {
     set compilation_succeeded 1
     break
 }
-require {expr $compilation_succeeded}
+require {expr {$compilation_succeeded}}
 
 foreach_with_prefix varname {Arr Packed_Arr} {
     clean_restart ${testfile}
index 51ce7faab793aaa14cca10a55eb80ec9f0b50930..d7d11e13f50376ba5c04772f5dd57bfedb860b7a 100644 (file)
@@ -21,7 +21,7 @@ require allow_ada_tests
 # declarations only") is required.  The commit makes sure that file-scope
 # function and variable declarations are emitted in dwarf.  This allows the
 # description of imported entries, making them available to the debugger.
-require {expr [gcc_major_version] >= 8}
+require {expr {[gcc_major_version] >= 8}}
 
 standard_ada_testfile prog
 
index 0e198cb216791df28ad48e4c81c4522c0ac52016..4366b200b38bb7b5574a73ab89044ae6350c494d 100644 (file)
@@ -91,7 +91,7 @@ for { set i 0 } { $i < 256 } { incr i } {
            continue
        }
 
-       if { [expr $size > $offset_d] } {
+       if {$size > $offset_d} {
            # Field d fits in the size.
            continue
        }
@@ -101,7 +101,7 @@ for { set i 0 } { $i < 256 } { incr i } {
     }
 }
 
-require {expr $interesting_discriminator != -1}
+require {expr {$interesting_discriminator != -1}}
 
 foreach lang [gdb_supported_languages] {
     with_test_prefix $lang {
index de5fd0417a350c8261e2753c769efcfc0c16c544..da1ce793885ca52d2d87f1c36c0ff7777e6fa3df 100644 (file)
@@ -41,7 +41,7 @@ gdb_test_multiple "ptype Long_Long_Long_Integer" "" {
     }
 }
 
-require {expr $lll_int_size == 8 || $lll_int_size == 16}
+require {expr {$lll_int_size == 8 || $lll_int_size == 16}}
 
 gdb_test "print x" " = $max"
 gdb_test "print x / 2" " = [expr {$max / 2}]"
index 990f3a110575ca3d65177e1cec2e65962f5ae8be..07101da30aabe40a06a361b8662630b913afc182 100644 (file)
@@ -21,7 +21,7 @@ require {!target_info exists noargs}
 # This test requires starting new inferior processes, skip it if the target
 # board is a stub.
 require !use_gdb_stub
-require {expr [have_startup_shell] != -1}
+require {expr {[have_startup_shell] != -1}}
 
 standard_testfile
 
index c86a1a47d59c518d01268ae4b061f029e1fd7510..0680da69e089c02cb51c6dda300ad40180ea2363 100644 (file)
@@ -14,7 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 # Gcc 14 is the first release containing the fix for PR debug/111409.
-require {expr [gcc_major_version] >= 14}
+require {expr {[gcc_major_version] >= 14}}
 
 standard_testfile .c -2.c
 
index 0c307bba7f49ddf2e2367fc94765ee0cd6dac767..01bc9ea4b7147d318adbd0cd3ecdb1e7aeaf9d0f 100644 (file)
@@ -39,7 +39,7 @@ for { set size $max } { $size >= $min } { set size [expr {$size / 2}] } {
     set compilation_succeeded 1
     break
 }
-require {expr $compilation_succeeded}
+require {expr {$compilation_succeeded}}
 
 # Start with a fresh gdb.
 clean_restart
index 2b52d8747a1de1da04340e693364561e26f05c99..6ac25fccdfb31bc89ed0031dce25ebdbbbf6c8bf 100644 (file)
@@ -17,7 +17,7 @@
 
 # This does not work on boards that don't support inferior arguments.
 require {!target_info exists noargs}
-require {expr [have_startup_shell] != -1}
+require {expr {[have_startup_shell] != -1}}
 
 standard_testfile .c
 
index a6ebb57c00e72996944939e82d2a26c1b368a398..6872369c9889091df51ecb1484edcaca3ef1ae90 100644 (file)
@@ -22,7 +22,7 @@ require !use_gdb_stub
 # (via dejagnu) yet.
 require {!is_remote target}
 
-require {expr [have_startup_shell] != -1}
+require {expr {[have_startup_shell] != -1}}
 
 standard_testfile
 
index 46078481398e03174afcf79cbc039930ae621be2..8d19dbcb6f2d4e739e3f1a607a9321370b8e60b0 100644 (file)
@@ -23,7 +23,7 @@ load_lib completion-support.exp
 
 if { [is_c_compiler_gcc] } {
     # Gcc fully supports fextended-identifiers starting GCC 5.
-    require {expr [gcc_major_version] >= 5}
+    require {expr {[gcc_major_version] >= 5}}
 }
 require {have_host_locale C.UTF-8}
 
index 0484da18ac040de92d7eaf2bb5c4889a2c6899fd..8bf63ac6506f97686eb0d70c5f3354a2ea7f9020 100644 (file)
@@ -47,7 +47,7 @@ with_test_prefix "replay" {
        set replay_gettimeofday [capture_command_output "disassemble gettimeofday" ""]
 
        # the two disassemblies must be identical
-       if ![string compare $live_gettimeofday $replay_gettimeofday]  {
+       if {![string compare $live_gettimeofday $replay_gettimeofday]} {
                pass "disassemble gettimeofday"
        } else {
                fail "disassemble gettimeofday"
index 72c1142a40ffff68302c33d8360841113c8c6224..dbe84d54f64dc76c9a0d91ae514a1bcafc8205bd 100644 (file)
@@ -35,7 +35,7 @@ with_test_prefix "nodebug" {
        return -1
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -65,7 +65,7 @@ with_test_prefix "debug" {
        return -1
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
     # gnu_ifunc (10): error: too many arguments to function 'gnu_ifunc'
index 292be705f05ce915373b7c6551d2f8652bde0b2f..9078068c8fe9eb52513e9f13746e76336410b295 100644 (file)
@@ -160,7 +160,7 @@ proc_with_prefix no_url { } {
     # Generate a core file and test that GDB cannot find the
     # executable.
     clean_restart ${::testfile}2
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
index cb24b19a1319da904eb4655f84c1d8ec4bacca06..f312885d4f399d912adf666d732429781244dac3 100644 (file)
@@ -24,7 +24,7 @@ require !readnow
 
 set prepare_for_testing_done 0
 source $srcdir/$subdir/dw-form-strx.exp.tcl
-require {expr $prepare_for_testing_done == 1}
+require {expr {$prepare_for_testing_done == 1}}
 
 set re_dwarf_error \
     [string_list_to_regexp \
index 3f739c4adea731eeba3492f65dc6511ba9999c7d..715331469d65ed6aa7c5a5db88ec4147dbac00c6 100644 (file)
@@ -20,6 +20,6 @@ set int_str_idx 0
 
 set prepare_for_testing_done 0
 source $srcdir/$subdir/dw-form-strx.exp.tcl
-require {expr $prepare_for_testing_done == 1}
+require {expr {$prepare_for_testing_done == 1}}
 
 gdb_test "ptype global_var" "type = int"
index 96287dd09868d6b766392814a6ff4d3f4c9691fe..7d8bc211d3e7faf3e4079493a2b3bc7f6fd61326 100644 (file)
@@ -84,7 +84,7 @@ gdb_test_multiple "ptype foo" "" {
     }
 }
 
-require {expr $cu1_expanded == 1}
+require {expr {$cu1_expanded == 1}}
 
 # Now check that cu2 has an address range starting at main.
 set cu2_blockvector_re \
index 7d4f96e041c855e9b7c6cbe5347c86ab6725be9d..0a7851e17041d2029e6bfd6d25a400fe66ae0652 100644 (file)
@@ -132,7 +132,7 @@ proc run_test { repack } {
                }
            }
 
-           if ($found_final_breakpoint) {
+           if {$found_final_breakpoint} {
                break
            }
 
index 929722002706108e2937396ecae48203571f1930..6d1a6d8b18321f760b5c3c248e0227f459860458 100644 (file)
@@ -50,7 +50,7 @@ while { $test_count < 500 } {
            }
        }
 
-       if ($found_final_breakpoint) {
+       if {$found_final_breakpoint} {
            break
        }
 
index 45e8c09469b29e3ffe2e989be5f28b9928d0baf4..ce53841529b334d0b8e651050c1f25676cb63c1b 100644 (file)
@@ -64,7 +64,7 @@ while { $test_count < 500 } {
           continue
        }
 
-       if ($found_final_breakpoint) {
+       if {$found_final_breakpoint} {
            break
        }
 
index f7c50d7a8979288dda0372c65633314a284ace48..03ebdaac4bd34940e9c18f2d4276520a506089a1 100644 (file)
@@ -46,7 +46,7 @@ for { set size [expr {$max}] } { $size >= $min } { set size [expr {$size / 2}] }
     set compilation_succeeded 1
     break
 }
-require {expr $compilation_succeeded}
+require {expr {$compilation_succeeded}}
 
 # Start with a fresh gdb.
 clean_restart ${::testfile}
index 143c5be98a6785a797ec6ff25842e99bff16b788..75b8febe0c87985688596c8b10c77ee0fe863373 100644 (file)
@@ -61,7 +61,7 @@ while { $test_count < 500 } {
            }
        }
 
-       if ($found_dealloc_breakpoint) {
+       if {$found_dealloc_breakpoint} {
            break
        }
 
index e998ead9cb176a2c991b5e80a1e5f5ec8503203f..1fe20c6f7d7cb3d4b34c1c83a9c8617d8588973d 100644 (file)
@@ -50,7 +50,7 @@ while { $test_count < 500 } {
            }
        }
 
-       if ($found_final_breakpoint) {
+       if {$found_final_breakpoint} {
            break
        }
 
index 7a6bc9beab9f5e5501d4e64b8440aef02e57616c..4bcc2e7a34908f365893359f53cd0537a53f8fa9 100644 (file)
@@ -50,7 +50,7 @@ while { $test_count < 500 } {
            }
        }
 
-       if ($found_final_breakpoint) {
+       if {$found_final_breakpoint} {
            break
        }
 
index 5bc7db2128706fe4fcd85698ab20c9a264f78067..8cd702d2f88178b3411916b3416cda85d974c590 100644 (file)
@@ -55,7 +55,7 @@ while { $test_count < 600 } {
            }
        }
 
-       if ($found_dealloc_breakpoint) {
+       if {$found_dealloc_breakpoint} {
            break
        }
 
index c0a9fd3c0fef43375c02df4f42ad2c87760efb8b..d7eeb387e1b2aadfde6f32b30132eaf6b17512fd 100644 (file)
@@ -60,7 +60,7 @@ while { $test_count < 200 } {
            }
        }
 
-       if ($found_final_breakpoint) {
+       if {$found_final_breakpoint} {
            break
        }
 
index 38955ca34f90c3b7a94ca108f88b704d482048a9..500389dd70bf24bc41b70621dd749cd45a8efa10 100644 (file)
@@ -115,7 +115,7 @@ if { $self_tests_enabled && ![is_remote host] } {
     # initialization order of GDB.
     with_test_prefix "reversed initialization" {
        save_vars { env(GDB_REVERSE_INIT_FUNCTIONS) } {
-           if [info exists env(GDB_REVERSE_INIT_FUNCTIONS)] {
+           if {[info exists env(GDB_REVERSE_INIT_FUNCTIONS)]} {
                unset env(GDB_REVERSE_INIT_FUNCTIONS)
            } else {
                set env(GDB_REVERSE_INIT_FUNCTIONS) 1
index 2f1cc84a93410eca3a5750251c4787b49ea7de31..f33bd39c680ca0726d3594fb06fcd7e9a0710607 100644 (file)
@@ -1087,7 +1087,7 @@ proc_with_prefix incomplete-scope-colon {} {
                                          "${explicit_source} -function ${fqc}$prototype${fqc}"] {
                        set complete_line "b $location"
                        set start [string first $range_ss $complete_line]
-                       set end [expr ($start + [string length $range_ss])]
+                       set end [expr {($start + [string length $range_ss])}]
                        test_complete_prefix_range $complete_line $start $end
                        if {!$skip_check_bp} {
                            check_bp_locations_match_list "b $location" [list "$prototype"]
@@ -1200,7 +1200,7 @@ proc_with_prefix operator< {} {
                     "-function $function -label label1"] {
 
        set cmd "b $location"
-       set input_line [string range $cmd 0 [expr [string length $cmd] - 3]]
+       set input_line [string range $cmd 0 [expr {[string length $cmd] - 3}]]
 
        test_gdb_complete_unique $input_line $cmd
        test_gdb_complete_unique $cmd $cmd
index c2079255530481fe52999e81895887dcdef9c8fc..9388c7f17c790d94fcb3d681aaf13c015ebbcfb8 100644 (file)
@@ -26,7 +26,7 @@ if { [test_compiler_info gcc-*] } {
     #   cpls-abi-tag.cc:71:26: error:
     #     ‘abi_tag’ attribute applied to non-function ‘s’
     # See gcc PR65046.
-    require {expr [gcc_major_version] >= 5}
+    require {expr {[gcc_major_version] >= 5}}
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile \
index b75009d24783165b1194c1d6163169377b85cadf..02c26ba13fe91bb35f6689cd6d2ddb7f76abcc4b 100644 (file)
@@ -53,11 +53,11 @@ if {[istarget "s390*-*-*"]} {
 }
 
 if { $march1 != "" } {
-    require "have_compile_and_link_flag $march1"
+    require {have_compile_and_link_flag $march1}
 }
 
 if { $march2 != "" } {
-    require "have_compile_and_link_flag $march2"
+    require {have_compile_and_link_flag $march2}
 }
 
 if { [build_executable "failed to prepare" ${exec1} "${srcfile1}" \
index 89d43a4b0d942ba52d2cde92afe28e9b0d71ef60..bf83043ea294807579d592a45fc23d4a45c38595 100644 (file)
@@ -96,7 +96,7 @@ proc test_re_run {re_run_inf} {
     foreach_with_prefix iter {1 2} {
        delete_breakpoints
 
-       if ![runto all_started] {
+       if {![runto all_started]} {
            return 0
        }
 
index e80d6f717fa97fb21294d34f124a581f225c69ae..4163d8fcd45fcd1cc7ffb3c4d5532740e0489282 100644 (file)
@@ -335,7 +335,7 @@ proc mi_cli_step {cli_output_re message} {
 # command run while the top interpreter is MI results in the expected
 # CLI output sent to MI's console.
 with_test_prefix "mi" {
-    if [mi_gdb_start] {
+    if {[mi_gdb_start]} {
        return
     }
     mi_gdb_load ${binfile}
index 0c6b0fb2ef5794e2b0e5146ec3054af1b6fa9cc0..227131ad331c8fdc38f069b67a0f6a5b4f7f4c3a 100644 (file)
@@ -33,7 +33,7 @@
 # case where DW_AT_entry_pc is not the first instruction of an inlined
 # function, as can be the case in gcc 8.x with the
 # -gstatement-frontiers work in place.
-require {expr ![is_c_compiler_gcc] || [supports_statement_frontiers]}
+require {expr {![is_c_compiler_gcc] || [supports_statement_frontiers]}}
 
 standard_testfile
 
index e59cb07157bb77136e7f70faf0826713733f160a..3a02cd54229628a5b54124392c40c51f977f39fc 100644 (file)
@@ -99,7 +99,7 @@ proc run_skip_bench { kind text } {
 
     for { set i 0 } { $i < 5 } { incr i } {
        with_test_prefix "iter $i" {
-           set nr_skips [expr $i * $SKIP_DIRECTIVE_COUNT]
+           set nr_skips [expr {$i * $SKIP_DIRECTIVE_COUNT}]
            install_skips $kind $text $nr_skips
            gdb_test_python_run \
                "SkipCommand\(\"skip-$kind-$nr_skips\", ${SKIP_STEP_COUNT}\)"
index 6dd3ae172390b9c644d5ac1fc3bdf2643ff2db2a..207161d3de5057e4af7796e1e233a8559ff6a609 100644 (file)
@@ -66,8 +66,8 @@ with_test_prefix "prepare record" {
     set v [linux_kernel_version]
     if { $v != {} } {
        set have_xfail \
-           [expr [version_compare [list 5 5 0] <= $v] \
-                && [version_compare $v < [list 6 1 0]]]
+           [expr {[version_compare [list 5 5 0] <= $v] \
+                      && [version_compare $v < [list 6 1 0]]}]
     }
     set nonl_re \[^\r\n\]
     set xfail_re \
index 9d4e48c0cf739f12bfba7e3ccf3213e7df2ea7c5..369c8872cbfab70cacc9cc03caf1f4467df0381c 100644 (file)
@@ -126,7 +126,7 @@ gdb_test "test-cmd 1 2 3" "test-cmd output, arg = 1 2 3"
 with_test_prefix "sepdebug" {
     gdb_exit
 
-    set result [catch "exec eu-strip -g -f ${binfile}.debug ${binfile}" output]
+    set result [catch {exec eu-strip -g -f ${binfile}.debug ${binfile}} output]
     verbose "result is $result"
     verbose "output is $output"
     if {$result != 0 || $output != ""} {
index 9e8abd4c475b450f17f1c6056fcc8360ce4eddb2..d26e4c635ae6e295ca1c19caa218ebdf7ed1172e 100644 (file)
@@ -32,7 +32,7 @@ proc do_test {} {
     gdb_load $::binfile
 
     with_rocm_gpu_lock {
-       if ![runto_main] {
+       if {![runto_main]} {
            return
        }
 
index 76be07816f855a3e59b6b502937a08b9e6a6b66e..24724463be420c20b94dd06ef61d19fd3afd6af4 100644 (file)
@@ -33,7 +33,7 @@ proc do_test { follow-exec-mode } {
     gdb_load $::binfile
 
     with_rocm_gpu_lock {
-       if ![runto_main] {
+       if {![runto_main]} {
            return
        }
 
index 23c1ebe6249f3a104d9a9f6aebe4d403d28a7b05..7559aecf5fe9f2c61808170d43ae79d0b5c2406a 100644 (file)
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare $testfile" $testfile $srcfile {debug
 }
 
 with_rocm_gpu_lock {
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
index da0a95a37f504873837d026f80d340e3922ef747..70c26c6241e3f0bac6b6bb71735c9530ad25915f 100644 (file)
@@ -33,7 +33,7 @@ proc do_test { } {
     gdb_load $::binfile
 
     with_rocm_gpu_lock {
-       if ![runto_main] {
+       if {![runto_main]} {
            return
        }
 
index 8f005596739f1c2a131e6eb35ae28f21328d38a1..4ea41ba90e4ca3520e8ae224db3ac5ea44260204 100644 (file)
@@ -32,7 +32,7 @@ proc do_test { } {
     gdb_load $::binfile
 
     with_rocm_gpu_lock {
-       if ![runto_main] {
+       if {![runto_main]} {
            return
        }
 
index 8f6ff3e4337e486ce31a371eb07931f16111d81d..6b2f08ef8430facdf86fbad5058ab0d68fe31a8c 100644 (file)
@@ -31,7 +31,7 @@ proc do_test {} {
     gdb_load $::binfile
 
     with_rocm_gpu_lock {
-       if ![runto_main] {
+       if {![runto_main]} {
            return
        }
 
index be29f9eeba06d17cab63e2c174c121f484a15383..48bb10fa51b548dd47d87306a543ad1d51f3a0f2 100644 (file)
@@ -138,8 +138,8 @@ foreach_with_prefix test { exit signal } {
     set func "run_${test}_test"
 
     set executable "$binfile-${test}"
-    if [build_executable "failed to prepare" $executable $srcfile \
-           [list debug pthreads additional_flags=-D${def}]] {
+    if {[build_executable "failed to prepare" $executable $srcfile \
+            [list debug pthreads additional_flags=-D${def}]]} {
        return -1
     }
 
index bcab2de93cd6787ee73419567b245e9eb7d4f43f..61aaaeae28ce77fe424e75f5d3527687d24c1301 100644 (file)
@@ -32,7 +32,7 @@ save_vars { GDBFLAGS } {
        set GDBFLAGS "$GDBFLAGS -ex \"set sysroot\""
     }
 
-    if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
+    if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
        return -1
     }
 }
index a9fcabb08ce89c595edc071856d6c0da9b090935..0c54918598c2041a9de4d933d1bb7cb13fba21a7 100644 (file)
@@ -82,7 +82,7 @@ proc kill_server {} {
 # Test issuing "tstatus" right after the connection is dropped.
 
 proc_with_prefix test_tstatus {} {
-    if ![prepare] {
+    if {![prepare]} {
        return
     }
 
@@ -104,7 +104,7 @@ proc_with_prefix test_tstatus {} {
 # is dropped.
 
 proc_with_prefix test_unwind_nosyms {} {
-    if ![prepare] {
+    if {![prepare]} {
        return
     }
 
@@ -121,7 +121,7 @@ proc_with_prefix test_unwind_nosyms {} {
 # dropped.
 
 proc_with_prefix test_unwind_syms {} {
-    if ![prepare] {
+    if {![prepare]} {
        return
     }
 
@@ -133,7 +133,7 @@ proc_with_prefix test_unwind_syms {} {
 # Test performing a stepi right after the connection is dropped.
 
 proc_with_prefix test_stepi {} {
-    if ![prepare] {
+    if {![prepare]} {
        return
     }
 
index 9b36c9815c80945387a4648757a50a7233d42066..38c7bcc88f109ab10a31acbb12c7c36b39a4a140 100644 (file)
@@ -99,14 +99,14 @@ Term::check_box "check for asm window" 0 0 80 15
 # The test then switches to the 'split' layout, and calculates the
 # expected window sizes.
 foreach_with_prefix cmd_size {20 12 5} {
-    set src_size_before [expr 24 - ${cmd_size} - 1]
-    set split_size [expr (24 - ${cmd_size}) / 2]
+    set src_size_before [expr {24 - ${cmd_size} - 1}]
+    set split_size [expr {(24 - ${cmd_size}) / 2}]
 
     if { $split_size < 3 } {
        # The minimum window size is 3, so force that.
        set src_size_after 3
        set asm_size_after 3
-    } elseif { [expr $split_size % 2] == 0 } {
+    } elseif { $split_size % 2 == 0 } {
        # The remaining space can be divided evenly between the two
        # windows.
        set src_size_after ${split_size}
@@ -115,7 +115,7 @@ foreach_with_prefix cmd_size {20 12 5} {
        # The space can't be divided evenly, the asm window will get
        # the extra line.
        set src_size_after ${split_size}
-       set asm_size_after [expr ${split_size} + 1]
+       set asm_size_after [expr {${split_size} + 1}]
     }
 
     Term::command "layout src"
@@ -125,5 +125,6 @@ foreach_with_prefix cmd_size {20 12 5} {
     # Both windows should be of equal size, which will be their minimum.
     Term::command "layout split"
     Term::check_box "check for src window in split" 0 0 80 ${src_size_after}
-    Term::check_box "check for asm window in split" 0 [expr ${src_size_after} - 1] 80 ${asm_size_after}
+    Term::check_box "check for asm window in split" \
+       0 [expr {${src_size_after} - 1}] 80 ${asm_size_after}
 }
index 67ad36cbd25b46203d8e39d55b6dfb17c1ead3ae..ef166f79af339532b6c37a8e9fea99b1c527d36e 100644 (file)
@@ -165,7 +165,7 @@ with_test_prefix width-hard-coded {
 }
 
 with_test_prefix width-auto-detected {
-    Term::with_tuiterm {*}$dims {
+    Term::with_tuiterm $lines $cols {
        save_vars { ::INTERNAL_GDBFLAGS } {
            # Avoid "set width 0" argument.
            set INTERNAL_GDBFLAGS \