]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix gdb.compile
authorTom de Vries <tdevries@suse.de>
Thu, 18 Sep 2025 06:18:31 +0000 (08:18 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 18 Sep 2025 06:18:31 +0000 (08:18 +0200)
Running tclint on the test-cases in gdb.compile shows a few problems.

While we're at it, likewise in lib/compile-support.exp

Fix these.

Tested on x86_64-linux (Fedora 42).

gdb/tclint.toml
gdb/testsuite/gdb.compile/compile-cplus-print.exp
gdb/testsuite/gdb.compile/compile-cplus.exp
gdb/testsuite/gdb.compile/compile-ifunc.exp
gdb/testsuite/gdb.compile/compile-ops.exp
gdb/testsuite/gdb.compile/compile-print.exp
gdb/testsuite/gdb.compile/compile-setjmp.exp
gdb/testsuite/gdb.compile/compile.exp
gdb/testsuite/lib/compile-support.exp

index 1cfb0b2623f3e1085777f414960f5ddc51e5bbbf..3911017a63ff45fc51a44abbb3ed7d04ed1deaa1 100644 (file)
@@ -22,7 +22,6 @@ exclude = [
 "gdb/testsuite/gdb.arch",
 "gdb/testsuite/gdb.base",
 "gdb/testsuite/gdb.btrace",
-"gdb/testsuite/gdb.compile",
 "gdb/testsuite/gdb.cp",
 "gdb/testsuite/gdb.ctf",
 "gdb/testsuite/gdb.dwarf2",
index d89bf61fd3cdbee8a2b1c7dce070e052d3070b57..e4e278211cd0a8669a9b23460477c96e817549b3 100644 (file)
@@ -22,7 +22,7 @@ require is_c_compiler_gcc
 require allow_compile_tests
 
 set options {}
-if [test_compiler_info gcc*] {
+if {[test_compiler_info gcc*]} {
     lappend options additional_flags=-g3
     lappend options additional_flags=-std=gnu++11
     lappend options c++
@@ -30,13 +30,14 @@ if [test_compiler_info gcc*] {
 
 set srcfilesoptions [list ${srcfile} ${options}]
 
-if { [eval build_executable_from_specs ${testfile}.exp $testfile {$options} ${srcfilesoptions}] } {
+if { [build_executable_from_specs $testfile.exp $testfile $options \
+         {*}$srcfilesoptions] } {
     return -1
 }
 
 clean_restart ${testfile}
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index a0f5cf00d22b26d02072043bb1531e2ab1ea8788..66ac76f351379e2a5c7e6c7542ef686835a32287 100644 (file)
@@ -39,7 +39,9 @@ if { $srcfile3 != "" } {
 }
 set srcfile4options "nodebug c++"
 lappend srcfilesoptions $srcfile4 $srcfile4options
-if { [eval build_executable_from_specs ${testfile}.exp $testfile {$options} ${srcfilesoptions}] } {
+
+if { [build_executable_from_specs $testfile.exp $testfile $options \
+         {*}$srcfilesoptions] } {
     return -1
 }
 
@@ -52,7 +54,7 @@ clean_restart ${testfile}
 gdb_test_no_output "set language c++" \
     "Set language to C++"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 068dce5c46cf63f77ef3711015dd56cba3d7af7d..72c1142a40ffff68302c33d8360841113c8c6224 100644 (file)
@@ -24,7 +24,7 @@ standard_testfile
 require is_c_compiler_gcc
 
 set flags ""
-if [test_compiler_info gcc*] {
+if {[test_compiler_info gcc*]} {
     set flags additional_flags=-Wno-attribute-alias
 }
 
index 9633551e8e024d271779d0a9b7957e26e579ded6..c41c91e3967409f1380e7b329e10cfa805fe7377 100644 (file)
@@ -416,7 +416,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto func] {
+if {![runto func]} {
     return -1
 }
 
index 4c90a7186087f0adbc5ac4d0b1879714ff9ca798..2d3ad2f074e0815c8c8e240d78da9fabcb36cc6e 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" "$testfile"] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 73f6b8b13f5b57a8008c3314854d46bcd0d87e5b..048d0a428d5877b3f3b28aeed09258f8f6f0fe2b 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" $testfile] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index eb87141824ddf355f4c6c3a7aa967f8d45ed472e..66ac182c0c95b0adb8977a485ca7acf8c7fb97a7 100644 (file)
@@ -32,7 +32,8 @@ if { $srcfile3 != "" } {
     lappend srcfilesoptions $srcfile3 ${options}
 }
 lappend srcfilesoptions $srcfile4 "nodebug"
-if { [eval build_executable_from_specs ${testfile}.exp $testfile {$options} ${srcfilesoptions}] } {
+if { [build_executable_from_specs $testfile.exp $testfile $options \
+         {*}$srcfilesoptions] } {
     return -1
 }
 
@@ -53,7 +54,7 @@ gdb_test "compile file -r ${srcdir}/${subdir}/${testfile}-mod.c" \
     "The program must be running for the compile command to work.*" \
     "test compile file command without running inferior"
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -391,7 +392,7 @@ if { [gdb_compile_shlib ${srcdir}/${subdir}/${srcfile2} $libbin {debug}] != ""
 clean_restart $testfile
 gdb_load_shlib $libbin
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index dd0b9a9ed3c92fe385327db867bec255d68559b6..8472d8de3e709e6fb62604840f681203eb8c3b72 100644 (file)
@@ -265,7 +265,7 @@ namespace eval ::CompileExpression {
 
        if {[string match $cmd "print"]} {
            if {!$is_explicit} {
-               eval setup_failures_ $fail_print
+               setup_failures_ {*}$fail_print
                return [compile_command_ "compile print $exp" $result $tst]
            }
        } else {
@@ -274,11 +274,11 @@ namespace eval ::CompileExpression {
            } else {
                set command "compile code $varName_ = $exp"
            }
-           eval setup_failures_ $fail_compile
+           setup_failures_ {*}$fail_compile
            if {![compile_command_ $command "" $tst]} {
                return 0
            }
-           eval setup_failures_ $fail_value
+           setup_failures_ {*}$fail_value
            gdb_test "p $varName_" "= $result" "result of $tst"
        }
        return 1
@@ -292,11 +292,11 @@ namespace eval ::CompileExpression {
     proc setup_failures_ {how args} {
        switch -nocase $how {
            xfail {
-               eval setup_xfail $args
+               setup_xfail {*}$args
            }
 
            kfail {
-               eval setup_kfail $args
+               setup_kfail {*}$args
            }
 
            default {