]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix gdb.arch
authorTom de Vries <tdevries@suse.de>
Tue, 30 Sep 2025 19:32:50 +0000 (21:32 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 30 Sep 2025 19:32:50 +0000 (21:32 +0200)
Running tclint on the test-cases in gdb.arch shows a few problems.

Fix these.

108 files changed:
gdb/tclint.toml
gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
gdb/testsuite/gdb.arch/aarch64-fp.exp
gdb/testsuite/gdb.arch/aarch64-gcs-core.exp
gdb/testsuite/gdb.arch/aarch64-gcs-disp-step.exp
gdb/testsuite/gdb.arch/aarch64-gcs-return.exp
gdb/testsuite/gdb.arch/aarch64-gcs-wrong-tdesc.exp
gdb/testsuite/gdb.arch/aarch64-gcs.exp
gdb/testsuite/gdb.arch/aarch64-mops-single-step.exp
gdb/testsuite/gdb.arch/aarch64-mops-watchpoint.exp
gdb/testsuite/gdb.arch/aarch64-mte-core.exp
gdb/testsuite/gdb.arch/aarch64-mte.exp
gdb/testsuite/gdb.arch/aarch64-non-address-bits.exp
gdb/testsuite/gdb.arch/aarch64-pauth.exp
gdb/testsuite/gdb.arch/aarch64-prologue.exp
gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp
gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl
gdb/testsuite/gdb.arch/aarch64-sme-regs-available.exp.tcl
gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe.exp.tcl
gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable.exp.tcl
gdb/testsuite/gdb.arch/aarch64-sme-sanity.exp
gdb/testsuite/gdb.arch/aarch64-sve-sigunwind.exp
gdb/testsuite/gdb.arch/aarch64-sve.exp
gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp
gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp
gdb/testsuite/gdb.arch/aarch64-w-registers.exp
gdb/testsuite/gdb.arch/alpha-step.exp
gdb/testsuite/gdb.arch/altivec-abi.exp
gdb/testsuite/gdb.arch/altivec-regs.exp
gdb/testsuite/gdb.arch/amd64-break-on-asm-line.exp
gdb/testsuite/gdb.arch/amd64-byte.exp
gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp
gdb/testsuite/gdb.arch/amd64-disp-step.exp
gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp
gdb/testsuite/gdb.arch/amd64-entry-value-param-dwarf5.exp
gdb/testsuite/gdb.arch/amd64-entry-value-param.exp
gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp
gdb/testsuite/gdb.arch/amd64-entry-value.exp
gdb/testsuite/gdb.arch/amd64-eval.exp
gdb/testsuite/gdb.arch/amd64-extended-prologue-analysis.exp
gdb/testsuite/gdb.arch/amd64-gs_base.exp
gdb/testsuite/gdb.arch/amd64-i386-address.exp
gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp
gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp
gdb/testsuite/gdb.arch/amd64-optimout-repeat.exp
gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp
gdb/testsuite/gdb.arch/amd64-shadow-stack-corefile.exp
gdb/testsuite/gdb.arch/amd64-tailcall-cxx.exp
gdb/testsuite/gdb.arch/amd64-tailcall-noret.exp
gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp
gdb/testsuite/gdb.arch/amd64-tailcall-self.exp
gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
gdb/testsuite/gdb.arch/arc-dbnz.exp
gdb/testsuite/gdb.arch/arc-decode-insn.exp
gdb/testsuite/gdb.arch/arm-cmse-sgstubs.exp
gdb/testsuite/gdb.arch/arm-neon.exp
gdb/testsuite/gdb.arch/avr-flash-qualifier.exp
gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp
gdb/testsuite/gdb.arch/e500-prologue.exp
gdb/testsuite/gdb.arch/e500-regs.exp
gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp
gdb/testsuite/gdb.arch/i386-avx.exp
gdb/testsuite/gdb.arch/i386-avx512.exp
gdb/testsuite/gdb.arch/i386-biarch-core.exp
gdb/testsuite/gdb.arch/i386-byte.exp
gdb/testsuite/gdb.arch/i386-cfi-notcurrent.exp
gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp
gdb/testsuite/gdb.arch/i386-dr3-watch.exp
gdb/testsuite/gdb.arch/i386-pkru.exp
gdb/testsuite/gdb.arch/i386-prologue-skip-cf-protection.exp
gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
gdb/testsuite/gdb.arch/i386-sse.exp
gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp
gdb/testsuite/gdb.arch/mips-fcr.exp
gdb/testsuite/gdb.arch/mips-octeon-bbit.exp
gdb/testsuite/gdb.arch/pa-nullify.exp
gdb/testsuite/gdb.arch/powerpc-addpcis.exp
gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp
gdb/testsuite/gdb.arch/powerpc-altivec.exp
gdb/testsuite/gdb.arch/powerpc-altivec2.exp
gdb/testsuite/gdb.arch/powerpc-altivec3.exp
gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
gdb/testsuite/gdb.arch/powerpc-htm-regs.exp
gdb/testsuite/gdb.arch/powerpc-lnia.exp
gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp
gdb/testsuite/gdb.arch/powerpc-power10.exp
gdb/testsuite/gdb.arch/powerpc-power7.exp
gdb/testsuite/gdb.arch/powerpc-power8.exp
gdb/testsuite/gdb.arch/powerpc-power9.exp
gdb/testsuite/gdb.arch/powerpc-ppr-dscr.exp
gdb/testsuite/gdb.arch/powerpc-prologue-frame.exp
gdb/testsuite/gdb.arch/powerpc-tar.exp
gdb/testsuite/gdb.arch/powerpc-vsx.exp
gdb/testsuite/gdb.arch/powerpc-vsx2.exp
gdb/testsuite/gdb.arch/powerpc-vsx3.exp
gdb/testsuite/gdb.arch/ppc-dfp.exp
gdb/testsuite/gdb.arch/ppc-fp.exp
gdb/testsuite/gdb.arch/ppc64-break-on-_exit.exp
gdb/testsuite/gdb.arch/riscv-bp-infcall.exp
gdb/testsuite/gdb.arch/riscv-info-fcsr.exp
gdb/testsuite/gdb.arch/s390-vregs.exp
gdb/testsuite/gdb.arch/skip-prologue.exp
gdb/testsuite/gdb.arch/sparc-sysstep.exp
gdb/testsuite/gdb.arch/sparc64-adi.exp
gdb/testsuite/gdb.arch/thumb-bx-pc.exp
gdb/testsuite/gdb.arch/thumb-singlestep.exp
gdb/testsuite/gdb.arch/vsx-regs.exp
gdb/testsuite/gdb.arch/vsx-vsr-float28.exp

index f32d064882935142a4a983db9406ffbbf7938d32..f063e3d207817bd587dc682bd605949e141331c7 100644 (file)
@@ -34,7 +34,6 @@ exclude = [
 "gdb/testsuite/boards",
 "gdb/testsuite/config",
 "gdb/testsuite/lib",
-"gdb/testsuite/gdb.arch",
 "gdb/testsuite/gdb.base",
 # IGNORE (document reason in trailing comment):
 "gdb/testsuite/gdb.stabs", # To be removed.
index 091d1f8a4ca26c438b870829501d6a817724d214..fa80a9cb86b84e602b7e4e76228ff372631fde3d 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 0c24939c26c4100277ac206d0981cf65ac644b22..ab4988cec5f036fd5bb31830f91d6e5d8533a9b1 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 9c4b7d5570c04a421ef5f8041b5dfd06e7f61f33..66990eba63714aaf0f6183a58ae42852c1bf4ba7 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 set linespec ${srcfile}:[gdb_get_line_number "Break here"]
 
-if ![runto $linespec] {
+if {![runto $linespec]} {
     return
 }
 
@@ -40,14 +40,14 @@ proc check_core_file {core_filename saved_gcspr} {
     global decimal hex
 
     # Load the core file.
-    if [gdb_test "core $core_filename" \
-           [multi_line \
-                "Core was generated by .*\\." \
-                "Program terminated with signal SIGSEGV, Segmentation fault" \
-                "Guarded Control Stack error\\." \
-                "#0  function \\(gcspr=$hex\\) at .*aarch64-gcs-core.c:$decimal" \
-                "$decimal.*__asm__ volatile \\(\"ret\\\\n\"\\);"] \
-           "load core file"] {
+    if {[gdb_test "core $core_filename" \
+            [multi_line \
+                 "Core was generated by .*\\." \
+                 "Program terminated with signal SIGSEGV, Segmentation fault" \
+                 "Guarded Control Stack error\\." \
+                 "#0  function \\(gcspr=$hex\\) at .*aarch64-gcs-core.c:$decimal" \
+                 "$decimal.*__asm__ volatile \\(\"ret\\\\n\"\\);"] \
+            "load core file"]} {
        return -1
     }
 
@@ -74,7 +74,7 @@ if {$core_generated} {
     }
 }
 
-if ![gcore_cmd_available] {
+if {![gcore_cmd_available]} {
     unsupported "target does not support gcore command."
     return
 }
@@ -82,7 +82,7 @@ if ![gcore_cmd_available] {
 clean_restart
 gdb_load $binfile
 
-if ![runto $linespec] {
+if {![runto $linespec]} {
     return
 }
 
index 2359d96aeeb998152c9c690493943363c451089f..e6252511c5cd89853fe7636609c40a7237e3a243 100644 (file)
@@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index 6f695da50fb006434226b4922c18af70e1e58245..7e531e8a06038a1271dd086c3cb9787057a3cde1 100644 (file)
@@ -31,7 +31,7 @@ set begin_line [gdb_get_line_number "Break begin"]
 set call1_line [gdb_get_line_number "Break call1"]
 set call2_line [gdb_get_line_number "Break call2"]
 
-if ![runto ${begin_line}] {
+if {![runto ${begin_line}]} {
     return
 }
 
@@ -39,7 +39,7 @@ proc restart_and_run_infcall_call2 {} {
     global binfile call2_line
     clean_restart
     gdb_load $binfile
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
     set inside_infcall_str "The program being debugged stopped while in a function called from GDB"
@@ -82,7 +82,7 @@ with_test_prefix "test return 'above' an inferior call" {
 
 clean_restart
 gdb_load $binfile
-if ![runto ${begin_line}] {
+if {![runto ${begin_line}]} {
     return
 }
 
@@ -114,7 +114,7 @@ with_test_prefix "test return from current frame" {
 
 clean_restart
 gdb_load $binfile
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index f0508cdc247aabf232e69783d88eae53e7634457..ba7741f9b4d4d738d06b52886bc34ff54df6b364 100644 (file)
@@ -36,7 +36,7 @@ if {[gdb_protocol_is_remote]} {
     return
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index b09e010459a2aa9246ce7ab46d4c764fb141785e..63c18a1e89d26c1094fe2565d715efd00e69598a 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 
 set linespec ${srcfile}:[gdb_get_line_number "Break here"]
 
-if ![runto ${linespec}] {
+if {![runto ${linespec}]} {
     return
 }
 
@@ -80,7 +80,7 @@ gdb_test "print \$gcspr == \$gcspr_in_main - 16" ". = 1" \
 # Test writing to GCSPR.
 clean_restart
 gdb_load $binfile
-if ![runto normal_function0] {
+if {![runto normal_function0]} {
     return
 }
 
index 4cdd985ec0cff2d8794a69b8dc954d6c8d6122d1..3891fcc7cc8e071f2e5683c4e2d925ef1d143978 100644 (file)
@@ -71,7 +71,7 @@ proc step_through_sequence { prefix } {
     return 0
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 70a49b50b534619342ad918ad393e96835879f41..20d2513b67c0070232dff1a30853b488d1f05a17 100644 (file)
@@ -28,7 +28,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 }
 
 set linespec ${srcfile}:[gdb_get_line_number "Break here"]
-if ![runto ${linespec}] {
+if {![runto ${linespec}]} {
     return -1
 }
 
index 7da836eba249269b31ea6c05f5aa9bb50bd0b1f4..849780a20ecf1354b84bfa76516d8fa36b92f0c4 100644 (file)
@@ -67,14 +67,14 @@ proc test_mte_core_file { core_filename mode } {
     # has the expected value, that means the core file was generated correctly
     # and that GDB read the contents correctly.
     for {set i 0} {$i < $nmaps} {incr i} {
-       for {set offset 0} {$offset < $page_size} {set offset [expr $offset + 16]} {
+       for {set offset 0} {$offset < $page_size} {set offset [expr {$offset + 16}]} {
            set hex_tag [format "%x" $tag]
            gdb_test "memory-tag print-allocation-tag mmap_pointers\[$i\] + $offset" \
                "= 0x$hex_tag" \
                "mmap_ponters\[$i\] + $offset contains expected tag"
            # Update the expected tag.  The test writes tags in sequential
            # order.
-           set tag [expr ($tag + 1) % 16]
+           set tag [expr {($tag + 1) % 16}]
        }
     }
 }
@@ -98,7 +98,7 @@ proc test_mode { mode } {
     }
     set binfile [standard_output_file ${executable}]
 
-    if ![runto_main] {
+    if {![runto_main]} {
        untested "could not run to main"
        return -1
     }
index 8bb5814e21bb0c37e0d32751e1568ac6d43a203f..a228755705531363b5fe5db679c52497731cd7f5 100644 (file)
@@ -50,7 +50,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -63,7 +63,7 @@ if {![supports_memtag]} {
 
 gdb_breakpoint "access_memory"
 
-if [gdb_continue "access_memory"] {
+if {[gdb_continue "access_memory"]} {
     return -1
 }
 
@@ -104,7 +104,7 @@ with_test_prefix "literals" {
            set addr_tagged [get_tagged_ptr $i ${tagged_ptr_addr}]
        }
 
-       set tag_hexnz [get_hex_tag [expr $i % 16]]
+       set tag_hexnz [get_hex_tag [expr {$i % 16}]]
        gdb_test "memory-tag print-logical-tag ${addr_tagged}" \
                 " = 0x${tag_hexnz}" \
                 "print-logical-tag with tag ${i}"
@@ -124,7 +124,7 @@ with_test_prefix "literals" {
                 $atag_msg \
                 "set-allocation-tag with tag ${i}"
 
-       set tag_hexnz [get_hex_tag [expr $i % 16]]
+       set tag_hexnz [get_hex_tag [expr {$i % 16}]]
        gdb_test "memory-tag print-allocation-tag ${tagged_ptr_addr}" " = 0x${tag_hexnz}" \
                 "print-allocation-tag with tag ${i}"
     }
@@ -139,7 +139,7 @@ with_test_prefix "literals" {
                     $atag_msg \
                     "set-allocation-tag with tag ${i}"
 
-           set atag_hexnz [get_hex_tag [expr $i % 16]]
+           set atag_hexnz [get_hex_tag [expr {$i % 16}]]
 
            # Validate that the logical tag matches the allocation tag.
            with_test_prefix "tag ${i}" {
@@ -152,14 +152,14 @@ with_test_prefix "literals" {
 
            # Get a pointer with the logical tag that does not match the
            # allocation tag.
-           set ltag [expr $i + 1]
+           set ltag [expr {$i + 1}]
            with_test_prefix "fetch mismatch tag ${i}" {
                set addr_tagged [get_tagged_ptr $ltag ${tagged_ptr_addr}]
            }
 
            # Validate that the logical tag does not match the allocation
            # tag.
-           set ltag_hexnz [get_hex_tag [expr [expr $i + 1]% 16]]
+           set ltag_hexnz [get_hex_tag [expr {($i + 1) % 16}]]
            gdb_test "memory-tag check ${addr_tagged}" \
                     "Logical tag \\(0x${ltag_hexnz}\\) does not match the allocation tag \\(0x${atag_hexnz}\\) for address $hex\." \
                     "check mismatch with tag ${i}"
@@ -187,7 +187,7 @@ with_test_prefix "symbolic" {
                               "update value of symbol ${tagged_ptr_symbol}"
        }
 
-       set tag_hexnz [get_hex_tag [expr $i % 16]]
+       set tag_hexnz [get_hex_tag [expr {$i % 16}]]
        gdb_test "memory-tag print-logical-tag ${tagged_ptr_symbol}" \
                 " = 0x${tag_hexnz}" \
                 "print-logical-tag with tag ${i}"
@@ -211,7 +211,7 @@ with_test_prefix "symbolic" {
                 $atag_msg \
                 "set-allocation-tag with tag ${i}"
 
-       set tag_hexnz [get_hex_tag [expr $i % 16]]
+       set tag_hexnz [get_hex_tag [expr {$i % 16}]]
        gdb_test "memory-tag print-allocation-tag ${tagged_ptr_symbol}" \
                 " = 0x${tag_hexnz}" \
                 "print-allocation-tag with tag ${i}"
@@ -227,7 +227,7 @@ with_test_prefix "symbolic" {
                     $atag_msg \
                     "set-allocation-tag with tag ${i}"
 
-           set atag_hexnz [get_hex_tag [expr $i % 16]]
+           set atag_hexnz [get_hex_tag [expr {$i % 16}]]
 
            # Validate that the logical tag matches the allocation tag.
            with_test_prefix "tag ${i}" {
@@ -245,7 +245,7 @@ with_test_prefix "symbolic" {
 
            # Get a pointer with the logical tag that does not match the
            # allocation tag.
-           set ltag [expr $i + 1]
+           set ltag [expr {$i + 1}]
            with_test_prefix "fetch mismatch tag ${i}" {
                set addr_tagged [get_tagged_ptr $ltag ${tagged_ptr_addr}]
            }
@@ -257,7 +257,7 @@ with_test_prefix "symbolic" {
 
            # Validate that the logical tag does not match the allocation
            # tag.
-           set ltag_hexnz [get_hex_tag [expr [expr $i + 1]% 16]]
+           set ltag_hexnz [get_hex_tag [expr {($i + 1) % 16}]]
            gdb_test "memory-tag check ${tagged_ptr_symbol}" \
                     "Logical tag \\(0x${ltag_hexnz}\\) does not match the allocation tag \\(0x${atag_hexnz}\\) for address $hex\." \
                     "check mismatch with tag ${i}"
@@ -281,7 +281,7 @@ with_test_prefix "print command" {
        return -1
     }
 
-    set atag [expr [expr $ltag + 1] % 16]
+    set atag [expr {($ltag + 1) % 16}]
     set atag_hexnn [get_tag_nn $atag]
 
     gdb_test "memory-tag set-allocation-tag ${tagged_ptr_symbol} 1 ${atag_hexnn}" \
@@ -334,13 +334,13 @@ gdb_test "continue" \
 
 # Restart to execute the async tag fault test.
 with_test_prefix "async" {
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
     gdb_breakpoint "access_memory"
 
-    if [gdb_continue "access_memory"] {
+    if {[gdb_continue "access_memory"]} {
        fail "could not run to tagged memory test function"
        return -1
     }
index 0f90da82edbf4d880a5bacf184efecf3d165d645..e3023d1a2062c6eed5c024e2d39cad3bcccf6ced 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 72cefa19f8ec2597eaa5f37e97046e27aac414c1..89193ce37620967eab1d369ca606627497bc514e 100644 (file)
@@ -45,7 +45,7 @@ if {!$compilation_ok} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index f782daac9826b47681b07f65d487a0e3a3a327a5..2e0d05de298a960e8f821ac3f4c67a2a9852c8ee 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
    return -1
 }
 
index f8039d43ed8534ba1a709c6c13b590c55d2dc5e5..cce73764de43c094737f81c436dad60e70505e2f 100644 (file)
@@ -32,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} ${compile_f
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -91,7 +91,7 @@ gdb_breakpoint [gdb_get_line_number "exit(0)"]
 gdb_continue_to_breakpoint "exit" ".*exit.*"
 
 set handlerframe [get_current_frame_number]
-set mainframe [expr $handlerframe + 2]
+set mainframe [expr {$handlerframe + 2}]
 
 
 # Check register values
index 64cfd54c868d228f935d2a3ff9e8b37a525a8f9a..b57ff735551c7ab1d70de133a9aa9b6d982ca0aa 100644 (file)
@@ -25,13 +25,13 @@ load_lib aarch64-scalable.exp
 #
 proc check_sme_core_file { core_filename state vl svl } {
     # Load the core file.
-    if [gdb_test "core $core_filename" \
-       [multi_line \
-           "Core was generated by.*\." \
-           "Program terminated with signal SIGSEGV, Segmentation fault\." \
-           "#0  ${::hex} in main \\(.*\\) at .*" \
+    if {[gdb_test "core $core_filename" \
+            [multi_line \
+                 "Core was generated by.*\." \
+                 "Program terminated with signal SIGSEGV, Segmentation fault\." \
+                 "#0  ${::hex} in main \\(.*\\) at .*" \
            ".*p = 0xff;.* crash point .*"] \
-           "load core file"] {
+            "load core file"]} {
        untested "failed to generate core file"
        return -1
     }
@@ -169,7 +169,7 @@ proc test_sme_core_file { id_start id_end } {
                return -1
            }
 
-           if ![runto_main] {
+           if {![runto_main]} {
                untested "could not run to main"
                return -1
            }
index 4dc106e4ece8ad7c6b36ec1d9a0dbe0c1111aacd..de17e4e95ca5f5d9b5732436a682b94cf72c0395 100644 (file)
@@ -34,11 +34,11 @@ require !gdb_protocol_is_remote
 #
 proc check_regs { mode vl svl } {
     # Check VG to make sure it is correct
-    set expected_vg [expr $vl / 8]
+    set expected_vg [expr {$vl / 8}]
     gdb_test "print \$vg" "= ${expected_vg}"
 
     # Check SVG to make sure it is correct
-    set expected_svg [expr $svl / 8]
+    set expected_svg [expr {$svl / 8}]
     gdb_test "print \$svg" "= ${expected_svg}"
 
     # If svl is adjusted by prctl, we will have ZA enabled.  If gdb is
@@ -50,13 +50,13 @@ proc check_regs { mode vl svl } {
     }
 
     # Check SVCR.
-    if [gdb_test "print \$svcr" $za_state "svcr before assignments" ] {
+    if {[gdb_test "print \$svcr" $za_state "svcr before assignments" ]} {
        fail "incorrect za state"
        return -1
     }
 
     # Check the size of ZA.
-    set expected_za_size [expr $svl * $svl]
+    set expected_za_size [expr {$svl * $svl}]
     gdb_test "print sizeof \$za" " = $expected_za_size"
 
     # Check the size of Z0.
@@ -69,7 +69,7 @@ proc check_regs { mode vl svl } {
 
     # Exercise reading/writing from/to the tile pseudo-registers.
     set last_tile 1
-    set expected_size [expr $svl * $svl]
+    set expected_size [expr {$svl * $svl}]
     set tile_svl $svl
     set za_state "= \\\[ ZA \\\]"
     foreach_with_prefix granularity {"b" "h" "s" "d" "q"} {
@@ -83,7 +83,7 @@ proc check_regs { mode vl svl } {
            initialize_2d_array $register_name 255 $tile_svl $tile_svl
 
            # Make sure we have ZA state.
-           if [gdb_test "print \$svcr" $za_state "svcr after assignment to ${register_name}" ] {
+           if {[gdb_test "print \$svcr" $za_state "svcr after assignment to ${register_name}" ]} {
                fail "incorrect za state"
                return -1
            }
@@ -91,9 +91,9 @@ proc check_regs { mode vl svl } {
            set pattern [string_to_regexp [2d_array_value_pattern 255 $tile_svl $tile_svl]]
            gdb_test "print $register_name" " = $pattern" "read back from $register_name"
        }
-       set last_tile [expr $last_tile * 2]
-       set expected_size [expr $expected_size / 2]
-       set tile_svl [expr $tile_svl / 2]
+       set last_tile [expr {$last_tile * 2}]
+       set expected_size [expr {$expected_size / 2}]
+       set tile_svl [expr {$tile_svl / 2}]
     }
 
     # Exercise reading/writing from/to the tile slice pseudo-registers.
@@ -114,7 +114,7 @@ proc check_regs { mode vl svl } {
                    initialize_1d_array $register_name 255 $num_elements
 
                    # Make sure we have ZA state.
-                   if [gdb_test "print \$svcr" $za_state "svcr after assignment of ${register_name}" ] {
+                   if {[gdb_test "print \$svcr" $za_state "svcr after assignment of ${register_name}" ]} {
                        fail "incorrect za state"
                        return -1
                    }
@@ -124,13 +124,13 @@ proc check_regs { mode vl svl } {
                }
            }
        }
-       set last_tile [expr $last_tile * 2]
-       set last_slice [expr ($last_slice / 2)]
-       set num_elements [expr $num_elements / 2]
+       set last_tile [expr {$last_tile * 2}]
+       set last_slice [expr {($last_slice / 2)}]
+       set num_elements [expr {$num_elements / 2}]
     }
 
     # Exercise reading/writing from/to SME2 registers.
-    if [is_sme2_available] {
+    if {[is_sme2_available]} {
       # The target supports SME2.
       set zt_size 64
       gdb_test "print sizeof \$zt0" " = $zt_size"
@@ -163,7 +163,7 @@ proc test_sme_registers_available { id_start id_end } {
     }
     set binfile [standard_output_file ${executable}]
 
-    if ![runto_main] {
+    if {![runto_main]} {
        untested "could not run to main"
        return -1
     }
@@ -245,8 +245,8 @@ proc test_sme_registers_available { id_start id_end } {
            gdb_continue_to_breakpoint $non_prctl_breakpoint
 
            # Adjust svl via gdb.
-           set vg_value [expr $vl / 8]
-           set svg_value [expr $svl / 8]
+           set vg_value [expr {$vl / 8}]
+           set svg_value [expr {$svl / 8}]
            gdb_test_no_output "set \$vg = ${vg_value}"
            gdb_test_no_output "set \$svg = ${svg_value}"
 
index 403da75a4d03b91a9e9cbd0825b25ecf1b5fdb32..4f37019168e878d2569c0ef8f9e0d9bbf6c8f941 100644 (file)
@@ -42,7 +42,7 @@ proc test_sme_registers_sigframe { id_start id_end } {
     }
     set binfile [standard_output_file ${executable}]
 
-    if ![runto_main] {
+    if {![runto_main]} {
        untested "could not run to main"
        return -1
     }
@@ -83,16 +83,16 @@ proc test_sme_registers_sigframe { id_start id_end } {
            }
 
            # Run the program until it has adjusted the svl.
-           if [gdb_continue_to_breakpoint $sigill_breakpoint] {
+           if {[gdb_continue_to_breakpoint $sigill_breakpoint]} {
                return -1
            }
 
            # Check SVG to make sure it is correct
-           set expected_svg [expr $svl / 8]
+           set expected_svg [expr {$svl / 8}]
            gdb_test "print \$svg" "= ${expected_svg}"
 
            # Check the size of ZA.
-           set expected_za_size [expr $svl * $svl]
+           set expected_za_size [expr {$svl * $svl}]
            gdb_test "print sizeof \$za" " = $expected_za_size"
 
            # Check the value of SVCR.
@@ -134,14 +134,14 @@ proc test_sme_registers_sigframe { id_start id_end } {
            gdb_test_no_output "set \$tpidr2=0x0102030405060708"
 
            # Run to the illegal instruction.
-           if [gdb_test "continue" "Continuing\.\r\n\r\nProgram received signal SIGILL, Illegal instruction\..*in main.*"] {
+           if {[gdb_test "continue" "Continuing\.\r\n\r\nProgram received signal SIGILL, Illegal instruction\..*in main.*"]} {
                return
            }
 
            # Skip the illegal instruction.  The signal handler will be called after we continue.
            gdb_test_no_output "set \$pc=\$pc+4"
            # Continue to the signal handler.
-           if [gdb_continue_to_breakpoint $handler_breakpoint] {
+           if {[gdb_continue_to_breakpoint $handler_breakpoint]} {
                return -1
            }
 
@@ -159,7 +159,7 @@ proc test_sme_registers_sigframe { id_start id_end } {
            }
 
            # Check the size of ZA in the signal frame.
-           set expected_za_size [expr $svl * $svl]
+           set expected_za_size [expr {$svl * $svl}]
            gdb_test "print sizeof \$za" " = $expected_za_size" "size of za in signal frame"
 
            # Check the value of SVCR in the signal frame.
@@ -172,7 +172,7 @@ proc test_sme_registers_sigframe { id_start id_end } {
            gdb_test "print/x \$tpidr2" " = 0x102030405060708" "tpidr2 contents from signal frame"
 
            # Check the value of SME2 ZT0 in the signal frame.
-           if [is_sme2_available] {
+           if {[is_sme2_available]} {
                # The target supports SME2.
                set zt_size 64
                gdb_test "print sizeof \$zt0" " = $zt_size"
index ba69b76787893108913fcf6cb0b5952c0f1fb419..04e8b889b7c3020b03d48b9e916ce555775bfb51 100644 (file)
@@ -26,21 +26,21 @@ load_lib aarch64-scalable.exp
 #
 proc_with_prefix check_regs { vl svl } {
     # Check VG to make sure it is correct
-    set expected_vg [expr $vl / 8]
+    set expected_vg [expr {$vl / 8}]
     gdb_test "print \$vg" "= ${expected_vg}"
 
     # Check SVG to make sure it is correct
-    set expected_svg [expr $svl / 8]
+    set expected_svg [expr {$svl / 8}]
     gdb_test "print \$svg" "= ${expected_svg}"
 
     # Make sure there is no SM or ZA state.
-    if [gdb_test "print \$svcr" "= \\\[ \\\]"] {
+    if {[gdb_test "print \$svcr" "= \\\[ \\\]"]} {
        fail "incorrect ZA state"
        return -1
     }
 
     # Check the size of ZA.
-    set expected_za_size [expr $svl * $svl]
+    set expected_za_size [expr {$svl * $svl}]
     gdb_test "print sizeof \$za" " = $expected_za_size"
 
     # Check the size of Z0.
@@ -69,15 +69,15 @@ proc_with_prefix check_regs { vl svl } {
                }
            }
        }
-       set last_tile [expr $last_tile * 2]
-       set last_slice [expr ($last_slice / 2)]
-       set elements [expr ($elements / 2)]
+       set last_tile [expr {$last_tile * 2}]
+       set last_slice [expr {($last_slice / 2)}]
+       set elements [expr {($elements / 2)}]
     }
 
     # Exercise reading/writing the tile pseudo-registers.
     set last_tile 1
     set elements $svl
-    set expected_size [expr $svl * $svl]
+    set expected_size [expr {$svl * $svl}]
     foreach_with_prefix granularity {"b" "h" "s" "d" "q"} {
        set pattern [string_to_regexp [2d_array_value_pattern 0 $elements $elements]]
        for {set tile 0} {$tile < $last_tile} {incr tile} {
@@ -86,13 +86,13 @@ proc_with_prefix check_regs { vl svl } {
            gdb_test "print sizeof ${register_name}" " = ${expected_size}"
            gdb_test "print ${register_name}" $pattern
        }
-       set last_tile [expr $last_tile * 2]
-       set expected_size [expr $expected_size / 2]
-       set elements [expr ($elements / 2)]
+       set last_tile [expr {$last_tile * 2}]
+       set expected_size [expr {$expected_size / 2}]
+       set elements [expr {($elements / 2)}]
     }
 
     # Exercise reading from SME2 registers.
-    if [is_sme2_available] {
+    if {[is_sme2_available]} {
        # The target supports SME2.
        set zt_size 64
        gdb_test "print sizeof \$zt0" " = $zt_size"
@@ -128,7 +128,7 @@ proc test_sme_registers_unavailable { id_start id_end } {
        return -1
     }
 
-    if ![runto_main] {
+    if {![runto_main]} {
        untested "could not run to main"
        return -1
     }
@@ -207,8 +207,8 @@ proc test_sme_registers_unavailable { id_start id_end } {
            }
 
            # Adjust vg and svg.
-           set vg_value [expr $vl / 8]
-           set svg_value [expr $svl / 8]
+           set vg_value [expr {$vl / 8}]
+           set svg_value [expr {$svl / 8}]
            gdb_test_no_output "set \$vg = ${vg_value}"
            gdb_test_no_output "set \$svg = ${svg_value}"
 
index c72e5784fd4535d19a8cfe67a7e83089f934ad9f..96640698d793408c38beb125020741dfd06b03aa 100644 (file)
@@ -60,8 +60,8 @@ gdb_test_no_output "set print repeats 1" "adjust repeat count"
 # Fetch both the vector length and the streaming vector length the target
 # system is using.  We do not force any vector lengths and do not change
 # it mid-execution.
-set vl [expr [get_valueof "" "\$vg" "0" "fetch value of vl"] * 8]
-set svl [expr [get_valueof "" "\$svg" "0" "fetch value of svl"] * 8]
+set vl [expr {[get_valueof "" "\$vg" "0" "fetch value of vl"] * 8}]
+set svl [expr {[get_valueof "" "\$svg" "0" "fetch value of svl"] * 8}]
 
 # Now we are at the point where we can start checking state and moving the
 # testcase forward.
index 32340bb53a33d1d8825e7cc8765bb0af6ed11a43..7a47fc78dfbd3327f0eb53d40cdf761094e28f34 100644 (file)
@@ -58,12 +58,12 @@ gdb_test "handle SIGUSR1 nostop" \
 set linespec ${srcfile}:[gdb_get_line_number "Break here."]
 gdb_test_no_output "set args $first_vl $second_vl"
 
-if ![runto ${linespec}] {
+if {![runto ${linespec}]} {
     return
 }
 
-set first_vg [expr $first_vl/8]
-set second_vg [expr $second_vl/8]
+set first_vg [expr {$first_vl/8}]
+set second_vg [expr {$second_vl/8}]
 
 gdb_test "print \$vg" ". = $second_vg" "vg was changed"
 
@@ -77,10 +77,10 @@ for {set row 0} {$row < 32} {incr row} {
 
 for {set row 0} {$row < 16} {incr row} {
     set register_name "\$p${row}"
-    gdb_test "print $register_name" ". = \\{(0, ){[expr $second_vl/8 - 1]}0\\}" \
+    gdb_test "print $register_name" ". = \\{(0, ){[expr {$second_vl/8 - 1}]}0\\}" \
        "$register_name contents in signal handler"
 }
-gdb_test "print \$ffr" ". = \\{(255, ){[expr $second_vl/8 - 1]}255\\}" \
+gdb_test "print \$ffr" ". = \\{(255, ){[expr {$second_vl/8 - 1}]}255\\}" \
     "ffr contents in signal handler"
 
 gdb_test "frame function main" \
@@ -99,8 +99,8 @@ for {set row 0} {$row < 32} {incr row} {
 
 for {set row 0} {$row < 16} {incr row} {
     set register_name "\$p${row}"
-    gdb_test "print $register_name" ". = \\{(1, ){[expr $first_vl/8 - 1]}1\\}" \
+    gdb_test "print $register_name" ". = \\{(1, ){[expr {$first_vl/8 - 1}]}1\\}" \
        "$register_name contents were correctly unwound"
 }
-gdb_test "print \$ffr" ". = \\{(255, ){[expr $first_vl/8 - 1]}255\\}" \
+gdb_test "print \$ffr" ". = \\{(255, ){[expr {$first_vl/8 - 1}]}255\\}" \
     "ffr contents were correctly unwound"
index 34bcff26780543c0c3381709f66f40061ccd964c..6cdc30d64583370a0714597586d206f24cbf0965 100644 (file)
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 
 set linespec ${srcfile}:[gdb_get_line_number "break here"]
 
-if ![runto ${linespec}] {
+if {![runto ${linespec}]} {
     return
 }
 
@@ -59,7 +59,7 @@ proc get_register_value {register} {
 
 # The test executable halves the vector length in a loop, so loop along
 # to check it.
-for {set i [get_register_value "vg"]} {$i > 1} {set i [expr $i / 2]} {
+for {set i [get_register_value "vg"]} {$i > 1} {set i [expr {$i / 2}]} {
     set lines_before [count_info_registers]
 
     gdb_test "next" ".*if .res < 0." "step over prctl vg = ${i}"
index 904f92fe8794b10d9554f789e29435870657ae5d..eb2bc9267865f5d44d15ed942b15969a58b0fdf9 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 1bcd1b20b645c54ebbe9d6649e678ad4112f831c..bc6d242329f1236727231e020a62ad9726b150e7 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 409beec80fdf63d75c71ec4ee51e268429b23ad4..06c662694650c75e9c8bf5f8d3a22f32aa47f38d 100644 (file)
@@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     untested "could not run to main"
     return -1
 }
index bdbfeecd341c2fc06d9438afdcc635814a358882..aea492e5206b6cf73e82e046e130e7c65aaba661 100644 (file)
@@ -42,50 +42,50 @@ proc test_stepi {function } {
     gdb_test "break *$function+4" \
              "Breakpoint .* at .*" \
              "breakpoint on fb$function instruction"
-    
+
     gdb_test "continue" \
              "Breakpoint .*, 0x\[0-9a-fA-F\]+ in $function\(\).*" \
              "continue to fb$function instruction (first call)"
-    
+
     # Extra check to make sure we stopped on the FP branch instruction.
-    
+
     gdb_test "x /i \$pc" \
              "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+fb$function.*" \
              "Check breakpoint on fb$function instruction (first call)"
-    
+
     # Step test, followed by the check that we landed on the expected
     # instruction (the testcase should be written in such a way that
     # the branch is taken on the first call to this function.
-    
+
     gdb_test "stepi" \
              "0x\[0-9a-fA-F\]+.*" \
              "stepi on fb$function (first call)"
-    
+
     gdb_test "x /i \$pc" \
              "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+ret.*" \
              "Check stepi over fb$function stopped on ret"
-    
+
     # Continue again. FUNCTION should be called a second time, this time
     # with an argument such that the FP branch will not be taken.
-    
+
     gdb_test "continue" \
              "Breakpoint .*, 0x\[0-9a-fA-F\]+ in $function\(\).*" \
              "continue to fb$function instruction (second call)"
-    
+
     # Extra check to make sure we stopped on the FP branch instruction.
-    
+
     gdb_test "x /i \$pc" \
              "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+fb$function.*" \
              "Check breakpoint on fb$function instruction (second call)"
-    
+
     # Step test, branch should not be taken.
-    
+
     gdb_test "stepi" \
              "0x\[0-9a-fA-F\]+.*" \
              "stepi on fb$function (branch not taken)"
-    
+
     # Extra check to verify that we landed on the instruction we expected.
-    
+
     gdb_test "x /i \$pc" \
              "0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+fneg.*" \
              "check stepi over fb$function stopped on fneg instruction"
index fb5367d6b1419c74951f448d82f26f433419d83c..c41e82d3e4e3a76ce4d436e23ee08038570a8585 100644 (file)
@@ -39,7 +39,7 @@ proc altivec_abi_tests { extra_flags force_abi } {
     if { "$force_abi" == "auto" } {
        # If the toolchain does not record attributes, skip auto-ABI tests.
        set readelf_program [gdb_find_readelf]
-       set result [catch "exec $readelf_program -A $binfile" output]
+       set result [catch {exec $readelf_program -A $binfile} output]
 
        if {$result == 0 && ![regexp Tag_GNU_Power_ABI_Vector $output]} {
            untested "ABI not marked"
@@ -132,7 +132,7 @@ proc altivec_abi_tests { extra_flags force_abi } {
     gdb_test "p matrix\[3\]" ".*= .31, 32, 33, 34, 35, 36, 37, 38." "print fourth vector"
 }
 
-if [test_compiler_info gcc*] {
+if {[test_compiler_info gcc*]} {
     set binprefix ${binfile}
 
     with_test_prefix "default ABI, auto" {
@@ -166,7 +166,7 @@ if [test_compiler_info gcc*] {
            altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "auto"
        }
     }
-} elseif [test_compiler_info xlc*] {
+} elseif {[test_compiler_info xlc*]} {
     altivec_abi_tests "additional_flags=-qaltivec" "auto"
 } else {
     warning "unknown compiler"
index d297f4bb37fb7597cbdac9642766fc70c936fd02..dfe7e243a9602a327a9a1d30e839bc87e44670f4 100644 (file)
@@ -1,5 +1,5 @@
 # Copyright (C) 2002-2025 Free Software Foundation, Inc.
-# 
+#
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
@@ -26,9 +26,9 @@ require allow_altivec_tests
 standard_testfile
 
 set compile_flags {debug nowarnings}
-if [test_compiler_info gcc*] {
+if {[test_compiler_info gcc*]} {
     set compile_flags "$compile_flags additional_flags=-maltivec additional_flags=-mabi=altivec"
-} elseif [test_compiler_info xlc*] {
+} elseif {[test_compiler_info xlc*]} {
     set compile_flags "$compile_flags additional_flags=-qaltivec"
 } else {
     warning "unknown compiler"
@@ -134,11 +134,11 @@ gdb_test "continue" \
   "Breakpoint $decimal, vector_fun .a=.0xfefefefe, 0xfefefefe, 0xfefefefe, 0xfefefefe., b=.0x1010101, 0x1010101, 0x1010101, 0x1010101.*altivec-regs.c.*vec_splat_u8.2..;" \
   "continue to vector_fun"
 
-# Do a next over the assignment to vector 'a'. 
+# Do a next over the assignment to vector 'a'.
 gdb_test "next" ".*b = \\(\\(vector unsigned int\\) vec_splat_u8\\(3\\)\\);" \
   "next (1)"
 
-# Do a next over the assignment to vector 'b'. 
+# Do a next over the assignment to vector 'b'.
 gdb_test "next" "c = vec_add \\(a, b\\);" \
   "next (2)"
 
index 7f0a8b8f133a42b5318544d4f161db5a373f8b09..a2caf465a54ef1b480cf51053c23c1052b4b6fcc 100644 (file)
@@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index d0843031efa627e0269a89d92f73b08a59a12fa1..d67361d7ccf76572f537496f5d57f1bb41e78a44 100644 (file)
@@ -63,7 +63,7 @@ with_test_prefix "at first bp" {
     }
 
     for { set r 1 } { $r <= 4  } { incr r } {
-       set h [expr $r + 14]
+       set h [expr {$r + 14}]
        gdb_test "print/x \$$byte_regs($h)" \
            ".. = 0x[format %x $r]2" \
            "check contents of %$byte_regs($h)"
@@ -85,7 +85,7 @@ with_test_prefix "at second bp" {
     }
 
     for { set r 1 } { $r <= 4  } { incr r } {
-       set h [expr $r + 14]
+       set h [expr {$r + 14}]
        gdb_test "set var \$$byte_regs($h) = $h" "" "set %$byte_regs($h)"
     }
 }
@@ -101,7 +101,7 @@ with_test_prefix "at third bp" {
     }
 
     for { set r 1 } { $r <= 4  } { incr r } {
-       set h [expr $r + 14]
+       set h [expr {$r + 14}]
        gdb_test "print \$$byte_regs($h)" \
            ".. = $h" \
            "check contents of %$byte_regs($h)"
index 61ce4bebe2db0915c96637dec0210e5f4f495226..cd982a0c7a1c3412fb1c10502f8aeb947510dfbd 100644 (file)
@@ -59,7 +59,7 @@ gdb_test_multiple "x/2i \$pc" "get address of next insn" {
 }
 
 # Clear the slot on the stack and confirm it was set to zero.
-set sp [expr $sp - 0x8]
+set sp [expr {$sp - 0x8}]
 gdb_test_no_output "set {unsigned long long} $sp = 0" \
     "clear stack slot"
 set zero_val 0x[format %016x 0]
@@ -73,7 +73,7 @@ gdb_test "stepi" \
 # Check stack pointer was updated to the expected value.
 set new_sp [get_hexadecimal_valueof "\$sp" "*UNKNOWN*" \
               "get stack pointer after step"]
-gdb_assert {[expr $sp == $new_sp]} \
+gdb_assert {[expr {$sp == $new_sp}]} \
     "check stack pointer was updated as expected"
 
 # Check the contents of the stack were updated to the expected value.
index aee1d7a5d2a1058dbb4f4ef9f074db262c91baea..3b0d82886d7f100ff2cf3e359bbd3ac3604f4653 100644 (file)
@@ -143,7 +143,7 @@ proc set_regs { regs val } {
        # Use send_gdb/gdb_expect so that these aren't logged as pass/fail.
        send_gdb "set \$${reg} = ${val}\n"
        gdb_expect 10 {
-           -re "$gdb_prompt $" { 
+           -re "$gdb_prompt $" {
                verbose "Setting ${reg} to ${val}." 2
            }
            timeout {
@@ -223,7 +223,7 @@ proc rip_test { reg test_start_label test_end_label signal_modes } {
            # the displaced step, but instead just delivers the signal.
            set inferior_pid [get_inferior_pid]
            # Ensure that $inferior_pid refers to a single process.
-           gdb_assert {[expr $inferior_pid > 0]} \
+           gdb_assert {[expr {$inferior_pid > 0}]} \
                "check for a sane inferior pid"
            if {$inferior_pid > 0} {
                remote_exec target "kill -ALRM $inferior_pid"
index 14946d702ff5853fad561e04c8bf7f20a0141b9e..ec6ebc4acd448225e670222f7d2de0602a712e7a 100644 (file)
@@ -16,7 +16,7 @@
 set opts {}
 standard_testfile .S .c
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-inline.exp COMPILE=1"
     standard_testfile .c .c
     lappend opts debug optimize=-O2
@@ -25,7 +25,7 @@ if [info exists COMPILE] {
 }
 
 # Make .c available on the host.
-if [is_remote host] {
+if {[is_remote host]} {
     gdb_remote_download host $srcdir/$subdir/$srcfile2
 }
 
@@ -33,7 +33,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index d31c057e3b5223355b8c703b548ad5c02a99b98b..2207ecfbd18bf7224e199e019ed51df112af20eb 100644 (file)
@@ -16,7 +16,7 @@
 standard_testfile .S .c
 set opts {}
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-param-dwarf5.exp COMPILE=1"
     standard_testfile .c .c
     lappend opts optimize=-O2 dwarf5
@@ -25,7 +25,7 @@ if [info exists COMPILE] {
 }
 
 # Make .c available on the host.
-if [is_remote host] {
+if {[is_remote host]} {
     gdb_remote_download host $srcdir/$subdir/$srcfile2
 }
 
@@ -33,7 +33,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 0c7cd213bf76928764a727803b8fe4c756da087c..57b3ca452e881b61b53cf7faaced7c4125e4a778 100644 (file)
@@ -16,7 +16,7 @@
 standard_testfile .S .c
 set opts {}
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-param.exp COMPILE=1"
     standard_testfile .c .c
     lappend opts debug optimize=-O2
@@ -25,7 +25,7 @@ if [info exists COMPILE] {
 }
 
 # Make .c available on the host.
-if [is_remote host] {
+if {[is_remote host]} {
     remote_download host $srcdir/$subdir/$srcfile2
 }
 
@@ -33,7 +33,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index e508a041a0b7c5fa5bd5531dfc84977d39cbd161..94737f308369fb77f5f3b2429cf35bba4a2a1145 100644 (file)
@@ -18,7 +18,7 @@ standard_testfile .S .cc
 require is_x86_64_m64_target
 
 # Make .cc available on the host.
-if [is_remote host] {
+if {[is_remote host]} {
     gdb_remote_download host $srcdir/$subdir/$srcfile2
 }
 
@@ -27,7 +27,7 @@ if { [prepare_for_testing_full "failed to prepare" \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 2bc676c4647c96e5f99e7243ae319abc52a5d966..59f09752b8a302168fe8433d792c5eabe9a7529b 100644 (file)
@@ -16,7 +16,7 @@
 standard_testfile .s
 set opts {nopie}
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value.exp COMPILE=1"
     set srcfile ${testfile}.cc
     lappend opts debug
@@ -30,7 +30,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 3d798eeacfa06ddfa271fac7985b21726bd29296..79ff8aa86ea5b6b2cd2ab19f63f8c3d60ca6e917 100644 (file)
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 356afc7e6688259af2b2c0af61ea03f8b8c3a9cb..dcdb850a6b3dcd47433135b28390a9504ab5f56c 100644 (file)
@@ -37,7 +37,7 @@ proc test_run {} {
     set main_r12 [get_integer_valueof "\$r12" "null"]
     gdb_assert { $main_r12 ne "null" }
 
-    set foo_r12 [expr "$main_r12 + 2"]
+    set foo_r12 [expr {$main_r12 + 2}]
     gdb_test "print \$r12=$foo_r12" "$foo_r12" "Set foo's %r12=$foo_r12"
     gdb_test "up" ".*main.*" "Go up a frame from foo"
     gdb_test "print \$r12" "$main_r12" "foo's %r12 unwound"
@@ -52,7 +52,7 @@ proc offset_test_run {} {
     set old_reg_val [get_integer_valueof "\$r12" "null"]
     gdb_assert { $old_reg_val ne "null" }
 
-    set new_reg_val [expr "$old_reg_val + 3"]
+    set new_reg_val [expr {$old_reg_val + 3}]
     gdb_test "print \$r14=$new_reg_val" "$new_reg_val" "Set %r14=$new_reg_val"
     gdb_test "print \$r13=$new_reg_val" "$new_reg_val" "Set %r13=$new_reg_val"
     gdb_test "print \$r12=$new_reg_val" "$new_reg_val" "Set %r12=$new_reg_val"
index 90cbe02151cd6d6cc258132e3af14cdb2ede7052..a48cbec62d30afcad1c6c1bd205df0edcf83c0ff 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 55a25dbbbdd2fd8f397a718d242c2ce585b83139..31ce7046b69537a50c22501f9ff66d6444dbb809 100644 (file)
@@ -21,7 +21,7 @@
 require {is_any_target "x86_64-*-*" "i?86-*-*"} is_lp64_target
 require {!istarget "*-*-openbsd*"}
 
-if [prepare_for_testing "failed to prepare" amd64-i386-address amd64-i386-address.S [list debug "additional_flags=-m32 -nostdlib"]] {
+if {[prepare_for_testing "failed to prepare" amd64-i386-address amd64-i386-address.S [list debug "additional_flags=-m32 -nostdlib"]]} {
     return -1
 }
 
index 451c84b847506823ae625cfcf8dcc2f71c21cc3e..a499eae7a3e9e93421433bb4d9dd8af674dc6fc8 100644 (file)
@@ -35,7 +35,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {nopie}] }
     return -1
 }
 
-if ![runto breakpt] {
+if {![runto breakpt]} {
     return -1
 }
 
@@ -47,7 +47,7 @@ gdb_test "bt" "^#0 +breakpt *\\(\\) \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in func5\[^\
 
 clean_restart ${::testfile}
 
-if ![runto breakpt] {
+if {![runto breakpt]} {
     return -1
 }
 
@@ -61,7 +61,7 @@ gdb_test "interpreter-exec mi \"-stack-info-depth\"" \
 
 clean_restart ${::testfile}
 
-if ![runto breakpt] {
+if {![runto breakpt]} {
     return -1
 }
 
index b715ecf410a5ec964f1fdb4e35da1ea8e28fb1ae..7f1b80609361f58357bec1c2e72ea6b37818e373 100644 (file)
@@ -36,7 +36,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
     return -1
 }
 
-if ![runto breakpt] {
+if {![runto breakpt]} {
     return -1
 }
 
@@ -51,7 +51,7 @@ gdb_test "bt no-filters" "^#0 +$hex in func2 \\(\\)\r\nBacktrace stopped: Cannot
 
 clean_restart ${::testfile}
 
-if ![runto breakpt] {
+if {![runto breakpt]} {
     return -1
 }
 
@@ -65,7 +65,7 @@ gdb_test "interpreter-exec mi \"-stack-info-depth\"" \
 
 clean_restart ${::testfile}
 
-if ![runto breakpt] {
+if {![runto breakpt]} {
     return -1
 }
 
index 1b85e4e950b08b9757df3c6f6f23b272a2c84c09..38ce3ace20343e441b994e6359f863ae3f63c570 100644 (file)
@@ -16,7 +16,7 @@
 standard_testfile .S .c
 set opts {}
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.arch/amd64-optimout-repeat.exp COMPILE=1"
     set srcfile ${srcfile2}
     lappend opts debug optimize=-O2
@@ -28,7 +28,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 844797393c93dd69c5c6c766db7421d03cf45382..3a688ab6bfef19e37f20c8d1add3050763dc00e2 100644 (file)
@@ -20,7 +20,7 @@ set csrcfile [file rootname $srcfile].c
 set csrcfile ${testfile}.c
 set opts {}
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS='gdb.arch/amd64-prologue-xmm.exp COMPILE=1'
     set srcfile ${csrcfile}
     lappend opts debug optimize=-O0
@@ -32,7 +32,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} $srcfile $opts]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 039f528ad27acb78e7bc9de52086925cc2d5d005..82d68da6764acb2ff28ef87b9600f41eb82f20cd 100644 (file)
@@ -26,13 +26,13 @@ proc check_core_file {core_filename saved_pl3_ssp} {
     global decimal
 
     # Load the core file.
-    if [gdb_test "core $core_filename" \
-           [multi_line \
-                "Core was generated by .*\\." \
-                "Program terminated with signal SIGSEGV, Segmentation fault.*" \
-                "#0  function \\(\\) at .*amd64-shadow-stack-corefile.c:$decimal" \
-                "$decimal.*__asm__ volatile \\(\"ret\\\\n\"\\);"] \
-           "load core file"] {
+    if {[gdb_test "core $core_filename" \
+            [multi_line \
+                 "Core was generated by .*\\." \
+                 "Program terminated with signal SIGSEGV, Segmentation fault.*" \
+                 "#0  function \\(\\) at .*amd64-shadow-stack-corefile.c:$decimal" \
+                 "$decimal.*__asm__ volatile \\(\"ret\\\\n\"\\);"] \
+            "load core file"]} {
        return
     }
 
@@ -52,7 +52,7 @@ save_vars { ::env(GLIBC_TUNABLES) } {
 
     set linespec ${srcfile}:[gdb_get_line_number "Break here"]
 
-    if ![runto $linespec] {
+    if {![runto $linespec]} {
        return
     }
 
@@ -78,14 +78,14 @@ save_vars { ::env(GLIBC_TUNABLES) } {
        }
     }
 
-    if ![gcore_cmd_available] {
+    if {![gcore_cmd_available]} {
        unsupported "target does not support gcore command."
        return
     }
 
     clean_restart $::testfile
 
-    if ![runto $linespec] {
+    if {![runto $linespec]} {
        return
     }
 
index 7e1df4332461f2d19a615afa2af34524515e0471..5fbdf8b918842c965e3a0e2a3e7465fd59c50023 100644 (file)
@@ -16,7 +16,7 @@
 set opts {}
 standard_testfile amd64-tailcall-cxx1.S amd64-tailcall-cxx2.S
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.arch/amd64-tailcall-cxx.exp COMPILE=1"
     standard_testfile amd64-tailcall-cxx1.cc amd64-tailcall-cxx2.cc
     lappend opts debug
@@ -30,7 +30,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} "${srcfile} ${srcfile2
     return -1
 }
 
-if ![runto g] {
+if {![runto g]} {
     return -1
 }
 
index fe65c4d117c25525702e55ca24d021bc7914297f..12abf58140e967d322b39dc0cb771ed71964656e 100644 (file)
@@ -16,7 +16,7 @@
 set opts {}
 standard_testfile .S
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.arch/amd64-tailcall-noret.exp COMPILE=1"
     standard_testfile
     lappend opts debug optimize=-O2
@@ -30,7 +30,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
     return -1
 }
 
-if ![runto noret] {
+if {![runto noret]} {
     return -1
 }
 
index 51baf7b6dc67b2c66cb826acf82db7767ea63786..e96b85b23542753614becf5755f13f5272abe51a 100644 (file)
@@ -16,7 +16,7 @@
 set opts {}
 standard_testfile .S .c
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.arch/amd64-tailcall-ret.exp COMPILE=1"
     standard_testfile .c .c
     lappend opts debug optimize=-O2
@@ -25,7 +25,7 @@ if [info exists COMPILE] {
 }
 
 # Make .c available on the host.
-if [is_remote host] {
+if {[is_remote host]} {
     gdb_remote_download host $srcdir/$subdir/$srcfile2
 }
 
@@ -33,7 +33,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index de3c606a4db6b39b5ce1ed036e6be37a64f8a62d..e5f47eb71ee4e67a8739ddb81086e36ba02336d1 100644 (file)
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {}] } {
     return -1
 }
 
-if ![runto b] {
+if {![runto b]} {
     return -1
 }
 
index 1b084f977bae3a0b73f8da1df58793646d671101..dc1149cc3df1c141e9043f1ab3756daaa2f0f4fc 100644 (file)
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile $options] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
@@ -85,7 +85,7 @@ proc prologue_test {funcname {savedregs ""} {fp_offset ""} } {
     }
     if { $fp_offset != "" } {
        set sp [get_integer_valueof \$sp -1 "get value of sp in $funcname"]
-       set fp_val [expr $sp + $fp_offset]
+       set fp_val [expr {$sp + $fp_offset}]
        set fp_real_val \
            [get_integer_valueof \$fp 0 "get value of fp in $funcname"]
        if { $fp_real_val != $fp_val } {
index 056321097e85481ebd811bb38dd1d03c66147580..7f76aa2ea50d9c66da51407c5d9200b6e9017f14 100644 (file)
@@ -37,7 +37,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
index 5e7f3c2590a22cb2452c7618bb9a16b3c6806cb1..01b23ebec1252ede2b273eb1f7d77bff9cb19f65 100644 (file)
@@ -39,7 +39,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
@@ -53,7 +53,7 @@ proc test_branch_insn { test_name } {
 
     # Calculate instruction length, based on ${test_name}_end symbol.
     set end_pc [get_hexadecimal_valueof &${test_name}_end -1]
-    set length [expr $end_pc - $pc]
+    set length [expr {$end_pc - $pc}]
 
     set target_address [get_hexadecimal_valueof &${test_name}_target -1]
 
index f3aca94dc5af73498c2b9d0e3e0a05dd73b9644e..d01f81786184567d3f545a4db665a922cbe5bd0a 100644 (file)
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile ]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
    return -1
 }
 
index b38a6858d69a79bab67470379a2f07af173a4b79..b29b9ca23e70271195ae71b84ea455ffb0d01ced 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug quie
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index cafae606c81c330c7b5616d5465e9fbf559fc612..ea5854323852bb5bba6657e22dd14fe3aaff7a8a 100644 (file)
@@ -31,7 +31,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
   return -1
 }
 
-if ![runto [gdb_get_line_number "break here."]] {
+if {![runto [gdb_get_line_number "break here."]]} {
   untested "could not run to \"break here.\""
   return -1
 }
index a7cd5f362fa557271a80adfa111c61bda33e87b9..6a08f70bac50d284f128ad189238f2576942fa89 100644 (file)
@@ -21,12 +21,12 @@ require support_displaced_stepping
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
 
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
-       [list debug $additional_flags]] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+        [list debug $additional_flags]]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index b1eb8654cf83745c642dd8b10ca9c275ca6f6081..b468e71fadfdaacaec7ab2f6082043baece832d1 100644 (file)
@@ -37,7 +37,7 @@ proc insert_breakpoint {function expected_location} {
     global gdb_prompt
     global expect_out
     global hex
-    
+
     set address ""
 
     # Insert a breakpoint using the given function name, and extract
index 6d69cccc9c71b2183a4f95942a9d036809aa4bd6..fa10b4f6a1d004cdf5362ade309d263d3cf5de06 100644 (file)
@@ -1,5 +1,5 @@
 # Copyright 2003-2025 Free Software Foundation, Inc.
-# 
+#
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
@@ -155,11 +155,11 @@ gdb_test "continue" \
   "Breakpoint 2, vector_fun .a=.-2, -2., b=.1, 1.*e500-regs.c.*ev_create_s32 .2, 2.;" \
   "continue to vector_fun"
 
-# Do a next over the assignment to vector 'a'. 
+# Do a next over the assignment to vector 'a'.
 gdb_test "next" ".*b = \\(vector int\\) __ev_create_s32 \\(3, 3\\);" \
   "next (1)"
 
-# Do a next over the assignment to vector 'b'. 
+# Do a next over the assignment to vector 'b'.
 gdb_test "next" "c = __ev_and \\(a, b\\);" \
   "next (2)"
 
index 80df6b99ca67163563db430440a3e5d5d4b763c7..d8b94f2db371ae66bcbb1a2e6a845361873b76f3 100644 (file)
@@ -19,16 +19,16 @@ standard_testfile insn-reloc.c
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
 
-if [prepare_for_testing "failed to prepare" $testfile-no-ipa $srcfile \
-       [list debug $additional_flags]] {
+if {[prepare_for_testing "failed to prepare" $testfile-no-ipa $srcfile \
+        [list debug $additional_flags]]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "target does not support trace"
     return -1
 }
@@ -48,7 +48,7 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 clean_restart $testfile
 set remote_libipa [gdb_load_shlib $libipa]
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
index ba41a8c2071b4fb4a62fde8473e4cdd50106cde8..3a1d8e8607b0cba8ae15f6bf8a2b7dd01d1a60a1 100644 (file)
@@ -53,7 +53,7 @@ gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
          "set first breakpoint in main"
 gdb_continue_to_breakpoint "continue to first breakpoint in main"
 
-if [is_amd64_regs_target] {
+if {[is_amd64_regs_target]} {
     set nr_regs 16
 } else {
     set nr_regs 8
@@ -79,7 +79,7 @@ gdb_continue_to_breakpoint "continue to second breakpoint in main"
 
 for { set r 0 } { $r < $nr_regs } { incr r } {
     gdb_test "print data\[$r\]" \
-        ".. = \\{f = \\{[expr $r + 10], $r.125, $r.25, $r.375, $r.5, $r.625, $r.75, $r.875\\}\\}.*" \
+        ".. = \\{f = \\{[expr {$r + 10}], $r.125, $r.25, $r.375, $r.5, $r.625, $r.75, $r.875\\}\\}.*" \
         "check contents of data\[$r\]"
 }
 
index dcd6cc9a522e99fe4a089afc4e3b2e1392adb4f1..675a3c79801e89fb16b6a192239981cccaf34580 100644 (file)
@@ -31,7 +31,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -78,7 +78,7 @@ gdb_continue_to_breakpoint "continue to second breakpoint in main"
 set nr_regs 7
 
 for { set r 0 } { $r < $nr_regs } { incr r } {
-    set val [expr $r + 1]
+    set val [expr {$r + 1}]
     gdb_test "print/x k_data\[$r\]" \
         ".. = 0x$val$val$val$val" \
         "check contents of k_data\[$r\]"
@@ -89,7 +89,7 @@ gdb_test "break [gdb_get_line_number "third breakpoint here"]" \
     "set third breakpoint in main"
 gdb_continue_to_breakpoint "continue to third breakpoint in main"
 
-if [is_amd64_regs_target] {
+if {[is_amd64_regs_target]} {
     set nr_regs 32
 } else {
     set nr_regs 8
@@ -134,7 +134,7 @@ gdb_continue_to_breakpoint "continue to fourth breakpoint in main"
 
 for { set r 0 } { $r < $nr_regs } { incr r } {
     gdb_test "print zmm_data\[$r\]" \
-        ".. = \\{f = \\{[expr $r + 10], [expr $r.125 + 10], [expr $r.25 + 10], [expr $r.375 + 10], [expr $r.5 + 10], [expr $r.625 + 10], [expr $r.75 + 10], [expr $r.875 + 10]\\}\\}.*" \
+        ".. = \\{f = \\{[expr {$r + 10}], [expr {$r + 10.125}], [expr {$r + 10.25}], [expr {$r + 10.375}], [expr {$r + 10.5}], [expr {$r + 10.625}], [expr {$r +10.75}], [expr {$r + 10.875}]\\}\\}.*" \
         "check contents of zmm_data\[$r\] after writing ZMM regs"
 }
 
@@ -152,7 +152,7 @@ gdb_continue_to_breakpoint "continue to fifth breakpoint in main"
 
 for { set r 0 } { $r < $nr_regs } { incr r } {
     gdb_test "print zmm_data\[$r\]" \
-        ".. = \\{f = \\{[expr $r + 20], [expr $r.125 + 20], [expr $r.25 + 20], [expr $r.375 + 20], [expr $r.5 + 10], [expr $r.625 + 10], [expr $r.75 + 10], [expr $r.875 + 10]\\}\\}.*" \
+        ".. = \\{f = \\{[expr {$r + 20}], [expr {$r + 20.125}], [expr {$r + 20.25}], [expr {$r + 20.375}], [expr {$r + 10.5}], [expr {$r + 10.625}], [expr {$r + 10.75}], [expr {$r + 10.875}]\\}\\}.*" \
         "check contents of zmm_data\[$r\] after writing YMM regs"
 }
 
@@ -168,7 +168,7 @@ gdb_continue_to_breakpoint "continue to sixth breakpoint in main"
 
 for { set r 0 } { $r < $nr_regs } { incr r } {
     gdb_test "print zmm_data\[$r\]" \
-        ".. = \\{f = \\{[expr $r + 30], [expr $r.125 + 30], [expr $r.25 + 20], [expr $r.375 + 20], [expr $r.5 + 10], [expr $r.625 + 10], [expr $r.75 + 10], [expr $r.875 + 10]\\}\\}.*" \
+        ".. = \\{f = \\{[expr {$r + 30}], [expr {$r + 30.125}], [expr {$r + 20.25}], [expr {$r + 20.375}], [expr {$r + 10.5}], [expr {$r + 10.625}], [expr {$r + 10.75}], [expr {$r + 10.875}]\\}\\}.*" \
         "check contents of zmm_data\[$r\] after writing XMM regs"
 }
 
index 6e839391709bbb97d3c1bd74a565fbfec50beb32..c04b87db58a1a2f5c78178c76718c3d99524443f 100644 (file)
@@ -54,7 +54,7 @@ set corefile [gdb_remote_download host $corefile]
 # First check if this particular GDB supports i386, otherwise we should not
 # expect the i386 core file to be loaded successfully.
 set archs [get_set_option_choices "set architecture" "i386"]
-set supports_arch_i386 [expr [lsearch -exact $archs i386] != -1]
+set supports_arch_i386 [expr {[lsearch -exact $archs i386] != -1}]
 
 # Wrongly built GDB complains by:
 # "..." is not a core dump: File format not recognized
index 1eff9774ae421b883e0eff9ead1118ae350156bc..12b57f38754f15acd2271293695bf06e476e6176 100644 (file)
@@ -51,7 +51,7 @@ with_test_prefix "at first bp" {
        gdb_test "print/x \$$byte_regs($r)" \
            ".. = 0x[format %x $r]1" \
            "check contents of %$byte_regs($r)"
-       set h [expr $r + 4]
+       set h [expr {$r + 4}]
        gdb_test "print/x \$$byte_regs($h)" \
            ".. = 0x[format %x $r]2" \
            "check contents of %$byte_regs($h)"
@@ -59,7 +59,7 @@ with_test_prefix "at first bp" {
 
     for { set r 1 } { $r <= 4  } { incr r } {
        gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
-       set h [expr $r + 4]
+       set h [expr {$r + 4}]
        gdb_test "set var \$$byte_regs($h) = $h" "" "set %$byte_regs($h)"
     }
 }
@@ -72,7 +72,7 @@ with_test_prefix "at second bp" {
        gdb_test "print \$$byte_regs($r)" \
            ".. = $r" \
            "check contents of %$byte_regs($r)"
-       set h [expr $r + 4]
+       set h [expr {$r + 4}]
        gdb_test "print \$$byte_regs($h)" \
            ".. = $h" \
            "check contents of %$byte_regs($h)"
index 7291f02b7961e869c6994966c4521a28f41827dd..661265b2815b65191f1e5c6df0619311b4eabeb0 100644 (file)
@@ -21,11 +21,11 @@ require is_x86_like_target
 set testfile "i386-cfi-notcurrent"
 set srcfile ${testfile}.S
 
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {nodebug}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {nodebug}]} {
     return -1
 }
 
-if ![runto f] {
+if {![runto f]} {
     return -1
 }
 
index 3e8ae1cbfce600bdd1cd4aa35d361b9a3642633b..1d4c87ec272c27362c92c354936881651a7fabed 100644 (file)
@@ -59,7 +59,7 @@ gdb_test_multiple "x/2i \$pc" "get address of next insn" {
 }
 
 # Clear the slot on the stack and confirm it was set to zero.
-set sp [expr $sp - 0x4]
+set sp [expr {$sp - 0x4}]
 gdb_test_no_output "set {unsigned int} $sp = 0" \
     "clear stack slot"
 set zero_val 0x[format %08x 0]
@@ -73,7 +73,7 @@ gdb_test "stepi" \
 # Check stack pointer was updated to the expected value.
 set new_sp [get_hexadecimal_valueof "\$sp" "*UNKNOWN*" \
               "get stack pointer after step"]
-gdb_assert {[expr $sp == $new_sp]} \
+gdb_assert {[expr {$sp == $new_sp}]} \
     "check stack pointer was updated as expected"
 
 # Check the contents of the stack were updated to the expected value.
index 11b477378d4e1a611c84a9c48a470fb451d742ed..16d28720c450c53265e34629e610b009ddd4cc77 100644 (file)
@@ -23,7 +23,7 @@ require {is_any_target "i?86-*-*" "x86_64-*-*"}
 
 standard_testfile
 
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug $additional_flags}] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug $additional_flags}]} {
     return -1
 }
 
index 7262b8bd248e0d70f1be24ee1a2479ce922fb8a3..6355c43e528f65ec0fbc71afbfdee8bcac023aa4 100644 (file)
@@ -34,7 +34,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -63,8 +63,8 @@ set v [linux_kernel_version]
 if { $v != {} } {
     set have_xfail \
        [expr \
-            [version_compare [list 5 14 0] <= $v] \
-            && [version_compare $v < [list 6 2 0]]]
+            {[version_compare [list 5 14 0] <= $v] \
+                 && [version_compare $v < [list 6 2 0]]}]
 }
 
 # Test pkru register at startup
index b289b8482774cabe411356402c83fe3547f8a7b7..ac2be79c981a4dece02001a16056a7942ace6f13 100644 (file)
@@ -38,7 +38,7 @@ proc test_run {} {
            set bp_addr $expect_out(1,string)
 
            # Convert to decimal.
-           set bp_addr [expr $bp_addr]
+           set bp_addr [expr {$bp_addr}]
 
            pass $gdb_test_name
        }
index af0b56dc1b3431ed05bdf7b09446418cf5b3d018..6b9260b71809035d790462ff584541c9d3f0a753 100644 (file)
@@ -22,7 +22,7 @@ set executable ${testfile}
 set binfile [standard_output_file ${executable}]
 set opts {}
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     set srcfile ${csrcfile}
     lappend opts debug optimize=-O2 additional_flags=-msse
 }
@@ -53,5 +53,5 @@ foreach i {0 1 2 3 4} {
     if {$args != ""} {
        set args "$args, "
     }
-    set args "$args[expr $i + 1]"
+    set args "$args[expr {$i + 1}]"
 }
index 154f5ea53cdac4f23df6c4e38563029e7693453e..ee22b62de61ce4b64ceb63783da41eb2cf89d3af 100644 (file)
@@ -68,7 +68,7 @@ gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
          "set first breakpoint in main"
 gdb_continue_to_breakpoint "continue to first breakpoint in main"
 
-if [is_amd64_regs_target] {
+if {[is_amd64_regs_target]} {
     set nr_regs 16
 } else {
     set nr_regs 8
@@ -94,6 +94,6 @@ gdb_continue_to_breakpoint "continue to second breakpoint in main"
 
 for { set r 0 } { $r < $nr_regs } { incr r } {
     gdb_test "print data\[$r\]" \
-        ".. = \\{f = \\{[expr $r + 10], $r.25, $r.5, $r.75\\}\\}.*" \
+        ".. = \\{f = \\{[expr {$r + 10}], $r.25, $r.5, $r.75\\}\\}.*" \
         "check contents of data\[$r\]"
 }
index d6fd14cfbddbcf0a9442f08a258f55e74d481d94..ed617fc13840dfc7a680559657b2b3d51baafd31 100644 (file)
@@ -27,7 +27,7 @@ clean_restart
 gdb_load $binfile
 
 # We need to start the inferior to place the breakpoints in the memory at all.
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -54,7 +54,7 @@ gdb_test_multiple "b bundle" $test {
     }
 }
 
-if ![info exists bpt2address] {
+if {![info exists bpt2address]} {
     return -1
 }
 
@@ -65,7 +65,7 @@ set test "disassembly with breakpoints"
 gdb_test_multiple "disass main" $test {
     -re $match {
        set got $expect_out(1,string)
-       if [string equal -nocase $orig $got] {
+       if {[string equal -nocase $orig $got]} {
            pass $test
        } else {
            fail $test
index b47c37171bdbe043fca7ac4e4553e033b0f5cc25..6fe332a6c854cc2773ea35328f043f28b0139cbb 100644 (file)
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     return
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index f43127d3c8d5ad5bfd55cf65ec1400f139ad671d..1921578b29f69b7b09c2db46026b882fe48ad73e 100644 (file)
@@ -4,16 +4,16 @@
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
 
-# Test single-step on bbit.  
+# Test single-step on bbit.
 
 require {istarget "*octeon*"}
 
@@ -48,7 +48,7 @@ proc single_step_until { match } {
     set insn [current_insn]
     set start [timestamp]
     while { $insn != "" && [timestamp] - $start < 3*$timeout } {
-       if [regexp $match $insn] {
+       if {[regexp $match $insn]} {
            return 1
        }
        if {![single_step]} {
@@ -66,7 +66,7 @@ proc test_bbit { name taken } {
     }
     pass "$name single-step until bbit"
     gdb_test "si" "" "$name single-step on bbit"
-    if [regexp "li\\s+\[sv\]0,$taken" [current_insn]] {
+    if {[regexp "li\\s+\[sv\]0,$taken" [current_insn]]} {
        pass "$name check insn after bbit"
     } else {
        send_log "expected: li\\s+\[sv\]0,$taken found [current_insn]\n"
index ad246ca69eaec4025c185451ed50eb4b8d83ca4b..cb8eeeb72789b971f146cd23356ce69a281bb138 100644 (file)
@@ -43,7 +43,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] !
 clean_restart
 gdb_load $binfile
 
-# In the first test, we do a "step" on a function whose last instruction 
+# In the first test, we do a "step" on a function whose last instruction
 # contains a branch-with-nullify.  The instruction in the delay slot belongs
 # to the next function.  We verify that when we step off the first function
 # that we end up back at the caller and not at the second instruction.
@@ -65,9 +65,9 @@ gdb_test_multiple "stepi" "${test}" {
   }
 }
 
-# In the second test, we verify that we can get a proper backtrace 
+# In the second test, we verify that we can get a proper backtrace
 # even when we are in a nullified instruction that belongs to the next function.
-# We also verify that when stepping over a branch-with-nullify insn that we 
+# We also verify that when stepping over a branch-with-nullify insn that we
 # stay on the same insn for two steps.
 
 proc get_addr_of_sym { sym } {
@@ -127,7 +127,7 @@ if {![runto_main]} {
 }
 gdb_breakpoint "*$foo_last"
 gdb_test "continue" "Breakpoint \[0-9\]*,.* in foo.*" "$test: continue to breakpoint"
-if [gen_core $test] {
+if {[gen_core $test]} {
   test_core_bt $test
 }
 
@@ -138,6 +138,6 @@ if {![runto_main]} {
 gdb_breakpoint "*$foo_last"
 gdb_test "continue" "Breakpoint \[0-9\]*,.* in foo.*" "$test: continue to breakpoint"
 gdb_test "stepi" ".*in foo.*" "$test: step to nullified instruction"
-if [gen_core $test] {
+if {[gen_core $test]} {
   test_core_bt $test
 }
index 5a6d38e91d593a346a3bf91b964958e75bbe8f2a..9d88c788908304ab543079924f5d5a3f8708fe3c 100644 (file)
@@ -86,25 +86,25 @@ set check_r9 [get_hexadecimal_valueof "\$r9" "default0"]
 #      addpcis 8,+0x10         # /* set r8 */
 #      addpcis 9,+0x100        # /* set r9 */
 
-if [expr $check_r3 + 0x1000000   != $check_r6 - 0xc ] {
+if {$check_r3 + 0x1000000 != $check_r6 - 0xc} {
     fail "unexpected value r3 + 0x1,000,000 != r6 + 0xc ; r3: $check_r3  r6: $check_r6 "
 }
-if [expr $check_r4 + 0x100000  != $check_r6 - 0x8 ] {
+if {$check_r4 + 0x100000 != $check_r6 - 0x8} {
     fail "unexpected value r4 + 0x100,000 != r6 - 0x8 ; r4: $check_r4  r6: $check_r6 "
 }
-if [expr $check_r5 + 0x10000  != $check_r6 - 0x4 ] {
+if {$check_r5 + 0x10000 != $check_r6 - 0x4} {
     fail "unexpected value r5 + 0x10,000 != r6 , r5: $check_r5  r6: $check_r6 "
 }
-if [expr $check_r6 != $check_r6] {
+if {$check_r6 != $check_r6} {
     fail "unexpected value r6 != r6 , r6: $check_r6  r6: $check_r6 "
 }
-if [expr $check_r7 - 0x10000  != $check_r6 + 0x4] {
+if {$check_r7 - 0x10000  != $check_r6 + 0x4} {
     fail "unexpected value r7 - 0x10,000 != r6 + 0x4 , r7: $check_r7  r7: $check_r6 "
 }
-if [expr $check_r8 - 0x100000  != $check_r6 + 0x8 ] {
+if {$check_r8 - 0x100000  != $check_r6 + 0x8} {
     fail "unexpected value r8 - 0x100,000 != r6 , r8: $check_r8  r8: $check_r6 "
 }
-if [expr $check_r9 - 0x1000000  != $check_r6 + 0xc ] {
+if {$check_r9 - 0x1000000  != $check_r6 + 0xc} {
     fail "unexpected value r9 - 0x1,000,000 != r6 + 0xc , r9: $check_r9  r6: $check_r6 "
 }
 
index f95bddf792b1389ee3972f59eac0fa77ffa308f0..4e6ee78b9fb4a4043e429fa1b70131b000f75692 100644 (file)
@@ -38,7 +38,7 @@ proc insert_breakpoint {function expected_location} {
     global gdb_prompt
     global expect_out
     global hex
-    
+
     set address ""
 
     # Insert a breakpoint using the given function name, and extract
index bc8ff7a4f19f7f984c170c535418c56e1dfc2352..0084ffed898e3c75e8b9cfb2f745e24672bca1dc 100644 (file)
@@ -53,7 +53,7 @@ proc func_check {instr} {
 
     set test "found: '$instr'"
     set peb [instr_to_patt $instr]
-    if [regexp -nocase -line [instr_to_patt $instr] $func] {
+    if {[regexp -nocase -line [instr_to_patt $instr] $func]} {
        pass $test
     } else {
        fail $peb
index 6fddd34edab78eba53d1bcf793138456766b9e67..cd2240ad090ef2d27cde2a1fb968a4cbf0df2605 100644 (file)
@@ -52,7 +52,7 @@ proc func_check {instr} {
     global func
 
     set test "found: $instr"
-    if [regexp -nocase -line [instr_to_patt $instr] $func] {
+    if {[regexp -nocase -line [instr_to_patt $instr] $func]} {
        pass $test
     } else {
        fail $test
index 7b1d0c3d3a96e80d0dff58eadc22fded1afa36e5..c7d1a2b9f1b35c5e9fa26bcbeaf5c1f7e2bae142 100644 (file)
@@ -52,7 +52,7 @@ proc func_check {instr} {
     global func
 
     set test "found: $instr"
-    if [regexp -nocase -line [instr_to_patt $instr] $func] {
+    if {[regexp -nocase -line [instr_to_patt $instr] $func]} {
        pass $test
     } else {
        fail $test
index cb5a37105b9b3b4c86a5f32f5c713b23f8a75f50..904c75881f1ed167232710a6b5489ded91a9eda8 100644 (file)
@@ -35,7 +35,7 @@ if {![runto_main]} {
    return
 }
 
-if [gdb_test "show arch" ".*powerpc:common.*" "checking for PPC arch"] {
+if {[gdb_test "show arch" ".*powerpc:common.*" "checking for PPC arch"]} {
     return -1
 }
 
@@ -50,12 +50,12 @@ gdb_test "info reg dl$i" \
         "dl$i\[ \]*1\.2345678910\[ \t\]*\\(raw 0x2205800000000000000000049c5de09c\\)" \
         "print dl$i register with the info reg command"
 
-gdb_test "info reg f[expr 2*$i]" \
-        "f[expr 2*$i]\[ \]*8\.608957309287334e\-145\[ \t\]*\\(raw 0x2205800000000000\\)" \
+gdb_test "info reg f[expr {2*$i}]" \
+        "f[expr {2*$i}]\[ \]*8\.608957309287334e\-145\[ \t\]*\\(raw 0x2205800000000000\\)" \
         "testing lower half of dl$i register"
 
-gdb_test "info reg f[expr 2*$i+1]" \
-        "f[expr 2*$i+1]\[ \]*9\.7841140127686122e\-314\[ \t\]*\\(raw 0x000000049c5de09c\\)" \
+gdb_test "info reg f[expr {2*$i+1}]" \
+        "f[expr {2*$i+1}]\[ \]*9\.7841140127686122e\-314\[ \t\]*\\(raw 0x000000049c5de09c\\)" \
         "testing upper half of dl$i register"
 
 }
index 5e2923fbd00a5ba377c6a4704250587f8dd82fb8..456833e662aa82029d4e4fa4ea1faa20e8f268b3 100644 (file)
@@ -159,7 +159,7 @@ gdb_test_no_output "set \$xer = 0xc0000000"
 # FPRs
 gdb_test_no_output "set \$f0 = 0.5"
 for {set i 1} {$i < 32} {incr i 1} {
-    gdb_test_no_output "set \$f$i = \$f[expr $i - 1] + 1.0"
+    gdb_test_no_output "set \$f$i = \$f[expr {$i - 1}] + 1.0"
 }
 
 gdb_test_no_output "set \$fpscr = 0x84005000"
@@ -213,7 +213,7 @@ proc test_register_match {reg_name reg_var_name hex} {
     # In some infrequent cases CXER doesn't match the
     # pre-transactional XER, possibly due to a linux kernel bug.
     set should_xfail 0
-    if [istarget "powerpc*-*-linux*" && reg_name == "cxer"] {
+    if {[istarget "powerpc*-*-linux*" && reg_name == "cxer"]} {
        set should_xfail 1
     }
 
@@ -268,7 +268,7 @@ test_register_match "ctar" "tar" 1
 
 # Support for writing to the checkpointed registers is not
 # currently available in the gdbserver stub.
-if [target_is_gdbserver] {
+if {[target_is_gdbserver]} {
     unsupported "write to checkpointed registers"
     return
 }
@@ -282,7 +282,7 @@ for {set i 0} {$i < 32} {incr i 1} {
 
 gdb_test_no_output "set \$cf0 = 0.25"
 for {set i 1} {$i < 32} {incr i 1} {
-    gdb_test_no_output "set \$cf$i = \$cf[expr $i - 1] + 1.0"
+    gdb_test_no_output "set \$cf$i = \$cf[expr {$i - 1}] + 1.0"
 }
 
 for {set i 0} {$i < 32} {incr i 1} {
index 357ec7a569017bd6c96960fc83246dfcc13119cc..c317465c9ea72dd67203bc63ac0df2ecb0743a89 100644 (file)
@@ -82,22 +82,22 @@ set check_r9 [get_hexadecimal_valueof "\$r9" "default0"]
 # Specifically that the values loaded by the lnia instruction
 # reflect the value of the PC as if the instruction was
 # not displaced.
-if [expr $check_r3 + 4 != $check_r4] {
+if {$check_r3 + 4 != $check_r4} {
     fail "unexpected value r3+4 != r4 , r3: $check_r3  r4: $check_r4 "
 }
-if [expr $check_r4 + 4 != $check_r5] {
+if {$check_r4 + 4 != $check_r5} {
     fail "unexpected value r4+4 != r5 , r4: $check_r4  r5: $check_r5 "
 }
-if [expr $check_r5 + 4 != $check_r6] {
+if {$check_r5 + 4 != $check_r6} {
     fail "unexpected value r5+4 != r6 , r5: $check_r5  r6: $check_r6 "
 }
-if [expr $check_r6 + 4 != $check_r7] {
+if {$check_r6 + 4 != $check_r7} {
     fail "unexpected value r6+4 != r7 , r6: $check_r6  r7: $check_r7 "
 }
-if [expr $check_r7 + 4 != $check_r8] {
+if {$check_r7 + 4 != $check_r8} {
     fail "unexpected value r7+4 != r8 , r7: $check_r7  r8: $check_r8 "
 }
-if [expr $check_r8 + 4 != $check_r9] {
+if {$check_r8 + 4 != $check_r9} {
     fail "unexpected value r8+4 != r9 , r8: $check_r8  r9: $check_r9 "
 }
 
index f4a3fdb7e37e34beea8365d1c8359c318232212a..ef6e1ff39476071185f5cb6b05a9074990d3a720 100644 (file)
@@ -109,16 +109,16 @@ set vs5_expected 0xa7b7c7d7a6b6c6d6a5b5c5d5a4b4c4d4
 set vs6_expected 0xa9b9c9d9a8b8c8d8a7b7c7d7a6b6c6d6
 set vs7_expected 0xabbbcbdbaabacadaa9b9c9d9a8b8c8d8
 
-if [expr  $check_vs4 != $vs4_expected] {
+if {$check_vs4 != $vs4_expected} {
     fail "unexpected value vs4;  actual:$check_vs4 expected:$vs4_expected"
 }
-if [expr $check_vs5 != $vs5_expected ] {
+if {$check_vs5 != $vs5_expected} {
     fail "unexpected value vs5;   actual:$check_vs5 expected:$vs5_expected"
 }
-if [expr $check_vs6 != $vs6_expected ] {
+if {$check_vs6 != $vs6_expected} {
     fail "unexpected value vs6;   actual:$check_vs6 expected:$vs6_expected"
 }
-if [expr $check_vs7 != $vs7_expected ] {
+if {$check_vs7 != $vs7_expected} {
     fail "unexpected value vs7;   actual:$check_vs7 expected:$vs7_expected"
 }
 
index 124baaf401113b3e3b8f8ad7b9fedaaeaacd3476..089ca737fd2f6988b3e26b85614d245b410b4ba3 100644 (file)
@@ -52,7 +52,7 @@ proc func_check {instr} {
     global func
 
     set test "found: $instr"
-    if [regexp -nocase -line [instr_to_patt $instr] $func] {
+    if {[regexp -nocase -line [instr_to_patt $instr] $func]} {
        pass $test
     } else {
        fail $test
index 8885a916daafb793f6ac48a67bfc0e62abf8bd4a..4d85fd9fe82730b29fa31e72241eac1f269ef883 100644 (file)
@@ -52,7 +52,7 @@ proc func_check {instr} {
     global func
 
     set test "found: $instr"
-    if [regexp -nocase -line [instr_to_patt $instr] $func] {
+    if {[regexp -nocase -line [instr_to_patt $instr] $func]} {
        pass $test
     } else {
        fail $test
index f740ae82d01e0fd21a647193f16fd8859dbcc610..f679253f9569d5f17cbd2cb7d111245e279ce951 100644 (file)
@@ -52,7 +52,7 @@ proc func_check {instr} {
     global func
 
     set test "found: $instr"
-    if [regexp -nocase -line [instr_to_patt $instr] $func] {
+    if {[regexp -nocase -line [instr_to_patt $instr] $func]} {
        pass $test
     } else {
        fail $test
index 8dcf536b5465ccf645424cfbc93f7f918d3d6476..784ba9bad7b6c5154d9ec9b38661f605698ee836 100644 (file)
@@ -52,7 +52,7 @@ proc func_check {instr} {
     global func
 
     set test "found: $instr"
-    if [regexp -nocase -line [instr_to_patt $instr] $func] {
+    if {[regexp -nocase -line [instr_to_patt $instr] $func]} {
        pass $test
     } else {
        fail $test
index 1b4c6082703c50c0a128625ed96a091b405f9ae8..1b70535474649e61d41b8011f4d6a787a6a5ea81 100644 (file)
@@ -68,7 +68,7 @@ proc ppr_dscr_available {} {
 with_test_prefix "check PPR/DSCR access" {
     clean_restart $::testfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -88,7 +88,7 @@ with_test_prefix "check PPR/DSCR access" {
 # Now do the actual test
 clean_restart $::testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index 156a70ef3822af90e363bfad75b63619a22c90a5..4682cb9453b5a707f26074bb055fa67db7a54671 100644 (file)
@@ -28,7 +28,7 @@ if {[gdb_compile \
 
 clean_restart $testfile
 
-if ![runto bar] {
+if {![runto bar]} {
   untested "could not run to bar"
   return -1
 }
index a060ec8d8a0ab7152d83a30d969a258fe50a8622..917d7595ec1ece8503912d6c1d3075b35beabba2 100644 (file)
@@ -70,7 +70,7 @@ proc tar_available {} {
 with_test_prefix "check TAR access" {
     clean_restart $::testfile
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return
     }
 
@@ -86,7 +86,7 @@ with_test_prefix "check TAR access" {
 # Now do the actual test
 clean_restart $::testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return
 }
 
index 73a0fdcfa9857e130712dec69d63f5d985e3c0d0..27f2bd08b20cb0c7a6b2398440ce92eabf8b4094 100644 (file)
@@ -52,7 +52,7 @@ proc func_check {instr} {
     global func
 
     set test "found: $instr"
-    if [regexp -nocase -line [instr_to_patt $instr] $func] {
+    if {[regexp -nocase -line [instr_to_patt $instr] $func]} {
        pass $test
     } else {
        fail $test
index dfee7a396b8ca9fb338883b75a989d16a4a39d54..ec09815d998516fd4aa1c8f66bf13d0bcbd48184 100644 (file)
@@ -52,7 +52,7 @@ proc func_check {instr} {
     global func
 
     set test "found: $instr"
-    if [regexp -nocase -line [instr_to_patt $instr] $func] {
+    if {[regexp -nocase -line [instr_to_patt $instr] $func]} {
        pass $test
     } else {
        fail $test
index fd725f98fd549042b1069b8ee27d1e4ff5f9fa6d..5aeed8e1ed3fe6306bce086900603ef95efd3306 100644 (file)
@@ -52,7 +52,7 @@ proc func_check {instr} {
     global func
 
     set test "found: $instr"
-    if [regexp -nocase -line [instr_to_patt $instr] $func] {
+    if {[regexp -nocase -line [instr_to_patt $instr] $func]} {
        pass $test
     } else {
        fail $test
index 20145ae6d679dec457eaa64377aa568c800600d7..3c3b0304ae1adfdc5be4fc7eef420d7121a9cdbd 100644 (file)
@@ -20,7 +20,7 @@ require {istarget "powerpc*"}
 
 standard_testfile
 
-if ![test_compiler_info gcc*] {
+if {![test_compiler_info gcc*]} {
     # We use GCC's extended asm syntax
     warning "unknown compiler"
     return -1
index c8342bbb0f08ae90ba873bb63eb2fa0e13ec2c1f..b8b3f004f0a5531a52e0dfcf4049e6da4f65548f 100644 (file)
@@ -20,7 +20,7 @@ require {istarget "powerpc*"}
 
 standard_testfile
 
-if ![test_compiler_info gcc*] {
+if {![test_compiler_info gcc*]} {
     # We use GCC's extended asm syntax
     warning "unknown compiler"
     return -1
index 17bbdb452a106373355e065b1593f2602fa4aed5..35b442f1cf9e7794fc3c204e581c0d5251c71e76 100644 (file)
@@ -26,7 +26,7 @@
 require {istarget "powerpc*"} is_lp64_target
 
 set flags { nodebug }
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     standard_testfile .c -main.c
     lappend flags optimize=-O2
     lappend flags additional_flags=-fno-stack-protector
index 62d4c4483a6f4095f3aaafb110310683a8656249..39aa7938314e629789f42c3ac0cec2a929064cfb 100644 (file)
@@ -31,7 +31,7 @@ if {![runto_main]} {
 # Figure out where the breakpoint will be placed taking account for
 # stack alignment, and allocation of the dummy code area.
 set bp_addr [get_valueof "/x" "\$sp" 0]
-set bp_addr [format 0x%x [expr ($bp_addr & ~0xf) - 0x20]]
+set bp_addr [format 0x%x [expr {($bp_addr & ~0xf) - 0x20}]]
 
 # Fill the region we know will be used as the scratch area with the
 # compressed nop instruction.  If GDB fails to overwrite this with an
index 4b3baae4f9c632efd8488895948a13c9329227fe..358544f3dbae75eee39cfcf100dfd88128366203 100644 (file)
@@ -32,7 +32,7 @@ if {![runto_main]} {
 # that can be written to the fcsr register.  The two arguments should
 # be the value of each of the two fields within the fcsr register.
 proc merge_fflags_and_frm { fflags_value frm_value } {
-    set fcsr_value 0x[format %x [expr $fflags_value | ($frm_value << 5)]]
+    set fcsr_value 0x[format %x [expr {$fflags_value | ($frm_value << 5)}]]
     return $fcsr_value
 }
 
@@ -48,11 +48,11 @@ proc check_fcsr { fflags_value frm_value frm_string } {
     set frm_str_re [string_to_regexp "$frm_string"]
     set frm_val_re [format %d ${frm_value}]
 
-    set nv [format %d [expr ($fflags_value >> 4) & 0x1]]
-    set dz [format %d [expr ($fflags_value >> 3) & 0x1]]
-    set of [format %d [expr ($fflags_value >> 2) & 0x1]]
-    set uf [format %d [expr ($fflags_value >> 1) & 0x1]]
-    set nx [format %d [expr ($fflags_value >> 0) & 0x1]]
+    set nv [format %d [expr {($fflags_value >> 4) & 0x1}]]
+    set dz [format %d [expr {($fflags_value >> 3) & 0x1}]]
+    set of [format %d [expr {($fflags_value >> 2) & 0x1}]]
+    set uf [format %d [expr {($fflags_value >> 1) & 0x1}]]
+    set nx [format %d [expr {($fflags_value >> 0) & 0x1}]]
 
     set fflags_pattern "NV:${nv} DZ:${dz} OF:${of} UF:${uf} NX:${nx}"
     set frm_pattern "FRM:${frm_val_re} \\\[${frm_str_re}\\\]"
index 3e47cac25d8d9b04acc7d636f0b711fd35e554b0..9ee959bf4b8e5639897bd82c1daf9525406094dd 100644 (file)
@@ -19,7 +19,7 @@ require {is_any_target s390-*-* s390x-*-*}
 
 standard_testfile .S
 
-if [isnative] {
+if {[isnative]} {
     # Create a temporary directory, to take a core dump there later.
     set coredir [standard_output_file ${testfile}.d]
     remote_exec build "rm -rf $coredir"
@@ -31,7 +31,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -71,7 +71,7 @@ gdb_test_multiple "x/i \$pc" "get PC after vector insn" {
     }
 }
 
-if [expr $before_pc + 6 != $after_pc] {
+if {$before_pc + 6 != $after_pc} {
     fail "stepping first vector insn"
 }
 
@@ -93,17 +93,17 @@ set a_low 2
 set b_high 3
 set b_low 5
 
-set a [expr ($a_high << 32) | $a_low]
-set b [expr ($b_high << 32) | $b_low]
+set a [expr {($a_high << 32) | $a_low}]
+set b [expr {($b_high << 32) | $b_low}]
 
 for {set j 0} {$j < 32} {incr j 1} {
-    set i [expr 17 * $j % 32]
+    set i [expr {17 * $j % 32}]
     gdb_test_no_output \
-       "set \$v$i.v2_int64\[0\] = [expr $a * ($i + 1)]" \
+       "set \$v$i.v2_int64\[0\] = [expr {$a * ($i + 1)}]" \
        "set v$i left"
-    set i [expr 19 * (31 - $j) % 32]
+    set i [expr {19 * (31 - $j) % 32}]
     gdb_test_no_output \
-       "set \$v$i.v2_int64\[1\] = [expr $b * (32 - $i)]" \
+       "set \$v$i.v2_int64\[1\] = [expr {$b * (32 - $i)}]" \
        "set v$i right"
 }
 
@@ -121,7 +121,7 @@ set vregs [capture_command_output "x/64xg &save_area" ""]
 
 set i 0
 foreach {- left right} [regexp -all -inline -line {^.*:\s+(\w+)\s+(\w+)} $vregs] {
-    if [expr $left != $a * ($i + 1) || $right != $b * (32 - $i)] {
+    if {$left != $a * ($i + 1) || $right != $b * (32 - $i)} {
        fail "verify \$v$i after set"
     }
     if { $i < 16 } {
@@ -157,10 +157,10 @@ foreach {- r i val} [regexp -all -inline -line \
     if { $r ne "v" } {
        fail "info registers vector: bad line $j"
     } elseif { $val ne [hex128 \
-                           [expr $a_high * ($i + 1) * $a_high ] \
-                           [expr $a_low * ($i + 1) * $a_low ] \
-                           [expr $b_high * (32 - $i) * $b_high * 32] \
-                           [expr $b_low * (32 - $i) * $b_low * 32] ] } {
+                           [expr {$a_high * ($i + 1) * $a_high }] \
+                           [expr {$a_low * ($i + 1) * $a_low }] \
+                           [expr {$b_high * (32 - $i) * $b_high * 32}] \
+                           [expr {$b_low * (32 - $i) * $b_low * 32}] ] } {
        fail "compare \$v$i"
     }
     incr j 1
index ec04dad0f38fcd4ae7493f432beaf9f4ebeba45b..26fd022ebbf347821cf225f79fcfc58ba7b7bf32 100644 (file)
@@ -48,7 +48,7 @@ proc do_test { f } {
     }
 
     set test {$bp_addr == $prologue_end_addr}
-    if { [expr $test] } {
+    if {$bp_addr == $prologue_end_addr} {
        pass $test
     } elseif { $bp_addr < $prologue_end_addr } {
        # We'll allow this.  For instance, amd64 has a prologue
index 4dfc51437142061199b56f3fc43412fef38f30fb..2a5c194dd6aa56c40e193d07956441f70d7e4415 100644 (file)
@@ -32,7 +32,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {additional_flag
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index 25c3ce6057d36811f3ee116b4ed7a8b8c7ab7ae8..40a8eab14565592ffa314cc09edf1c26cc2ea9ff 100644 (file)
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite.
 
-# Basic tests of examining/assigning ADI version tags, and reporting 
+# Basic tests of examining/assigning ADI version tags, and reporting
 # precise mismatch.
 
 require {istarget "sparc64*-*-linux*"}
index 13622ebfcd833c8450cfb85a19149135f61db190..e5699d732068243b65620cca815c895d8e619104 100644 (file)
@@ -21,7 +21,7 @@ set testfile "thumb-bx-pc"
 set srcfile ${testfile}.S
 set opts {}
 
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts]} {
     return -1
 }
 
index f4f695acfb239c4a0b2b9417179b356955857c29..88fe49b46120715ec47848fde23b333d0b0325a8 100644 (file)
@@ -21,7 +21,7 @@ set testfile "thumb-singlestep"
 set srcfile ${testfile}.S
 
 set additional_flags "additional_flags=-mthumb"
-if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} [list debug $additional_flags]] {
+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} [list debug $additional_flags]]} {
     return -1
 }
 
index df74ef35e55d8a175ba37f7332be45935f75cec6..a6ecbfdd67c1be4b48da2e7f272096c8ea59950e 100644 (file)
@@ -24,9 +24,9 @@ require {istarget "powerpc*"} allow_vsx_tests
 standard_testfile
 
 set compile_flags {debug nowarnings quiet}
-if [test_compiler_info gcc*] {
+if {[test_compiler_info gcc*]} {
     set compile_flags "$compile_flags additional_flags=-maltivec additional_flags=-mabi=altivec"
-} elseif [test_compiler_info xlc*] {
+} elseif {[test_compiler_info xlc*]} {
     set compile_flags "$compile_flags additional_flags=-qaltivec"
 } else {
     warning "unknown compiler"
index e40d52cd5b304771e47056751cb3afcf31b55296..76c38ff2a795b224223b2eb3892c580b84fdba56 100644 (file)
@@ -23,9 +23,9 @@ require {istarget "powerpc*"} allow_vsx_tests
 standard_testfile
 
 set compile_flags {debug nowarnings quiet}
-if [test_compiler_info gcc*] {
+if {[test_compiler_info gcc*]} {
     set compile_flags "$compile_flags additional_flags=-maltivec additional_flags=-mabi=altivec"
-} elseif [test_compiler_info xlc*] {
+} elseif {[test_compiler_info xlc*]} {
     set compile_flags "$compile_flags additional_flags=-qaltivec"
 } else {
     warning "unknown compiler"