From: Tom de Vries Date: Sat, 20 Sep 2025 12:48:56 +0000 (+0200) Subject: [gdb/testsuite, tclint] Fix gdb.guile X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5322d99453a4e9128c98810bdaf6ed945a61699d;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite, tclint] Fix gdb.guile Running tclint on the test-cases in gdb.guile shows a few problems. Fix these. Tested on x86_64-linux. --- diff --git a/gdb/tclint.toml b/gdb/tclint.toml index 2aae9eb68b5..4beb4dd2bf0 100644 --- a/gdb/tclint.toml +++ b/gdb/tclint.toml @@ -26,7 +26,6 @@ exclude = [ "gdb/testsuite/gdb.cp", "gdb/testsuite/gdb.dwarf2", "gdb/testsuite/gdb.fortran", -"gdb/testsuite/gdb.guile", "gdb/testsuite/gdb.mi", "gdb/testsuite/gdb.python", "gdb/testsuite/gdb.reverse", diff --git a/gdb/testsuite/gdb.guile/scm-arch.exp b/gdb/testsuite/gdb.guile/scm-arch.exp index bd64c4b2a08..752c2d8a390 100644 --- a/gdb/testsuite/gdb.guile/scm-arch.exp +++ b/gdb/testsuite/gdb.guile/scm-arch.exp @@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-block.exp b/gdb/testsuite/gdb.guile/scm-block.exp index 266e714e001..65e2275fc9f 100644 --- a/gdb/testsuite/gdb.guile/scm-block.exp +++ b/gdb/testsuite/gdb.guile/scm-block.exp @@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-breakpoint.exp b/gdb/testsuite/gdb.guile/scm-breakpoint.exp index 8694530a197..3b90d9938ba 100644 --- a/gdb/testsuite/gdb.guile/scm-breakpoint.exp +++ b/gdb/testsuite/gdb.guile/scm-breakpoint.exp @@ -32,7 +32,7 @@ proc_with_prefix test_bkpt_basic { } { # Start with a fresh gdb. clean_restart ${testfile} - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return } @@ -65,7 +65,7 @@ proc_with_prefix test_bkpt_basic { } { "scm-breakpoint\.c:${mult_line}*" \ "check multiply breakpoint location" - # Check hit and ignore counts. + # Check hit and ignore counts. gdb_test "guile (print (breakpoint-hit-count mult-bkpt))" \ "= 1" "check multiply breakpoint hit count" gdb_scm_test_silent_cmd "guile (set-breakpoint-ignore-count! mult-bkpt 4)" \ @@ -105,7 +105,7 @@ proc_with_prefix test_bkpt_deletion { } { # Start with a fresh gdb. clean_restart ${testfile} - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return } @@ -141,7 +141,7 @@ proc_with_prefix test_bkpt_cond_and_cmds { } { # Start with a fresh gdb. clean_restart ${testfile} - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return } @@ -188,7 +188,7 @@ proc_with_prefix test_bkpt_invisible { } { # Start with a fresh gdb. clean_restart ${testfile} - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return } @@ -238,10 +238,10 @@ proc_with_prefix test_watchpoints { } { clean_restart ${testfile} # Disable hardware watchpoints if necessary. - if [target_info exists gdb,no_hardware_watchpoints] { + if {[target_info exists gdb,no_hardware_watchpoints]} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return } @@ -273,10 +273,10 @@ proc_with_prefix test_bkpt_internal { } { clean_restart ${testfile} # Disable hardware watchpoints if necessary. - if [target_info exists gdb,no_hardware_watchpoints] { + if {[target_info exists gdb,no_hardware_watchpoints]} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return } @@ -304,10 +304,10 @@ proc_with_prefix test_bkpt_eval_funcs { } { clean_restart ${testfile} # Disable hardware watchpoints if necessary. - if [target_info exists gdb,no_hardware_watchpoints] { + if {[target_info exists gdb,no_hardware_watchpoints]} { gdb_test_no_output "set can-use-hw-watchpoints 0" "" } - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return } @@ -451,7 +451,7 @@ proc_with_prefix test_bkpt_registration {} { # Start with a fresh gdb. clean_restart ${testfile} - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return } @@ -490,7 +490,7 @@ proc_with_prefix test_bkpt_temporary { } { # Start with a fresh gdb. clean_restart ${testfile} - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return 0 } delete_breakpoints @@ -556,7 +556,7 @@ proc_with_prefix test_catchpoints {} { # Start with a fresh gdb. clean_restart ${testfile} - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-cmd.exp b/gdb/testsuite/gdb.guile/scm-cmd.exp index 3709cb19042..36abb0040b9 100644 --- a/gdb/testsuite/gdb.guile/scm-cmd.exp +++ b/gdb/testsuite/gdb.guile/scm-cmd.exp @@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-disasm.exp b/gdb/testsuite/gdb.guile/scm-disasm.exp index 5541a60f597..bd551ad5f41 100644 --- a/gdb/testsuite/gdb.guile/scm-disasm.exp +++ b/gdb/testsuite/gdb.guile/scm-disasm.exp @@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-equal.exp b/gdb/testsuite/gdb.guile/scm-equal.exp index 0450d626505..2a87139c528 100644 --- a/gdb/testsuite/gdb.guile/scm-equal.exp +++ b/gdb/testsuite/gdb.guile/scm-equal.exp @@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-frame-args.exp b/gdb/testsuite/gdb.guile/scm-frame-args.exp index c519087e23a..9c1e831042c 100644 --- a/gdb/testsuite/gdb.guile/scm-frame-args.exp +++ b/gdb/testsuite/gdb.guile/scm-frame-args.exp @@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-frame-inline.exp b/gdb/testsuite/gdb.guile/scm-frame-inline.exp index a2fe11d8418..02884f7d19a 100644 --- a/gdb/testsuite/gdb.guile/scm-frame-inline.exp +++ b/gdb/testsuite/gdb.guile/scm-frame-inline.exp @@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -if ![runto_main] { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-frame.exp b/gdb/testsuite/gdb.guile/scm-frame.exp index 9a27c42a08a..821567e6d49 100644 --- a/gdb/testsuite/gdb.guile/scm-frame.exp +++ b/gdb/testsuite/gdb.guile/scm-frame.exp @@ -28,7 +28,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { # The following tests require execution. -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-iterator.exp b/gdb/testsuite/gdb.guile/scm-iterator.exp index 43d776be457..188b5ef9377 100644 --- a/gdb/testsuite/gdb.guile/scm-iterator.exp +++ b/gdb/testsuite/gdb.guile/scm-iterator.exp @@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-lazy-string.exp b/gdb/testsuite/gdb.guile/scm-lazy-string.exp index c5d09ae7344..eaee0019e47 100644 --- a/gdb/testsuite/gdb.guile/scm-lazy-string.exp +++ b/gdb/testsuite/gdb.guile/scm-lazy-string.exp @@ -31,7 +31,7 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { # The following tests require execution. -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-math.exp b/gdb/testsuite/gdb.guile/scm-math.exp index 8b219095498..17b54d17b9e 100644 --- a/gdb/testsuite/gdb.guile/scm-math.exp +++ b/gdb/testsuite/gdb.guile/scm-math.exp @@ -167,21 +167,21 @@ proc test_value_numeric_ops {} { # TCL 8.5 required here. Use lookup table instead? proc get_max_int { size } { - return [expr "(1 << ($size - 1)) - 1"] + return [expr {(1 << ($size - 1)) - 1}] } # Return the min signed int of size SIZE. # TCL 8.5 required here. Use lookup table instead? proc get_min_int { size } { - return [expr "-(1 << ($size - 1))"] + return [expr {-(1 << ($size - 1))}] } # Return the max unsigned int of size SIZE. # TCL 8.5 required here. Use lookup table instead? proc get_max_uint { size } { - return [expr "(1 << $size) - 1"] + return [expr {(1 << $size) - 1}] } # Helper routine for test_value_numeric_ranges. @@ -252,7 +252,7 @@ proc test_value_numeric_ranges {} { proc test_make_pointer_value { size } { set max [get_max_uint $size] - set max_hex [string repeat "f" [expr "$size / 4"]] + set max_hex [string repeat "f" [expr {$size / 4}]] gdb_test "gu (print (make-value $max #:type void-pointer-type))" \ "= 0x$max_hex" "test make-value void* max" @@ -337,7 +337,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c}]} { return } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-objfile-script.exp b/gdb/testsuite/gdb.guile/scm-objfile-script.exp index b6d9369ff53..88cd18c9279 100644 --- a/gdb/testsuite/gdb.guile/scm-objfile-script.exp +++ b/gdb/testsuite/gdb.guile/scm-objfile-script.exp @@ -41,7 +41,7 @@ gdb_load ${binfile} # Verify gdb loaded the script. gdb_test "info auto-load guile-scripts" "Yes.*/${testfile}-gdb.scm.*" -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-objfile.exp b/gdb/testsuite/gdb.guile/scm-objfile.exp index e0018c42b27..09256df3c90 100644 --- a/gdb/testsuite/gdb.guile/scm-objfile.exp +++ b/gdb/testsuite/gdb.guile/scm-objfile.exp @@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gdb.guile/scm-parameter.exp index acd78b9ef32..5483b811f64 100644 --- a/gdb/testsuite/gdb.guile/scm-parameter.exp +++ b/gdb/testsuite/gdb.guile/scm-parameter.exp @@ -26,7 +26,7 @@ gdb_install_guile_utils gdb_install_guile_module proc scm_param_test_maybe_no_output { command pattern args } { - if [string length $pattern] { + if {[string length $pattern]} { gdb_test $command $pattern $args } else { gdb_test_no_output $command $args @@ -110,7 +110,7 @@ with_test_prefix "test-enum-param" { gdb_test_no_output "set print test-enum-param two" gdb_test "show print test-enum-param" "The state of the enum is two." "show new value" gdb_test "guile (print (parameter-value test-enum-param))" "two" "enum parameter value, two" - gdb_test "set print test-enum-param three" "Undefined item: \"three\".*" "set invalid enum parameter" + gdb_test "set print test-enum-param three" "Undefined item: \"three\".*" "set invalid enum parameter" } # Test integer parameters. @@ -306,7 +306,7 @@ with_test_prefix "test-file-param" { gdb_test_no_output "set test-file-param bar.txt" gdb_test "show test-file-param" "The name of the file is bar.txt." "show new value" gdb_test "guile (print (parameter-value test-file-param))" "bar.txt" " new parameter value" - gdb_test "set test-file-param" "Argument required.*" + gdb_test "set test-file-param" "Argument required.*" } # Test a parameter that is not documented. diff --git a/gdb/testsuite/gdb.guile/scm-ports.exp b/gdb/testsuite/gdb.guile/scm-ports.exp index c67ebd2d8ae..a0af2891c9f 100644 --- a/gdb/testsuite/gdb.guile/scm-ports.exp +++ b/gdb/testsuite/gdb.guile/scm-ports.exp @@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } @@ -84,7 +84,7 @@ foreach variation $port_variations { # Test read/write of memory ports. proc test_mem_port_rw { buffered } { - if $buffered { + if {$buffered} { set mode "r+" } else { set mode "r+0" @@ -115,7 +115,7 @@ proc test_mem_port_rw { buffered } { "define new-value" gdb_test "guile (print (put-bytevector rw-mem-port (make-bytevector 1 new-value)))" \ "= #" - if $buffered { + if {$buffered} { # Value shouldn't be in memory yet. gdb_test "guile (print (value=? (parse-and-eval \"*(char*) \$sp\") byte-at-sp))" \ "= #t" \ diff --git a/gdb/testsuite/gdb.guile/scm-pretty-print.exp b/gdb/testsuite/gdb.guile/scm-pretty-print.exp index b95c0cb5878..62fb8e2732a 100644 --- a/gdb/testsuite/gdb.guile/scm-pretty-print.exp +++ b/gdb/testsuite/gdb.guile/scm-pretty-print.exp @@ -36,7 +36,7 @@ proc run_lang_tests {exefile lang} { clean_restart gdb_load $exefile - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return } @@ -117,7 +117,7 @@ run_lang_tests "${binfile}-cxx" "c++" clean_restart $::testfile -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-section-script.exp b/gdb/testsuite/gdb.guile/scm-section-script.exp index 4c0238dcd77..3a68adc5ddf 100644 --- a/gdb/testsuite/gdb.guile/scm-section-script.exp +++ b/gdb/testsuite/gdb.guile/scm-section-script.exp @@ -94,7 +94,7 @@ gdb_test "info auto-load guile-scripts ${testfile}" "Yes.*${testfile}.scm.*" gdb_test "info auto-load guile-scripts no-script-matches-this" \ "No auto-load scripts matching no-script-matches-this." -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-symbol.exp b/gdb/testsuite/gdb.guile/scm-symbol.exp index 96bd56089ba..2ddd3f01b2c 100644 --- a/gdb/testsuite/gdb.guile/scm-symbol.exp +++ b/gdb/testsuite/gdb.guile/scm-symbol.exp @@ -54,7 +54,7 @@ gdb_test "guile (print (symbol-value qq-var))" \ gdb_test "guile (print (symbol-needs-frame? qq-var))" \ "= #f" "print whether qq needs a frame" -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } @@ -143,7 +143,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-cxx" executable " clean_restart ${::testfile}-cxx -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } @@ -172,7 +172,7 @@ gdb_test "guile (print (= (symbol-addr-class cplusfunc) SYMBOL_LOC_BLOCK))" "= # # test as it unloads the object file in GDB. # Start with a fresh gdb. clean_restart ${testfile} -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-symtab.exp b/gdb/testsuite/gdb.guile/scm-symtab.exp index 621bbbe0162..c19b460a4be 100644 --- a/gdb/testsuite/gdb.guile/scm-symtab.exp +++ b/gdb/testsuite/gdb.guile/scm-symtab.exp @@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \ return } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } @@ -143,7 +143,7 @@ clean_restart ${testfile} # Test find-pc-line. # The following tests require execution. -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-type.exp b/gdb/testsuite/gdb.guile/scm-type.exp index 640dd5b2c04..d974c86ea3b 100644 --- a/gdb/testsuite/gdb.guile/scm-type.exp +++ b/gdb/testsuite/gdb.guile/scm-type.exp @@ -45,7 +45,7 @@ proc restart_gdb {exefile} { return 0 } - if ![gdb_guile_runto_main] { + if {![gdb_guile_runto_main]} { return 0 } gdb_scm_test_silent_cmd "guile (use-modules (gdb iterator))" \ @@ -275,7 +275,7 @@ proc test_range {} { if { [build_inferior "${binfile}" "c"] < 0 } { return } -if ![restart_gdb "${binfile}"] { +if {![restart_gdb "${binfile}"]} { return } @@ -291,7 +291,7 @@ with_test_prefix "lang_c" { if { [build_inferior "${binfile}-cxx" "c++"] < 0 } { return } -if ![restart_gdb "${binfile}-cxx"] { +if {![restart_gdb "${binfile}-cxx"]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-value-cc.exp b/gdb/testsuite/gdb.guile/scm-value-cc.exp index 202f01e4c95..f65be25e5e9 100644 --- a/gdb/testsuite/gdb.guile/scm-value-cc.exp +++ b/gdb/testsuite/gdb.guile/scm-value-cc.exp @@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } diff --git a/gdb/testsuite/gdb.guile/scm-value.exp b/gdb/testsuite/gdb.guile/scm-value.exp index d723aebc786..ea77d8fca54 100644 --- a/gdb/testsuite/gdb.guile/scm-value.exp +++ b/gdb/testsuite/gdb.guile/scm-value.exp @@ -312,7 +312,7 @@ proc test_subscript_regression {exefile lang} { clean_restart gdb_load ${exefile} - if ![gdb_guile_runto_main ] { + if {![gdb_guile_runto_main ]} { return } @@ -438,7 +438,7 @@ test_value_hash # The following tests require execution. -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return } @@ -447,7 +447,7 @@ test_inferior_function_call test_strings test_value_after_death -# Test either C or C++ values. +# Test either C or C++ values. test_subscript_regression "${binfile}" "c" diff --git a/gdb/testsuite/gdb.guile/types-module.exp b/gdb/testsuite/gdb.guile/types-module.exp index c9d7067266d..e8412ccb826 100644 --- a/gdb/testsuite/gdb.guile/types-module.exp +++ b/gdb/testsuite/gdb.guile/types-module.exp @@ -30,7 +30,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $flags] } { return -1 } -if ![gdb_guile_runto_main] { +if {![gdb_guile_runto_main]} { return }