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

Fix these.

Tested on x86_64-linux.

gdb/testsuite/gdb.multi/multi-arch-exec.exp
gdb/testsuite/gdb.multi/multi-arch.exp
gdb/testsuite/gdb.multi/multi-term-settings.exp
gdb/testsuite/gdb.multi/watchpoint-multi-exit.exp
gdb/testsuite/gdb.multi/watchpoint-multi.exp

index 69c6b138ce0d44aa8ca6c3c575f523f309bf1147..435efc59e5d5c2013aa3957e404e8d7ce183180e 100644 (file)
@@ -23,7 +23,7 @@ require !use_gdb_stub
 
 # The 64-bit compile may succeed for i386-linux, but gdb won't be able
 # to load the file.
-if [istarget "i?86-*linux*"] {
+if {[istarget "i?86-*linux*"]} {
     return
 }
 
@@ -69,9 +69,9 @@ proc append_arch2_options {options_var} {
        }
     }
 
-    if [istarget "powerpc64*-*-*"] {
+    if {[istarget "powerpc64*-*-*"]} {
        set march "-m64"
-    } elseif [istarget "s390*-*-*"] {
+    } elseif {[istarget "s390*-*-*"]} {
        set march "-m31"
     } else {
        set march "-m32"
index 1d41ba5c0ae6bf9101171270e619f90986c0d68d..b75009d24783165b1194c1d6163169377b85cadf 100644 (file)
@@ -25,7 +25,7 @@ require !use_gdb_stub
 
 # The 64-bit compile may succeed for i386-linux, but gdb won't be able
 # to load the file.
-if [istarget "i?86-*linux*"] {
+if {[istarget "i?86-*linux*"]} {
     return
 }
 
@@ -41,7 +41,7 @@ set binfile2 [standard_output_file ${exec2}]
 
 # Build two executables, one for each arch.
 
-if [istarget "s390*-*-*"] {
+if {[istarget "s390*-*-*"]} {
     set march1 "-m64"
     set march2 "-m31"
 } elseif { [istarget "aarch64*-*-*"] } {
@@ -67,7 +67,7 @@ if { [build_executable "failed to prepare" ${exec1} "${srcfile1}" \
 
 set options [list debug]
 
-if [istarget "aarch64*-*-*"] {
+if {[istarget "aarch64*-*-*"]} {
     if {[arm_cc_for_target] != ""} {
        lappend options "compiler=[arm_cc_for_target]"
     } else {
index 8618f1a279acd09ab64c3982eae4e358fb4c6b02..2893d3641594d390457895061fd8e332a109b1e3 100644 (file)
@@ -29,7 +29,7 @@ require allow_multi_inferior_tests
 
 require can_spawn_for_attach
 
-if [build_executable "failed to prepare" $testfile $srcfile {debug}] {
+if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
     return -1
 }
 
@@ -56,7 +56,7 @@ proc create_inferior {which_inf inf_how} {
 
     # Run to main and delete breakpoints.
     proc my_runto_main {} {
-       if ![runto_main] {
+       if {![runto_main]} {
            return 0
        } else {
            # Delete breakpoints otherwise GDB would try to step over
@@ -69,7 +69,7 @@ proc create_inferior {which_inf inf_how} {
     }
 
     if {$inf_how == "run"} {
-       if [my_runto_main] {
+       if {[my_runto_main]} {
            global inferior_spawn_id
            return $inferior_spawn_id
        }
@@ -80,7 +80,7 @@ proc create_inferior {which_inf inf_how} {
        set inf_tty_name $spawn_out(slave,name)
        gdb_test_no_output "tty $inf_tty_name" "tty TTY"
 
-       if [my_runto_main] {
+       if {[my_runto_main]} {
            return $inf_spawn_id
        }
     } elseif {$inf_how == "attach"} {
index 431132e8ae97f7330914cbea37dfa3168c6523dc..a149407e43a88e05107b672f4c411a3ee99481bf 100644 (file)
@@ -36,7 +36,7 @@ proc do_test {dispose} {
     gdb_test_no_output "set follow-fork child"
     gdb_test_no_output "set detach-on-fork off"
 
-    if ![runto "child_function"] {
+    if {![runto "child_function"]} {
        return
     }
 
index b0c873112c8a1008a2ffde7f4583df36f760499c..501f0a65f22b2d8942aba815b58381469a445879 100644 (file)
@@ -38,7 +38,7 @@ gdb_test_no_output "set breakpoint always-inserted on"
 # displaced-stepping is also needed as other GDB sometimes still removes the
 # breakpoints, even with always-inserted on.
 # Without the support this test just is not as thorough as it could be.
-if [support_displaced_stepping] {
+if {[support_displaced_stepping]} {
     gdb_test_no_output "set displaced-stepping on"
 }