From 9588aa182c1db5f60345729b45223269b3046f06 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 30 Sep 2025 21:32:50 +0200 Subject: [PATCH] [gdb/testsuite, tclint] Further tclint fixing 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 --- gdb/testsuite/gdb.ada/big_packed_array.exp | 2 +- gdb/testsuite/gdb.ada/finish-var-size.exp | 2 +- gdb/testsuite/gdb.ada/huge.exp | 2 +- gdb/testsuite/gdb.ada/import.exp | 2 +- .../gdb.ada/uninitialized-variable-record.exp | 4 ++-- gdb/testsuite/gdb.ada/verylong.exp | 2 +- gdb/testsuite/gdb.base/args.exp | 2 +- gdb/testsuite/gdb.base/fission-macro.exp | 2 +- gdb/testsuite/gdb.base/huge.exp | 2 +- gdb/testsuite/gdb.base/inferior-args.exp | 2 +- gdb/testsuite/gdb.base/startup-with-shell.exp | 2 +- gdb/testsuite/gdb.base/utf8-identifiers.exp | 2 +- gdb/testsuite/gdb.btrace/vdso.exp | 2 +- gdb/testsuite/gdb.compile/compile-ifunc.exp | 4 ++-- .../gdb.debuginfod/fetch_src_and_symbols.exp | 2 +- .../gdb.dwarf2/dw-form-strx-out-of-bounds.exp | 2 +- gdb/testsuite/gdb.dwarf2/dw-form-strx.exp | 2 +- gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp | 2 +- gdb/testsuite/gdb.fortran/array-slices.exp | 2 +- gdb/testsuite/gdb.fortran/associated.exp | 2 +- gdb/testsuite/gdb.fortran/assumedrank.exp | 2 +- gdb/testsuite/gdb.fortran/huge.exp | 2 +- gdb/testsuite/gdb.fortran/lbound-ubound.exp | 2 +- gdb/testsuite/gdb.fortran/rank.exp | 2 +- gdb/testsuite/gdb.fortran/shape.exp | 2 +- gdb/testsuite/gdb.fortran/size.exp | 2 +- gdb/testsuite/gdb.fortran/sizeof.exp | 2 +- gdb/testsuite/gdb.gdb/unittest.exp | 2 +- gdb/testsuite/gdb.linespec/cpcompletion.exp | 4 ++-- gdb/testsuite/gdb.linespec/cpls-abi-tag.exp | 2 +- gdb/testsuite/gdb.multi/multi-arch.exp | 4 ++-- gdb/testsuite/gdb.multi/multi-re-run.exp | 2 +- gdb/testsuite/gdb.opt/inline-cmds.exp | 2 +- gdb/testsuite/gdb.opt/inline-entry.exp | 2 +- gdb/testsuite/gdb.perf/skip-command.exp | 2 +- gdb/testsuite/gdb.python/py-record-btrace.exp | 4 ++-- gdb/testsuite/gdb.python/py-section-script.exp | 2 +- gdb/testsuite/gdb.rocm/displaced-stepping.exp | 2 +- gdb/testsuite/gdb.rocm/precise-memory-exec.exp | 2 +- gdb/testsuite/gdb.rocm/precise-memory-fork.exp | 2 +- .../gdb.rocm/precise-memory-warning-sigsegv.exp | 2 +- gdb/testsuite/gdb.rocm/precise-memory.exp | 2 +- gdb/testsuite/gdb.rocm/simple.exp | 2 +- gdb/testsuite/gdb.server/exit-multiple-threads.exp | 4 ++-- gdb/testsuite/gdb.server/reconnect-ctrl-c.exp | 2 +- gdb/testsuite/gdb.server/server-kill.exp | 8 ++++---- gdb/testsuite/gdb.tui/winheight.exp | 11 ++++++----- gdb/testsuite/gdb.tui/wrap-line.exp | 2 +- 48 files changed, 62 insertions(+), 61 deletions(-) diff --git a/gdb/testsuite/gdb.ada/big_packed_array.exp b/gdb/testsuite/gdb.ada/big_packed_array.exp index b1566afc534..aa328a56921 100644 --- a/gdb/testsuite/gdb.ada/big_packed_array.exp +++ b/gdb/testsuite/gdb.ada/big_packed_array.exp @@ -38,7 +38,7 @@ foreach_gnat_encoding scenario flags {all minimal} { gdb_test "print good" \ "= \\(false \\)" \ - set have_xfail [expr $old_gcc && [string equal "$scenario" "minimal"]] + set have_xfail [expr {$old_gcc && [string equal "$scenario" "minimal"]}] set re "= \\(false \\)" set re_xfail "= \\(0 => 0 \\)" diff --git a/gdb/testsuite/gdb.ada/finish-var-size.exp b/gdb/testsuite/gdb.ada/finish-var-size.exp index 6365c958905..895a24821c0 100644 --- a/gdb/testsuite/gdb.ada/finish-var-size.exp +++ b/gdb/testsuite/gdb.ada/finish-var-size.exp @@ -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 diff --git a/gdb/testsuite/gdb.ada/huge.exp b/gdb/testsuite/gdb.ada/huge.exp index fa94fa00d75..7bf70037f38 100644 --- a/gdb/testsuite/gdb.ada/huge.exp +++ b/gdb/testsuite/gdb.ada/huge.exp @@ -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} diff --git a/gdb/testsuite/gdb.ada/import.exp b/gdb/testsuite/gdb.ada/import.exp index 51ce7faab79..d7d11e13f50 100644 --- a/gdb/testsuite/gdb.ada/import.exp +++ b/gdb/testsuite/gdb.ada/import.exp @@ -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 diff --git a/gdb/testsuite/gdb.ada/uninitialized-variable-record.exp b/gdb/testsuite/gdb.ada/uninitialized-variable-record.exp index 0e198cb2167..4366b200b38 100644 --- a/gdb/testsuite/gdb.ada/uninitialized-variable-record.exp +++ b/gdb/testsuite/gdb.ada/uninitialized-variable-record.exp @@ -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 { diff --git a/gdb/testsuite/gdb.ada/verylong.exp b/gdb/testsuite/gdb.ada/verylong.exp index de5fd0417a3..da1ce793885 100644 --- a/gdb/testsuite/gdb.ada/verylong.exp +++ b/gdb/testsuite/gdb.ada/verylong.exp @@ -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}]" diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp index 990f3a11057..07101da30aa 100644 --- a/gdb/testsuite/gdb.base/args.exp +++ b/gdb/testsuite/gdb.base/args.exp @@ -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 diff --git a/gdb/testsuite/gdb.base/fission-macro.exp b/gdb/testsuite/gdb.base/fission-macro.exp index c86a1a47d59..0680da69e08 100644 --- a/gdb/testsuite/gdb.base/fission-macro.exp +++ b/gdb/testsuite/gdb.base/fission-macro.exp @@ -14,7 +14,7 @@ # along with this program. If not, see . */ # 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 diff --git a/gdb/testsuite/gdb.base/huge.exp b/gdb/testsuite/gdb.base/huge.exp index 0c307bba7f4..01bc9ea4b71 100644 --- a/gdb/testsuite/gdb.base/huge.exp +++ b/gdb/testsuite/gdb.base/huge.exp @@ -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 diff --git a/gdb/testsuite/gdb.base/inferior-args.exp b/gdb/testsuite/gdb.base/inferior-args.exp index 2b52d8747a1..6ac25fccdfb 100644 --- a/gdb/testsuite/gdb.base/inferior-args.exp +++ b/gdb/testsuite/gdb.base/inferior-args.exp @@ -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 diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp index a6ebb57c00e..6872369c988 100644 --- a/gdb/testsuite/gdb.base/startup-with-shell.exp +++ b/gdb/testsuite/gdb.base/startup-with-shell.exp @@ -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 diff --git a/gdb/testsuite/gdb.base/utf8-identifiers.exp b/gdb/testsuite/gdb.base/utf8-identifiers.exp index 46078481398..8d19dbcb6f2 100644 --- a/gdb/testsuite/gdb.base/utf8-identifiers.exp +++ b/gdb/testsuite/gdb.base/utf8-identifiers.exp @@ -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} diff --git a/gdb/testsuite/gdb.btrace/vdso.exp b/gdb/testsuite/gdb.btrace/vdso.exp index 0484da18ac0..8bf63ac6506 100644 --- a/gdb/testsuite/gdb.btrace/vdso.exp +++ b/gdb/testsuite/gdb.btrace/vdso.exp @@ -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" diff --git a/gdb/testsuite/gdb.compile/compile-ifunc.exp b/gdb/testsuite/gdb.compile/compile-ifunc.exp index 72c1142a40f..dbe84d54f64 100644 --- a/gdb/testsuite/gdb.compile/compile-ifunc.exp +++ b/gdb/testsuite/gdb.compile/compile-ifunc.exp @@ -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' diff --git a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp index 292be705f05..9078068c8fe 100644 --- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp +++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp @@ -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 } diff --git a/gdb/testsuite/gdb.dwarf2/dw-form-strx-out-of-bounds.exp b/gdb/testsuite/gdb.dwarf2/dw-form-strx-out-of-bounds.exp index cb24b19a131..f312885d4f3 100644 --- a/gdb/testsuite/gdb.dwarf2/dw-form-strx-out-of-bounds.exp +++ b/gdb/testsuite/gdb.dwarf2/dw-form-strx-out-of-bounds.exp @@ -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 \ diff --git a/gdb/testsuite/gdb.dwarf2/dw-form-strx.exp b/gdb/testsuite/gdb.dwarf2/dw-form-strx.exp index 3f739c4adea..715331469d6 100644 --- a/gdb/testsuite/gdb.dwarf2/dw-form-strx.exp +++ b/gdb/testsuite/gdb.dwarf2/dw-form-strx.exp @@ -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" diff --git a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp index 96287dd0986..7d8bc211d3e 100644 --- a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp +++ b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp @@ -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 \ diff --git a/gdb/testsuite/gdb.fortran/array-slices.exp b/gdb/testsuite/gdb.fortran/array-slices.exp index 7d4f96e041c..0a7851e1704 100644 --- a/gdb/testsuite/gdb.fortran/array-slices.exp +++ b/gdb/testsuite/gdb.fortran/array-slices.exp @@ -132,7 +132,7 @@ proc run_test { repack } { } } - if ($found_final_breakpoint) { + if {$found_final_breakpoint} { break } diff --git a/gdb/testsuite/gdb.fortran/associated.exp b/gdb/testsuite/gdb.fortran/associated.exp index 92972200270..6d1a6d8b183 100644 --- a/gdb/testsuite/gdb.fortran/associated.exp +++ b/gdb/testsuite/gdb.fortran/associated.exp @@ -50,7 +50,7 @@ while { $test_count < 500 } { } } - if ($found_final_breakpoint) { + if {$found_final_breakpoint} { break } diff --git a/gdb/testsuite/gdb.fortran/assumedrank.exp b/gdb/testsuite/gdb.fortran/assumedrank.exp index 45e8c09469b..ce53841529b 100644 --- a/gdb/testsuite/gdb.fortran/assumedrank.exp +++ b/gdb/testsuite/gdb.fortran/assumedrank.exp @@ -64,7 +64,7 @@ while { $test_count < 500 } { continue } - if ($found_final_breakpoint) { + if {$found_final_breakpoint} { break } diff --git a/gdb/testsuite/gdb.fortran/huge.exp b/gdb/testsuite/gdb.fortran/huge.exp index f7c50d7a897..03ebdaac4bd 100644 --- a/gdb/testsuite/gdb.fortran/huge.exp +++ b/gdb/testsuite/gdb.fortran/huge.exp @@ -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} diff --git a/gdb/testsuite/gdb.fortran/lbound-ubound.exp b/gdb/testsuite/gdb.fortran/lbound-ubound.exp index 143c5be98a6..75b8febe0c8 100644 --- a/gdb/testsuite/gdb.fortran/lbound-ubound.exp +++ b/gdb/testsuite/gdb.fortran/lbound-ubound.exp @@ -61,7 +61,7 @@ while { $test_count < 500 } { } } - if ($found_dealloc_breakpoint) { + if {$found_dealloc_breakpoint} { break } diff --git a/gdb/testsuite/gdb.fortran/rank.exp b/gdb/testsuite/gdb.fortran/rank.exp index e998ead9cb1..1fe20c6f7d7 100644 --- a/gdb/testsuite/gdb.fortran/rank.exp +++ b/gdb/testsuite/gdb.fortran/rank.exp @@ -50,7 +50,7 @@ while { $test_count < 500 } { } } - if ($found_final_breakpoint) { + if {$found_final_breakpoint} { break } diff --git a/gdb/testsuite/gdb.fortran/shape.exp b/gdb/testsuite/gdb.fortran/shape.exp index 7a6bc9beab9..4bcc2e7a349 100644 --- a/gdb/testsuite/gdb.fortran/shape.exp +++ b/gdb/testsuite/gdb.fortran/shape.exp @@ -50,7 +50,7 @@ while { $test_count < 500 } { } } - if ($found_final_breakpoint) { + if {$found_final_breakpoint} { break } diff --git a/gdb/testsuite/gdb.fortran/size.exp b/gdb/testsuite/gdb.fortran/size.exp index 5bc7db21287..8cd702d2f88 100644 --- a/gdb/testsuite/gdb.fortran/size.exp +++ b/gdb/testsuite/gdb.fortran/size.exp @@ -55,7 +55,7 @@ while { $test_count < 600 } { } } - if ($found_dealloc_breakpoint) { + if {$found_dealloc_breakpoint} { break } diff --git a/gdb/testsuite/gdb.fortran/sizeof.exp b/gdb/testsuite/gdb.fortran/sizeof.exp index c0a9fd3c0fe..d7eeb387e1b 100644 --- a/gdb/testsuite/gdb.fortran/sizeof.exp +++ b/gdb/testsuite/gdb.fortran/sizeof.exp @@ -60,7 +60,7 @@ while { $test_count < 200 } { } } - if ($found_final_breakpoint) { + if {$found_final_breakpoint} { break } diff --git a/gdb/testsuite/gdb.gdb/unittest.exp b/gdb/testsuite/gdb.gdb/unittest.exp index 38955ca34f9..500389dd70b 100644 --- a/gdb/testsuite/gdb.gdb/unittest.exp +++ b/gdb/testsuite/gdb.gdb/unittest.exp @@ -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 diff --git a/gdb/testsuite/gdb.linespec/cpcompletion.exp b/gdb/testsuite/gdb.linespec/cpcompletion.exp index 2f1cc84a934..f33bd39c680 100644 --- a/gdb/testsuite/gdb.linespec/cpcompletion.exp +++ b/gdb/testsuite/gdb.linespec/cpcompletion.exp @@ -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 diff --git a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp index c2079255530..9388c7f17c7 100644 --- a/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp +++ b/gdb/testsuite/gdb.linespec/cpls-abi-tag.exp @@ -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 \ diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp index b75009d2478..02c26ba13fe 100644 --- a/gdb/testsuite/gdb.multi/multi-arch.exp +++ b/gdb/testsuite/gdb.multi/multi-arch.exp @@ -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}" \ diff --git a/gdb/testsuite/gdb.multi/multi-re-run.exp b/gdb/testsuite/gdb.multi/multi-re-run.exp index 89d43a4b0d9..bf83043ea29 100644 --- a/gdb/testsuite/gdb.multi/multi-re-run.exp +++ b/gdb/testsuite/gdb.multi/multi-re-run.exp @@ -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 } diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp index e80d6f717fa..4163d8fcd45 100644 --- a/gdb/testsuite/gdb.opt/inline-cmds.exp +++ b/gdb/testsuite/gdb.opt/inline-cmds.exp @@ -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} diff --git a/gdb/testsuite/gdb.opt/inline-entry.exp b/gdb/testsuite/gdb.opt/inline-entry.exp index 0c6b0fb2ef5..227131ad331 100644 --- a/gdb/testsuite/gdb.opt/inline-entry.exp +++ b/gdb/testsuite/gdb.opt/inline-entry.exp @@ -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 diff --git a/gdb/testsuite/gdb.perf/skip-command.exp b/gdb/testsuite/gdb.perf/skip-command.exp index e59cb07157b..3a02cd54229 100644 --- a/gdb/testsuite/gdb.perf/skip-command.exp +++ b/gdb/testsuite/gdb.perf/skip-command.exp @@ -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}\)" diff --git a/gdb/testsuite/gdb.python/py-record-btrace.exp b/gdb/testsuite/gdb.python/py-record-btrace.exp index 6dd3ae17239..207161d3de5 100644 --- a/gdb/testsuite/gdb.python/py-record-btrace.exp +++ b/gdb/testsuite/gdb.python/py-record-btrace.exp @@ -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 \ diff --git a/gdb/testsuite/gdb.python/py-section-script.exp b/gdb/testsuite/gdb.python/py-section-script.exp index 9d4e48c0cf7..369c8872cbf 100644 --- a/gdb/testsuite/gdb.python/py-section-script.exp +++ b/gdb/testsuite/gdb.python/py-section-script.exp @@ -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 != ""} { diff --git a/gdb/testsuite/gdb.rocm/displaced-stepping.exp b/gdb/testsuite/gdb.rocm/displaced-stepping.exp index 9e8abd4c475..d26e4c635ae 100644 --- a/gdb/testsuite/gdb.rocm/displaced-stepping.exp +++ b/gdb/testsuite/gdb.rocm/displaced-stepping.exp @@ -32,7 +32,7 @@ proc do_test {} { gdb_load $::binfile with_rocm_gpu_lock { - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.rocm/precise-memory-exec.exp b/gdb/testsuite/gdb.rocm/precise-memory-exec.exp index 76be07816f8..24724463be4 100644 --- a/gdb/testsuite/gdb.rocm/precise-memory-exec.exp +++ b/gdb/testsuite/gdb.rocm/precise-memory-exec.exp @@ -33,7 +33,7 @@ proc do_test { follow-exec-mode } { gdb_load $::binfile with_rocm_gpu_lock { - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.rocm/precise-memory-fork.exp b/gdb/testsuite/gdb.rocm/precise-memory-fork.exp index 23c1ebe6249..7559aecf5fe 100644 --- a/gdb/testsuite/gdb.rocm/precise-memory-fork.exp +++ b/gdb/testsuite/gdb.rocm/precise-memory-fork.exp @@ -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 } diff --git a/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.exp b/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.exp index da0a95a37f5..70c26c6241e 100644 --- a/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.exp +++ b/gdb/testsuite/gdb.rocm/precise-memory-warning-sigsegv.exp @@ -33,7 +33,7 @@ proc do_test { } { gdb_load $::binfile with_rocm_gpu_lock { - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.rocm/precise-memory.exp b/gdb/testsuite/gdb.rocm/precise-memory.exp index 8f005596739..4ea41ba90e4 100644 --- a/gdb/testsuite/gdb.rocm/precise-memory.exp +++ b/gdb/testsuite/gdb.rocm/precise-memory.exp @@ -32,7 +32,7 @@ proc do_test { } { gdb_load $::binfile with_rocm_gpu_lock { - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.rocm/simple.exp b/gdb/testsuite/gdb.rocm/simple.exp index 8f6ff3e4337..6b2f08ef843 100644 --- a/gdb/testsuite/gdb.rocm/simple.exp +++ b/gdb/testsuite/gdb.rocm/simple.exp @@ -31,7 +31,7 @@ proc do_test {} { gdb_load $::binfile with_rocm_gpu_lock { - if ![runto_main] { + if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.server/exit-multiple-threads.exp b/gdb/testsuite/gdb.server/exit-multiple-threads.exp index be29f9eeba0..48bb10fa51b 100644 --- a/gdb/testsuite/gdb.server/exit-multiple-threads.exp +++ b/gdb/testsuite/gdb.server/exit-multiple-threads.exp @@ -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 } diff --git a/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp b/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp index bcab2de93cd..61aaaeae28c 100644 --- a/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp +++ b/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp @@ -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 } } diff --git a/gdb/testsuite/gdb.server/server-kill.exp b/gdb/testsuite/gdb.server/server-kill.exp index a9fcabb08ce..0c54918598c 100644 --- a/gdb/testsuite/gdb.server/server-kill.exp +++ b/gdb/testsuite/gdb.server/server-kill.exp @@ -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 } diff --git a/gdb/testsuite/gdb.tui/winheight.exp b/gdb/testsuite/gdb.tui/winheight.exp index 9b36c9815c8..38c7bcc88f1 100644 --- a/gdb/testsuite/gdb.tui/winheight.exp +++ b/gdb/testsuite/gdb.tui/winheight.exp @@ -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} } diff --git a/gdb/testsuite/gdb.tui/wrap-line.exp b/gdb/testsuite/gdb.tui/wrap-line.exp index 67ad36cbd25..ef166f79af3 100644 --- a/gdb/testsuite/gdb.tui/wrap-line.exp +++ b/gdb/testsuite/gdb.tui/wrap-line.exp @@ -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 \ -- 2.47.3