]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix gdb.guile
authorTom de Vries <tdevries@suse.de>
Sat, 20 Sep 2025 12:48:56 +0000 (14:48 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 20 Sep 2025 12:48:56 +0000 (14:48 +0200)
Running tclint on the test-cases in gdb.guile shows a few problems.

Fix these.

Tested on x86_64-linux.

25 files changed:
gdb/tclint.toml
gdb/testsuite/gdb.guile/scm-arch.exp
gdb/testsuite/gdb.guile/scm-block.exp
gdb/testsuite/gdb.guile/scm-breakpoint.exp
gdb/testsuite/gdb.guile/scm-cmd.exp
gdb/testsuite/gdb.guile/scm-disasm.exp
gdb/testsuite/gdb.guile/scm-equal.exp
gdb/testsuite/gdb.guile/scm-frame-args.exp
gdb/testsuite/gdb.guile/scm-frame-inline.exp
gdb/testsuite/gdb.guile/scm-frame.exp
gdb/testsuite/gdb.guile/scm-iterator.exp
gdb/testsuite/gdb.guile/scm-lazy-string.exp
gdb/testsuite/gdb.guile/scm-math.exp
gdb/testsuite/gdb.guile/scm-objfile-script.exp
gdb/testsuite/gdb.guile/scm-objfile.exp
gdb/testsuite/gdb.guile/scm-parameter.exp
gdb/testsuite/gdb.guile/scm-ports.exp
gdb/testsuite/gdb.guile/scm-pretty-print.exp
gdb/testsuite/gdb.guile/scm-section-script.exp
gdb/testsuite/gdb.guile/scm-symbol.exp
gdb/testsuite/gdb.guile/scm-symtab.exp
gdb/testsuite/gdb.guile/scm-type.exp
gdb/testsuite/gdb.guile/scm-value-cc.exp
gdb/testsuite/gdb.guile/scm-value.exp
gdb/testsuite/gdb.guile/types-module.exp

index 2aae9eb68b5befeed17b809b9e1f261e89f2b231..4beb4dd2bf0fe1aea8c9d486afff7fafba794c63 100644 (file)
@@ -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",
index bd64c4b2a08aac1d63622133524cabc8270aa559..752c2d8a390e575c95b03caba1bcc4b27b36f87f 100644 (file)
@@ -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
 }
 
index 266e714e0011a77e8c1e7d7e8cf063a1bf9109d9..65e2275fc9f0ffc05198210c77c4fc2e8359c732 100644 (file)
@@ -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
 }
 
index 8694530a197e877ff64347a7d1c4ad5ebc07933a..3b90d9938ba010c99fcc5b0f3bb85bdc3bc41665 100644 (file)
@@ -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
     }
 
index 3709cb19042c78fa92437246b18c14654b478b88..36abb0040b92cde571b38b3a26fca76aa5a9895f 100644 (file)
@@ -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
 }
 
index 5541a60f597cd2ae7cb8946041446ead4b3ab8b5..bd551ad5f41fb9329faf286f1e1913e3152d1ea1 100644 (file)
@@ -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
 }
 
index 0450d626505aaf7285eae698ee4ea3b293af8021..2a87139c528f4c9be9f7ba419971b3b5f1e483b7 100644 (file)
@@ -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
 }
 
index c519087e23a6eda94844351fabe2cfa2487d745b..9c1e831042c3dcc57dd674399aa276335600b480 100644 (file)
@@ -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
 }
 
index a2fe11d84180dc3739d5973c5aaade94b78b5499..02884f7d19adc8e5d65b0bb4d6edbeecdc8d6fc3 100644 (file)
@@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index 9a27c42a08a8e60f0d01a9cf2ccc76c82dc9b7b1..821567e6d49d327e1f7da3dde9494a54a4da9f53 100644 (file)
@@ -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
 }
 
index 43d776be457ec97069a868a5891026cc5bd9f4be..188b5ef9377d212c430b4cb8635457c85978f7fe 100644 (file)
@@ -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
 }
 
index c5d09ae73445d073363cfa993bc20133fa2c701d..eaee0019e47a14e916adaa9fcba1bd5f5ceb872b 100644 (file)
@@ -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
 }
 
index 8b219095498f8a431ee3591e7bb2c85f330b8bc7..17b54d17b9ecd9b83846d2e105ff3d4bde90aa76 100644 (file)
@@ -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
 }
 
index b6d9369ff53af73bd6395c0a60d9a0c088be46fb..88cd18c9279981d1b1f6c12600da36839474efb5 100644 (file)
@@ -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
 }
 
index e0018c42b27c38b2990d18ed44a3e85c9b9097d9..09256df3c90c028f02bfdd735369aade0d6426a7 100644 (file)
@@ -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
 }
 
index acd78b9ef32aaf0a3defc91eb4e2fdfe1bf125ee..5483b811f6454960599e2242104345f156fbe6e0 100644 (file)
@@ -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.
index c67ebd2d8ae59265250e76c4a477a29a9081243c..a0af2891c9ff0302985c3f9baca664af8f7e6090 100644 (file)
@@ -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)))" \
        "= #<unspecified>"
-    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" \
index b95c0cb5878a620b8e409fdc59d0363ad54c469d..62fb8e2732acaf1623c2a5b385f77bb9b0392975 100644 (file)
@@ -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
 }
 
index 4c0238dcd773a7ee5f7675319ac78c3e691f1b58..3a68adc5ddf58638d0e976366d01c75805a9a7f5 100644 (file)
@@ -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
 }
 
index 96bd56089badb0648462cac6df9aee9758587217..2ddd3f01b2c6bdfa323a3ffe57645577643d96b7 100644 (file)
@@ -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
 }
 
index 621bbbe0162611369a7ac322d8046fddd4f7dc23..c19b460a4be6dc08c07531fdf9ec4b8aefa6bcb9 100644 (file)
@@ -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
 }
 
index 640dd5b2c04f3b77ceb4f50a64e354c41aeed1eb..d974c86ea3bab7f79b7fad3fd671a8ea456d3398 100644 (file)
@@ -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
 }
 
index 202f01e4c95f3faac4f017ce56fb1345aa9e22b2..f65be25e5e9e8f8c03a7ce9b34f3b4478a763d2e 100644 (file)
@@ -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
 }
 
index d723aebc786f4d4537177e6ee7a240713ef3bb0e..ea77d8fca544c97d77d92a529f19e9512801a42d 100644 (file)
@@ -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"
 
index c9d7067266dcdbc41d19bbc147d7fb54e8e204ab..e8412ccb8263e73ff9329cbf8eb9d39e0913c924 100644 (file)
@@ -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
 }