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

Fix these.

45 files changed:
gdb/tclint.toml
gdb/testsuite/gdb.trace/actions-changed.exp
gdb/testsuite/gdb.trace/actions.exp
gdb/testsuite/gdb.trace/backtrace.exp
gdb/testsuite/gdb.trace/change-loc.exp
gdb/testsuite/gdb.trace/circ.exp
gdb/testsuite/gdb.trace/collection.exp
gdb/testsuite/gdb.trace/deltrace.exp
gdb/testsuite/gdb.trace/disconnected-tracing.exp
gdb/testsuite/gdb.trace/entry-values.exp
gdb/testsuite/gdb.trace/ftrace-lock.exp
gdb/testsuite/gdb.trace/ftrace.exp
gdb/testsuite/gdb.trace/infotrace.exp
gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp
gdb/testsuite/gdb.trace/mi-trace-unavailable.exp
gdb/testsuite/gdb.trace/mi-traceframe-changed.exp
gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
gdb/testsuite/gdb.trace/mi-tsv-changed.exp
gdb/testsuite/gdb.trace/no-attach-trace.exp
gdb/testsuite/gdb.trace/passc-dyn.exp
gdb/testsuite/gdb.trace/passcount.exp
gdb/testsuite/gdb.trace/pending.exp
gdb/testsuite/gdb.trace/pr16508.exp
gdb/testsuite/gdb.trace/qtro.exp
gdb/testsuite/gdb.trace/range-stepping.exp
gdb/testsuite/gdb.trace/read-memory.exp
gdb/testsuite/gdb.trace/report.exp
gdb/testsuite/gdb.trace/save-trace.exp
gdb/testsuite/gdb.trace/signal.exp
gdb/testsuite/gdb.trace/status-stop.exp
gdb/testsuite/gdb.trace/strace.exp
gdb/testsuite/gdb.trace/tfind.exp
gdb/testsuite/gdb.trace/trace-break.exp
gdb/testsuite/gdb.trace/trace-buffer-size.exp
gdb/testsuite/gdb.trace/trace-condition.exp
gdb/testsuite/gdb.trace/trace-enable-disable.exp
gdb/testsuite/gdb.trace/trace-mt.exp
gdb/testsuite/gdb.trace/tracecmd.exp
gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp
gdb/testsuite/gdb.trace/tspeed.exp
gdb/testsuite/gdb.trace/tstatus.exp
gdb/testsuite/gdb.trace/tsv.exp
gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
gdb/testsuite/gdb.trace/unavailable.exp
gdb/testsuite/gdb.trace/while-stepping.exp

index 62e522c1764938e3152ba8358a48bc1d9b49d181..ba6fbd92ef2e48ef41c734a47c2eb8913827a558 100644 (file)
@@ -39,7 +39,6 @@ exclude = [
 "gdb/testsuite/gdb.cp",
 "gdb/testsuite/gdb.dwarf2",
 "gdb/testsuite/gdb.mi",
-"gdb/testsuite/gdb.trace",
 # IGNORE (document reason in trailing comment):
 "gdb/testsuite/gdb.stabs", # To be removed.
 ]
index 556dab52a7111e7ab8a5a9207e3e080210f94962..ef5acba4e323174e2256f5a2b77d6d23beac62c9 100644 (file)
@@ -161,11 +161,11 @@ proc test_actions_changed { } {
 
 clean_restart $testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return -1
 }
index 9bb38e13a9b808784eefacd8df0ebd8d370e27f7..89db2a6daae6a31ae49b9556ae13e67115ef65f5 100644 (file)
@@ -37,7 +37,7 @@ if {$baseline == -1} {
     return
 }
 
-set testline1 [expr $baseline + 7]
+set testline1 [expr {$baseline + 7}]
 
 #
 # test actions command
@@ -165,8 +165,8 @@ gdb_test_multiple "info tracepoints" "5.5c: verify NO actions for first tracepoi
 
 # 5.6 actions for invalid tracepoint number
 
-gdb_test "actions [expr $trcpt2 + $trcpt3]" \
-    "No tracepoint number [expr $trcpt2 + $trcpt3]." \
+gdb_test "actions [expr {$trcpt2 + $trcpt3}]" \
+    "No tracepoint number [expr {$trcpt2 + $trcpt3}]." \
                        "5.6: actions for invalid tracepoint number"
 
 # 5.7 invalid action (other than 'collect', 'while-stepping' or 'end')
@@ -245,7 +245,7 @@ if {[gdb_test "" "Breakpoint .*" "run to main"] != 0} {
     return -1
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "target does not support trace"
     return -1
 }
index 57073bdaf3ca33c2095fbdd8cfb14e9db2b7a3b9..7707edbde9b591b4727d64b5c29d13039a92657d 100644 (file)
@@ -23,12 +23,12 @@ set expfile $testfile.exp
 
 require gdb_trace_common_supports_arch
 
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
-       [list debug nowarnings nopie]] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+        [list debug nowarnings nopie]]} {
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -155,13 +155,13 @@ gdb_test_no_output "tstop" ""
 
 proc gdb_backtrace_tdp_1 { msg } {
     global gdb_prompt
-    
+
     # We are in a trace frame at which we didn't collect anything
     # except $PC.  Therefore we expect to be able to identify stack
     # frame #0, but that's about all.  In particular we do not expect
     # to be able to display the function's arguments or locals, and we
     # do not expect to be able to identify the caller of this function.
-    
+
     gdb_test "backtrace" \
        "#0\[\t \]+gdb_recursion_test.*depth=.*" \
        "$msg"
index 67ac4765eee289ca9d7056e02ff4b29ed03cb6a8..12b862cf51fa258ac08418bf8911d9b30363290d 100644 (file)
@@ -44,7 +44,7 @@ clean_restart $executable
 gdb_load_shlib $lib_sl1
 gdb_load_shlib $lib_sl2
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -64,7 +64,7 @@ proc tracepoint_change_loc_1 { trace_type } {
        global gdb_prompt
 
        clean_restart ${testfile}
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
        gdb_test_no_output "delete break 1"
@@ -88,7 +88,7 @@ proc tracepoint_change_loc_1 { trace_type } {
        set test "set tracepoint on set_tracepoint"
        gdb_test_multiple "${trace_type} set_tracepoint" $test {
            -re "Target returns error code .* too far .*$gdb_prompt $" {
-               if [string equal $trace_type "ftrace"] {
+               if {[string equal $trace_type "ftrace"]} {
                    # The target was unable to install the fast tracepoint
                    # (e.g., jump pad too far from tracepoint).
                    pass "$test (too far)"
@@ -113,7 +113,7 @@ proc tracepoint_change_loc_1 { trace_type } {
        set test "continue to marker 2"
        gdb_test_multiple "continue" $test {
            -re "Target returns error code .* too far .*$gdb_prompt $" {
-               if [string equal $trace_type "ftrace"] {
+               if {[string equal $trace_type "ftrace"]} {
                    # Expected if the target was unable to install the
                    # fast tracepoint (e.g., jump pad too far from
                    # tracepoint).
@@ -230,7 +230,7 @@ proc tracepoint_change_loc_2 { trace_type } {
                pass "tstart"
            }
            -re "Target returns error code .* too far .*$gdb_prompt $" {
-               if [string equal $trace_type "ftrace"] {
+               if {[string equal $trace_type "ftrace"]} {
                    # The target was unable to install the fast tracepoint
                    # (e.g., jump pad too far from tracepoint).
                    pass "$test (too far)"
@@ -291,12 +291,12 @@ proc tracepoint_install_in_trace_disabled { trace_type } {
        global gdb_prompt
 
        # This test only makes sense with remote targets.
-       if ![gdb_protocol_is_remote] {
+       if {![gdb_protocol_is_remote]} {
            return
        }
 
        clean_restart ${testfile}
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
index 3354c0f364924331e094443c254a7aad60a38e9d..73802a92fef534f18f4ccb68f07989234ea1cbde 100644 (file)
@@ -37,7 +37,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarning
 #
 
 # Set a tracepoint on given func.  The tracepoint is set at entry
-# address and not 'after prologue' address because we use 
+# address and not 'after prologue' address because we use
 # 'tfind pc func' to find the corresponding trace frame afterwards,
 # and that looks for entry address.
 proc set_a_tracepoint { func } {
index f0946ee4ace230904042578b00beaa185f9662b2..a60b7207e0686e0872e98a12c14e81b90cbae3da 100644 (file)
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarning
     return -1
 }
 
-# Tests: 
+# Tests:
 # 1) $args
 # 2) function args by name
 # 3) $locs
@@ -701,7 +701,7 @@ proc gdb_trace_collection_test {} {
     gdb_collect_registers_test "\$$fpreg, \$$spreg, \$$pcreg"
     gdb_collect_globals_test
     gdb_collect_global_in_pieces_test
-    
+
     #
     # Expression tests:
     #
@@ -747,7 +747,7 @@ proc gdb_trace_collection_test {} {
     # x[(y, z)] (tests comma expression) (ditto)
     # cast expr
     # stack data
-    
+
     gdb_collect_expression_test globals_test_func \
            "globalstruct.memberi"  "82"     "a.b"
     gdb_collect_expression_test globals_test_func \
index d05fe64434c727fa3c1128aaa906006163f61bc0..61f5ef6594dce8990e724720f8593f64d4b9e6b4 100644 (file)
@@ -37,7 +37,7 @@ if {$baseline == -1} {
     fail "could not find gdb_recursion_test function"
     return
 }
-set testline1 [expr $baseline + 4]
+set testline1 [expr {$baseline + 4}]
 
 #
 # test "delete tracepoints" command
@@ -185,11 +185,11 @@ gdb_test_multiple "delete tracepoint $trcpt1 $trcpt2 $trcpt3" \
 
 gdb_test "info tracepoints" \
     "No tracepoints." \
-                       "3.3c: verify delete three tracepoints" 
+                       "3.3c: verify delete three tracepoints"
 
 # 3.4 delete invalid tracepoint number
-gdb_test "delete tracepoint [expr $trcpt2 + $trcpt3]" \
-    "No breakpoint number [expr $trcpt2 + $trcpt3]." \
+gdb_test "delete tracepoint [expr {$trcpt2 + $trcpt3}]" \
+    "No breakpoint number [expr {$trcpt2 + $trcpt3}]." \
                        "3.4: delete invalid tracepoint number"
 
 # 3.5 delete tracepoint number zero
index 5a4e882b8042be76dcd2a33563187ccd386751a5..9a09a663b9dd2cbc537e00d98522bcb1803a8a60 100644 (file)
@@ -27,16 +27,16 @@ if { [info proc gdb_reconnect] == "" } {
     return -1
 }
 
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
-        {debug nowarnings}] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+        {debug nowarnings}]} {
     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
 }
@@ -51,7 +51,7 @@ proc disconnected_tracing {  } {
 
        # Start with a fresh gdb.
        clean_restart ${executable}
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
@@ -113,7 +113,7 @@ proc disconnected_tfind {  } {
 
        # Start with a fresh gdb.
        clean_restart ${executable}
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
index 1d2e8e9fb90aba25ead2256bc624501b2c20d88c..f6c4c5c1b6f64abb480e36dc32a6e5b7f05b111f 100644 (file)
@@ -165,7 +165,7 @@ if  {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
 
 clean_restart ${testfile}
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -199,11 +199,11 @@ clean_restart $testfile
 
 load_lib "trace-support.exp"
 
-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
 }
index 8c9d4aaca8ee750f6712c3710f7ab553d207489e..42e871113e89c291d78bd77c890acbb50aaf9fc9 100644 (file)
@@ -22,7 +22,7 @@ require gdb_trace_common_supports_arch
 standard_testfile
 
 # make check RUNTESTFLAGS='gdb.trace/ftrace-lock.exp NUM_THREADS=2'
-if ![info exists NUM_THREADS] {
+if {![info exists NUM_THREADS]} {
     set NUM_THREADS 2
 }
 
@@ -37,11 +37,11 @@ with_test_prefix "runtime trace support check" {
        return
     }
 
-    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
     }
@@ -59,7 +59,7 @@ if { [prepare_for_testing "prepare for testing with libipa" \
     return
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
index ac6e473a641a58bf3b98fe04e50fee7788953a7a..3192bdde19b138dbca013e0fba1378f2215691a9 100644 (file)
@@ -25,16 +25,16 @@ set additional_flags [gdb_target_symbol_prefix_flags]
 
 require gdb_trace_common_supports_arch
 
-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
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "target does not support trace"
     return -1
 }
@@ -54,7 +54,7 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 }
 clean_restart ${executable}
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
@@ -130,7 +130,7 @@ proc test_fast_tracepoints {} {
 
             set minaddr [exec sh -c "cat /proc/sys/vm/mmap_min_addr"]
 
-            if { [expr $minaddr > 64512] } {
+            if {$minaddr > 64512} {
                 warning "mmap_min_addr > 64512, fast tracepoint will fail"
                 warning "do \"sudo sysctl -w vm.mmap_min_addr=32768\" to adjust"
             }
@@ -190,7 +190,7 @@ proc test_fast_tracepoints {} {
     # fast tracepoints RSP feature, and confirm fast tracepoints
     # can no longer be downloaded.
     set test "fast tracepoint could not be downloaded with the feature disabled"
-    if [gdb_protocol_is_remote] {
+    if {[gdb_protocol_is_remote]} {
         gdb_test "set remote fast-tracepoints-packet off"
 
         gdb_test_multiple "tstart" $test {
index 7ba4ed3c337ef20aa41358a3cefe40b4a4f62781..47121ca83b9e92c24f7363a8c724fda0830b8c52 100644 (file)
@@ -66,8 +66,8 @@ gdb_test "info tracepoint $asm_test_num" \
     "2.2b: info tracepoint $asm_test_num (gdb_asm_test)"
 
 # 2.3 info tracepoint (invalid tracepoint number)
-gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
-    "No tracepoint matching '[expr $c_test_num + $asm_test_num]'." \
+gdb_test "info tracepoint [expr {$c_test_num + $asm_test_num}]" \
+    "No tracepoint matching '[expr {$c_test_num + $asm_test_num}]'." \
     "2.3: info tracepoint (invalid tracepoint number)"
 
 # 2.4 info tracepoints (list of numbers)
index 9b4f053963afd7a4f0d401411940622d872ef44e..1aaf27ce454b3c12d35fb344e0006cbebee4d840 100644 (file)
@@ -23,11 +23,11 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] }
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return -1
 }
index dd22046a0cf891d607e51aecf409b494781c5d6e..34013fb922079497a5db6ce76e232a354e3eeefe 100644 (file)
@@ -21,11 +21,11 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug nopi
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return -1
 }
@@ -129,16 +129,16 @@ proc test_trace_unavailable { data_source } {
 
        set pcnum -1
        set gpr0num -1
-       if [is_amd64_regs_target] {
+       if {[is_amd64_regs_target]} {
            set pcnum 16
            set gpr0num 0
-       } elseif [is_x86_like_target] {
+       } elseif {[is_x86_like_target]} {
            set pcnum 8
            set gpr0num 0
-       } elseif [is_aarch64_target] {
+       } elseif {[is_aarch64_target]} {
            set pcnum 32
            set gpr0num 0
-       } elseif [istarget "powerpc*-*-*"] {
+       } elseif {[istarget "powerpc*-*-*"]} {
            set pcnum 64
            set gpr0num 0
        } elseif { [istarget "s390*-*-*"] } {
index 90a053c9315314e86f6c880b4403bf2e250e1e71..029869bd46018fa485f62d259d3cdd86bd0c0d8e 100644 (file)
@@ -78,7 +78,7 @@ proc test_tfind_tfile { } {
 
 # If tracefile is generated successfully, copy tracefile to host and
 # run tests.
-if [generate_tracefile $binfile] {
+if {[generate_tracefile $binfile]} {
     if {!$purely_local} {
        # Copy tracefile from target to host.
        remote_download host [remote_upload target tfile-basic.tf] \
@@ -105,11 +105,11 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
 
 clean_restart $executable
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return -1
 }
index 99f7bf9b67be3ea55ff8bc0476f70a7f8d8c0a6e..da625633c42ec4e9c96bc2f7bb64e24ffc3551d1 100644 (file)
@@ -228,11 +228,11 @@ clean_restart $executable
 gdb_load_shlib $lib_sl1
 gdb_load_shlib $lib_sl2
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return -1
 }
index 6f71e79c93b5395f1c8eb8679518bccf42ac756a..c69ae89a005d95f8e9c97c9d29cb6e52741a6d8e 100644 (file)
@@ -36,7 +36,7 @@ proc test_create_delete_modify_tsv { } {
        global srcdir subdir
        global mi_gdb_prompt
 
-       if [mi_gdb_start] {
+       if {[mi_gdb_start]} {
            return
        }
        mi_gdb_load ${binfile}
@@ -67,11 +67,11 @@ proc test_create_delete_modify_tsv { } {
        # Test target supports tracepoints or not.
        clean_restart $testfile
 
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
-       if ![gdb_target_supports_trace] {
+       if {![gdb_target_supports_trace]} {
            unsupported "current target does not support trace"
            return -1
        }
@@ -201,12 +201,12 @@ proc test_upload_tsv { } {
            }
        }
 
-       if $tsv1_created {
+       if {$tsv1_created} {
            pass "tsv1 created"
        } else {
            fail "tsv1 created"
        }
-       if $tsv2_created {
+       if {$tsv2_created} {
            pass "tsv2 created"
        } else {
            fail "tsv2 created"
@@ -222,11 +222,11 @@ proc test_upload_tsv { } {
 
 clean_restart $testfile
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return -1
 }
index e1decfc54c1f0ed6bb0a3d3270ecf523f346a73e..5f7795d887f91dbfc0f7719f93cc37280fad92cd 100644 (file)
@@ -42,7 +42,7 @@ gdb_test "trace main" \
 gdb_test "tstart" "Target returns error code.*\."
 
 with_test_prefix "after tstart" {
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 }
index b4ec45a6ce42a828d394873cdbe7ea98e92f5054..2c7698a6eebca9ff0498b7253996edba39391df3 100644 (file)
@@ -52,16 +52,16 @@ if {$baseline == -1} {
 # define relative source line numbers:
 # all subsequent line numbers are relative to this first one (baseline)
 
-set testline2  [expr $baseline +  4]
-set testline3  [expr $baseline +  5]
-set testline4  [expr $baseline +  6]
+set testline2  [expr {$baseline +  4}]
+set testline3  [expr {$baseline +  5}]
+set testline4  [expr {$baseline +  6}]
 
 #
 # test passcount command semantics (live test)
 #
 
 ## Set three tracepoints with three different passcounts.
-## Verify that the experiment stops after the one with the 
+## Verify that the experiment stops after the one with the
 ## lowest passcount is hit.
 
 gdb_delete_tracepoints
@@ -125,7 +125,7 @@ with_test_prefix "trace_frame 4" {
 }
 
 ## We should now be at the last frame, because this frame's passcount
-## should have caused collection to stop.  If we do a tfind now, 
+## should have caused collection to stop.  If we do a tfind now,
 ## it should fail.
 
 gdb_test "tfind" "failed to find.*" "4.5: dynamic passcount test"
index f1b4e9e3084647ba5c87c9e3a39b07b8c866dbba..37d5c0932a6010b7689c46f6b646401283e495c3 100644 (file)
@@ -36,7 +36,7 @@ if {$baseline == -1} {
     return
 }
 
-set testline1  [expr $baseline + 3]
+set testline1  [expr {$baseline + 3}]
 
 #
 # test "passcount" command
@@ -212,8 +212,8 @@ gdb_test "info tracepoints" \
 
 # 4.8 set passcount for invalid tracepoint
 
-gdb_test "passcount 1 [expr $trcpt2 + $trcpt3]" \
-       "No tracepoint number [expr $trcpt2 + $trcpt3]." \
+gdb_test "passcount 1 [expr {$trcpt2 + $trcpt3}]" \
+       "No tracepoint number [expr {$trcpt2 + $trcpt3}]." \
        "4.8: invalid tracepoint number in passcount"
 
 # 4.9 help passcount
index 39e3abb673a3094aa879cb503a48a041c9c09a8e..fdf321bbc5bd422ce7991b506f7486237a48f624 100644 (file)
@@ -46,11 +46,11 @@ clean_restart $executable
 gdb_load_shlib $lib_sl1
 gdb_load_shlib $lib_sl2
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return -1
 }
@@ -138,7 +138,7 @@ proc pending_tracepoint_works { trace_type } {
                pass $test
            }
            -re "Target returns error code .* too far .*$gdb_prompt $" {
-               if [string equal $trace_type "ftrace"] {
+               if {[string equal $trace_type "ftrace"]} {
                    # The target was unable to install the fast tracepoint
                    # (e.g., jump pad too far from tracepoint).
                    pass "$test (too far)"
@@ -179,7 +179,7 @@ proc pending_tracepoint_resolved_during_trace { trace_type } \
 
     # Start with a fresh gdb.
     clean_restart $executable
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -206,7 +206,7 @@ proc pending_tracepoint_resolved_during_trace { trace_type } \
     set test "continue to marker 2"
     gdb_test_multiple "continue" $test {
        -re "Target returns error code .* too far .*$gdb_prompt $" {
-           if [string equal $trace_type "ftrace"] {
+           if {[string equal $trace_type "ftrace"]} {
                # Expected if the target was unable to install the
                # fast tracepoint (e.g., jump pad too far from
                # tracepoint).
@@ -247,7 +247,7 @@ proc pending_tracepoint_installed_during_trace { trace_type } \
 
     # Start with a fresh gdb.
     clean_restart $executable
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -278,7 +278,7 @@ proc pending_tracepoint_installed_during_trace { trace_type } \
     set test "continue to marker 2"
     gdb_test_multiple "continue" $test {
        -re "Target returns error code .* too far .*$gdb_prompt $" {
-           if [string equal $trace_type "ftrace"] {
+           if {[string equal $trace_type "ftrace"]} {
                # Expected if the target was unable to install the
                # fast tracepoint (e.g., jump pad too far from
                # tracepoint).
@@ -320,7 +320,7 @@ proc pending_tracepoint_disconnect_during_trace { trace_type } \
 
     # Start with a fresh gdb.
     clean_restart $executable
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -367,7 +367,7 @@ proc pending_tracepoint_disconnect_after_resolved { trace_type } \
 
     # Start with a fresh gdb.
     clean_restart $executable
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -419,7 +419,7 @@ proc pending_tracepoint_with_action_resolved { trace_type } \
 
     # Start with a fresh gdb.
     clean_restart $executable
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -449,7 +449,7 @@ proc pending_tracepoint_with_action_resolved { trace_type } \
     set test "continue to marker 2"
     gdb_test_multiple "continue" $test {
            -re "Target returns error code .* too far .*$gdb_prompt $" {
-            if [string equal $trace_type "ftrace"] {
+            if {[string equal $trace_type "ftrace"]} {
                # Expected if the target was unable to install the
                # fast tracepoint (e.g., jump pad too far from
                # tracepoint).
index 2284ab28b54d5f424d18b20991e5da3198b6cff1..37405ff64bfde064f8d56e26bf004b6c1a58f0bc 100644 (file)
@@ -17,16 +17,16 @@ load_lib "trace-support.exp"
 standard_testfile read-memory.c
 set executable $testfile
 
-if [prepare_for_testing "failed to prepare for trace tests" \
-       $executable $srcfile [list debug]] {
+if {[prepare_for_testing "failed to prepare for trace tests" \
+        $executable $srcfile [list debug]]} {
     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
 }
index 78170acce7042e5473ca4df13ba934206604e145..cf3ade646ea7b789641d9ccb42d1112839a86f27 100644 (file)
@@ -30,13 +30,13 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nopie}]}
     return -1
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
 # Check whether the target supports tracepoints.
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return -1
 }
index 396ed0274b1cedd244ec4f21207ed0d8697e5780..915f0a2dc78a80fee6ed231526eedf2105bf556c 100644 (file)
@@ -19,21 +19,21 @@ load_lib "range-stepping-support.exp"
 standard_testfile
 set executable $testfile
 
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
-       {debug nowarnings}] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+        {debug nowarnings}]} {
     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
 }
 
-if ![gdb_range_stepping_enabled] {
+if {![gdb_range_stepping_enabled]} {
     unsupported "range stepping not supported by the target"
     return -1
 }
@@ -79,7 +79,7 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 
 clean_restart ${executable}
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
index 558c0ea4bcf53a4f5cfeb0345aa829ddff880d1f..b369b408c716bf988f606b9d2a47616a3cbd38db 100644 (file)
@@ -21,11 +21,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nopie}]}
     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
 }
@@ -37,7 +37,7 @@ proc set_tracepoint_and_collect { } {
 
     # Start with a fresh gdb.
     clean_restart ${testfile}
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
     gdb_breakpoint "end" qualified
index f2a04f7e63dcaea35156dc47c1cae71b08d0c820..0b964d6d426efc90db21dd8efc0fbc14df31c09e 100644 (file)
@@ -100,7 +100,7 @@ all tests in this module will fail."
            untested "couldn't match pattern"
            set return_me 1
 all tests in this module will fail."
-    } 
+    }
 }
 
 if {$return_me == 1} {
@@ -288,27 +288,27 @@ proc use_collected_data { data_source } {
                exp_continue
            }
            -re "^\[^\r\n\]* line $testline1 .tracepoint .$tdp1\\)\r\n" {
-               set linecount1 [expr $linecount1 + 1]
+               set linecount1 [expr {$linecount1 + 1}]
                exp_continue
            }
            -re "^\[^\r\n\]* line $testline2 .tracepoint .$tdp2\\)\r\n" {
-               set linecount2 [expr $linecount2 + 1]
+               set linecount2 [expr {$linecount2 + 1}]
                exp_continue
            }
            -re "^\[^\r\n\]* line $testline3 .tracepoint .$tdp3\\)\r\n" {
-               set linecount3 [expr $linecount3 + 1]
+               set linecount3 [expr {$linecount3 + 1}]
                exp_continue
            }
            -re "^\[^\r\n\]* line $testline4 .tracepoint .$tdp4\\)\r\n" {
-               set linecount4 [expr $linecount4 + 1]
+               set linecount4 [expr {$linecount4 + 1}]
                exp_continue
            }
            -re "^\[^\r\n\]* line $testline5 .tracepoint .$tdp5\\)\r\n" {
-               set linecount5 [expr $linecount5 + 1]
+               set linecount5 [expr {$linecount5 + 1}]
                exp_continue
            }
            -re "^\[^\r\n\]* line $testline6 .tracepoint .$tdp6\\)\r\n" {
-               set linecount6 [expr $linecount6 + 1]
+               set linecount6 [expr {$linecount6 + 1}]
                exp_continue
            }
            -re "^No trace frame found\r\n$gdb_prompt $" {
@@ -328,7 +328,7 @@ proc use_collected_data { data_source } {
 
        gdb_test_multiple "while \$trace_frame != -1\n printf \"tracepoint #\%d, FP 0x\%08x, SP 0x\%08x, PC 0x%08x\\n\", \$tracepoint, \$fp, \$sp, \$pc\n tfind tracepoint\n end" "12.2: trace report #2" {
            -re "tracepoint #$tdp2, FP $hex, SP $hex, PC $hex" {
-               set linecount2 [expr $linecount2 + 1]
+               set linecount2 [expr {$linecount2 + 1}]
                exp_continue
            }
            -re ".*$gdb_prompt $" {
@@ -348,7 +348,7 @@ proc use_collected_data { data_source } {
 
        gdb_test_multiple "while \$trace_frame != -1\n printf \"TDP #\%d, frame \%d: depth = \%d, q1 = \%d\\n\", \$tracepoint, \$trace_frame, depth, q1\n tfind tracepoint\n end" "12.3: trace report #3" {
            -re "TDP #$tdp3, frame $decimal: depth = $decimal, q1 = $decimal" {
-               set linecount3 [expr $linecount3 + 1]
+               set linecount3 [expr {$linecount3 + 1}]
                exp_continue
            }
            -re ".*$gdb_prompt $" {
@@ -368,7 +368,7 @@ proc use_collected_data { data_source } {
 
        gdb_test_multiple "while \$trace_frame != -1\n printf \"TDP #\%d, frame %d: char_test = \%d, long_test = \%d\\n\", \$tracepoint, \$trace_frame, gdb_char_test, gdb_long_test\n tfind tracepoint\n end" "12.4: trace report #4" {
            -re "TDP #$tdp6, frame $decimal: char_test = $arg1, long_test = $arg3" {
-               set linecount6 [expr $linecount6 + 1]
+               set linecount6 [expr {$linecount6 + 1}]
                exp_continue
            }
            -re ".*$gdb_prompt $" {
index b018dc696cbcdab14cc7a711adb87e49cffecaff..31d976899cd8c1e2211ac9c0f5cde2bbab3dae8d 100644 (file)
@@ -37,12 +37,12 @@ if {$baseline == -1} {
     return
 }
 
-set testline1 [expr $baseline + 4]
-set testline2 [expr $baseline + 5]
-set testline3 [expr $baseline + 6]
-set testline4 [expr $baseline + 7]
-set testline5 [expr $baseline + 8]
-set testline6 [expr $baseline + 9]
+set testline1 [expr {$baseline + 4}]
+set testline2 [expr {$baseline + 5}]
+set testline3 [expr {$baseline + 6}]
+set testline4 [expr {$baseline + 7}]
+set testline5 [expr {$baseline + 8}]
+set testline6 [expr {$baseline + 9}]
 
 #
 # test save-trace command
@@ -53,7 +53,7 @@ set testline6 [expr $baseline + 9]
 gdb_delete_tracepoints
 
 foreach x { 1 2 3 4 5 6 } {
-    set testline [expr \$testline$x]
+    set testline [subst \$testline$x]
     set trcpt [gdb_gettpnum $testline]
     set trcpt$x $trcpt
     gdb_test "passcount $x" \
index 9c63770b1ae743d693a52328e102896d27c1546b..31cd9cd7c272c5ce7c9fa1eba10b222c3bcee222 100644 (file)
@@ -36,11 +36,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     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
 }
@@ -62,7 +62,7 @@ if { [istarget "i\[34567\]86-*-linux*"] || [istarget "x86_64-*-linux*"] } {
 
 # Start with a fresh gdb.
 clean_restart ${testfile}
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 
@@ -153,7 +153,7 @@ with_test_prefix "iterations equals to counter" {
 
 # Record the hit times of each tracepoint in this array.
 array set tracepoint_hits { }
-for { set i $tpnum } { $i < [expr $tpnum + 2] } { incr i } {
+for { set i $tpnum } { $i < $tpnum + 2 } { incr i } {
   set tracepoint_hits($i) 0
 }
 
@@ -162,7 +162,7 @@ while { 1 } {
    set idx 0
    gdb_test_multiple $test $test {
        -re "Found trace frame $decimal, tracepoint ($decimal).*\r\n$gdb_prompt $" {
-           set idx [expr $expect_out(1,string)]
+           set idx [expr {$expect_out(1,string)}]
            incr tracepoint_hits($idx)
        }
        -re "Target failed to find requested trace frame\..*\r\n$gdb_prompt $" {
@@ -176,7 +176,7 @@ while { 1 } {
 
 # Step 3, check the number of collections on each tracepoint.
 
-for { set i $tpnum } { $i < [expr $tpnum + 2] } { incr i } {
+for { set i $tpnum } { $i < $tpnum + 2 } { incr i } {
 
     if { $tracepoint_hits($i) == $iterations } {
        pass "tracepoint $i hit $iterations times"
index 1762d30282e5a1fd31fd56201d470a7d327d694f..a390dd926af0b89ee5c6891dee65958419b1b74b 100644 (file)
@@ -19,16 +19,16 @@ set executable $testfile
 set expfile $testfile.exp
 
 
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
-        {debug nowarnings}] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+        {debug nowarnings}]} {
     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
 }
@@ -42,7 +42,7 @@ proc test_tstart_tstop_tstart { } {
 
        # Start with a fresh gdb.
        clean_restart ${executable}
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
@@ -70,7 +70,7 @@ proc test_tstart_tstart { } {
 
        # Start with a fresh gdb.
        clean_restart ${executable}
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
@@ -96,7 +96,7 @@ proc test_buffer_full_tstart { } {
 
        # Start with a fresh gdb.
        clean_restart ${executable}
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
index 90923c1b45e14a0312a63a5a2910beb9f0f6b820..96ef4de94cc9a8c9cbcbec8c634d8bd71a7c07be 100644 (file)
@@ -45,7 +45,7 @@ proc strace_remove_socket { action } {
     # Restart with a fresh gdb.
     clean_restart $executable
     gdb_load_shlib $libipa
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -130,7 +130,7 @@ proc strace_info_marker { } {
        # Restart with a fresh gdb.
        clean_restart $executable
        gdb_load_shlib $libipa
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
@@ -166,7 +166,7 @@ proc strace_probe_marker { } {
        # Restart with a fresh gdb.
        clean_restart $executable
        gdb_load_shlib $libipa
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
@@ -205,7 +205,7 @@ proc strace_trace_on_same_addr { type } {
        # Restart with a fresh gdb.
        clean_restart $executable
        gdb_load_shlib $libipa
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
@@ -241,7 +241,7 @@ proc strace_trace_on_same_addr { type } {
                pass $test
            }
            -re ".*\r\n$gdb_prompt $" {
-               if [string equal $type "ftrace"] {
+               if {[string equal $type "ftrace"]} {
                    # The instruction may be not long enough to set a fast
                    # tracepoint.  Skip the rest of this test.
                    return -1
@@ -256,7 +256,7 @@ proc strace_trace_on_same_addr { type } {
                pass $test
            }
            -re ".*\r\n$gdb_prompt $" {
-               if [string equal $type "ftrace"] {
+               if {[string equal $type "ftrace"]} {
                    # The instruction may be not long enough to set a fast
                    # tracepoint.  Skip the rest of this test.
                    return -1
@@ -268,7 +268,7 @@ proc strace_trace_on_same_addr { type } {
 
        gdb_breakpoint "end" qualified
 
-       if [string equal $type "break"] {
+       if {[string equal $type "break"]} {
            gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
                "continue to bar"
            gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
@@ -308,7 +308,7 @@ proc strace_trace_on_diff_addr { } {
        # Restart with a fresh gdb.
        clean_restart $executable
        gdb_load_shlib $libipa
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
@@ -367,7 +367,7 @@ if { [istarget "x86_64-*-linux*"] || [istarget "i\[34567\]86-*-linux*"] } {
 
 clean_restart $executable
 gdb_load_shlib $libipa
-if ![runto_main] {
+if {![runto_main]} {
     return -1
 }
 if {![gdb_target_supports_trace]} {
index 92386e410b115266c0213f2f027a5ee3744ee997..53e97be5e57e2d4f03ee7768216611ff4b7e539f 100644 (file)
@@ -75,11 +75,11 @@ if {$baseline == -1} {
     return
 }
 
-set testline1 [expr $baseline + 1]
-set testline2 [expr $baseline + 5]
-set testline3 [expr $baseline + 6]
-set testline4 [expr $baseline + 7]
-set testline5 [expr $baseline + 8]
+set testline1 [expr {$baseline + 1}]
+set testline2 [expr {$baseline + 5}]
+set testline3 [expr {$baseline + 6}]
+set testline4 [expr {$baseline + 7}]
+set testline5 [expr {$baseline + 8}]
 
 #
 # test tfind command
@@ -351,7 +351,7 @@ gdb_test "tfind line NoSuChFiLe.c:$baseline" \
        "No source file named.*" \
        "8.27: tfind line in bad source file"
 
-# 8.32 tfind invalid subcommand (tfind foo) 
+# 8.32 tfind invalid subcommand (tfind foo)
 ## check error
 gdb_test "tfind NoSuChOpTiOn 21" \
        "No symbol.*|\[Ww\]arning.*|\[Ee\]rror.*" \
index 659267fbb8cc9953744c0db585f20ea7e82b8224..a2a79d848a0574d380a99bf2420a5960fa5b804a 100644 (file)
@@ -23,16 +23,16 @@ set additional_flags [gdb_target_symbol_prefix_flags]
 
 require gdb_trace_common_supports_arch
 
-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
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "target does not support trace"
     return -1
 }
@@ -47,7 +47,7 @@ proc break_trace_same_addr_1 { trace_type option } \
 
     # Start with a fresh gdb.
     clean_restart ${executable}
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -81,7 +81,7 @@ proc break_trace_same_addr_2 { trace_type1 trace_type2 option } \
 
     # Start with a fresh gdb.
     clean_restart ${executable}
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -119,7 +119,7 @@ proc break_trace_same_addr_3 { trace_type option } \
 
     # Start with a fresh gdb.
     clean_restart ${executable}
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -156,7 +156,7 @@ proc break_trace_same_addr_4 { trace_type option } \
 
     # Start with a fresh gdb.
     clean_restart ${executable}
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -199,7 +199,7 @@ proc break_trace_same_addr_5 { trace1 trace2 trace3 trace3_at_first_loc } \
 
     # Start with a fresh gdb.
     clean_restart ${executable}
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -222,7 +222,7 @@ proc break_trace_same_addr_5 { trace1 trace2 trace3 trace3_at_first_loc } \
     gdb_test "continue" "Continuing\\.\[ \r\n\]+(Thread .* hit )?Breakpoint.*" \
        "continue to marker"
 
-    if [string equal $trace3_at_first_loc "1"] {
+    if {[string equal $trace3_at_first_loc "1"]} {
        gdb_test "${trace3} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \
            "${trace3} set_point 2"
     } else {
@@ -272,7 +272,7 @@ proc break_trace_same_addr_6 { trace1 enable1 trace2 enable2 } \
 
     # Start with a fresh gdb.
     clean_restart ${executable}
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -300,7 +300,7 @@ proc break_trace_same_addr_6 { trace1 enable1 trace2 enable2 } \
     gdb_test_no_output "tstop"
 
 
-    if [string equal $enable1 "enable"] {
+    if {[string equal $enable1 "enable"]} {
        gdb_test "tfind tracepoint 4" "Found trace frame \[0-9\], tracepoint .*" \
            "tfind test frame of tracepoint 4"
        gdb_test "tdump" \
@@ -313,7 +313,7 @@ proc break_trace_same_addr_6 { trace1 enable1 trace2 enable2 } \
            "tfind test frame of tracepoint 4"
     }
 
-    if [string equal $enable2 "enable"] {
+    if {[string equal $enable2 "enable"]} {
        gdb_test "tfind tracepoint 5" "Found trace frame \[0-9\], tracepoint .*" \
            "tfind test frame of tracepoint 5"
        gdb_test "tdump" \
@@ -359,7 +359,7 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 }
 clean_restart ${executable}
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
index 7fe814e08d688f134d2f578fe731ead3d407dcb6..153439fffe44ba2c9265c6371a0b343b97d4dcb8 100644 (file)
@@ -17,16 +17,16 @@ load_lib "trace-support.exp"
 
 standard_testfile
 
-if [prepare_for_testing "failed to prepare" $testfile $srcfile \
-        {debug nowarnings}] {
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
+        {debug nowarnings}]} {
     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
 }
index 8251345a2110bd11b776acfc53373c69b1cd39a0..0463656fc5c6304b17d358c8e79a88bd05918f53 100644 (file)
@@ -25,16 +25,16 @@ set additional_flags [gdb_target_symbol_prefix_flags]
 
 require gdb_trace_common_supports_arch
 
-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
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "target does not support trace"
     return -1
 }
@@ -55,7 +55,7 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 
 clean_restart ${executable}
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
@@ -69,7 +69,7 @@ proc test_tracepoints { trace_command condition num_frames { kfail_proc 0 } } {
 
     clean_restart ${executable}
 
-    if ![runto_main] {
+    if {![runto_main]} {
        return 0
     }
 
index c009cfffeae2f3045a5cf4794f7b6851330a9105..92d664bfdbe25c2e0a40784c9c4a2a0868cec61d 100644 (file)
@@ -32,11 +32,11 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable $options] != ""
 
 clean_restart ${testfile}
 
-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
 }
@@ -64,7 +64,7 @@ proc test_tracepoint_enable_disable { tracepoint_cmd } {
 
        set expected 0
 
-       if ![runto_main] {
+       if {![runto_main]} {
            return -1
        }
 
index 092dc6d9578d4378442395d4a2051a77e78221a2..ec6eaed32fd4cd06f21df041e75b3c59bbe68f83 100644 (file)
@@ -27,11 +27,11 @@ with_test_prefix "runtime trace support check" {
        return
     }
 
-    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
     }
@@ -47,7 +47,7 @@ proc step_over_tracepoint { testfile trace_type } \
 
     # Make sure inferior is running in all-stop mode.
     gdb_test_no_output "set non-stop 0"
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -70,7 +70,7 @@ proc break_trace_same_addr { testfile trace_type option } \
 
     # Start with a fresh gdb.
     clean_restart $testfile
-    if ![runto_main] {
+    if {![runto_main]} {
        return -1
     }
 
@@ -114,7 +114,7 @@ if { [prepare_for_testing "prepare for testing" $testfile_ipa $srcfile \
     return
 }
 
-if ![runto_main] {
+if {![runto_main]} {
     return 0
 }
 
index 6e67de11668ac2b6aa8766f832c38110c0367c98..275772bd9f6989b0dfe3561ce213fc8c76d04e37 100644 (file)
@@ -36,8 +36,8 @@ if {$baseline == -1} {
     return
 }
 
-set testline1 [expr $baseline + 1]
-set testline2 [expr $baseline + 3]
+set testline1 [expr {$baseline + 1}]
+set testline2 [expr {$baseline + 3}]
 
 #
 # test "help tracepoints"
@@ -45,7 +45,7 @@ set testline2 [expr $baseline + 3]
 
 set helpcnt 0
 test_class_help "tracepoints" {
-    "Tracing of program execution without stopping the program\.[\r\n\]+" 
+    "Tracing of program execution without stopping the program\.[\r\n\]+"
 } {} "1.0: help tracepoints"
 
 #
index f61115eaee07aa485a38fdcbe8bed08795eed15b..5f9159cdb3ed66811d5b0d5173049b9fe2430212 100644 (file)
@@ -23,11 +23,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
     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
 }
index be7f37e2e36df4b98e498ae50a25ef1d78d9c1cd..2578c9e680ec28ed63b8d63df431357d826afea0 100644 (file)
@@ -18,7 +18,7 @@ load_lib "trace-support.exp"
 require allow_shlib_tests
 
 # Do not run if gdbserver debug is enabled - the output file is many Gb.
-if [gdbserver_debug_enabled] {
+if {[gdbserver_debug_enabled]} {
     return 0
 }
 
@@ -33,11 +33,11 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable $options] != ""
 
 clean_restart ${testfile}
 
-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
 }
index f5547aa60dc68e96b79a5d28f47c7b0645b68b76..2b4aa5a0c6a1acb37ab656454419f861314fd566 100644 (file)
@@ -20,16 +20,16 @@ set expfile tstatus.exp
 
 require gdb_trace_common_supports_arch
 
-if [prepare_for_testing "failed to prepare" $executable $srcfile \
-       [list debug]] {
+if {[prepare_for_testing "failed to prepare" $executable $srcfile \
+        [list debug]]} {
     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
 }
index 837633d083bd3d69dcf993f6392fce640337c1b7..3fe68670b5c8b47de64fe689e2325276d359ce89 100644 (file)
@@ -201,7 +201,7 @@ if {![runto_main]} {
 
 # If there are predefined TSVs, test these predefined TSVs are correctly
 # uploaded.
-if [target_info exists gdb,predefined_tsv] {
+if {[target_info exists gdb,predefined_tsv]} {
     set tsv [target_info gdb,predefined_tsv]
 
     # Test predefined TSVs are uploaded.
index 3adf24afe1584c993a081ae1506ed12c9d1a1d8f..e62a539df5b1c47c8dd76d98c9e2344cd0587b9a 100644 (file)
@@ -294,11 +294,11 @@ if  { [gdb_compile [list ${binfile}1.o ${binfile}2.o] ${binfile} \
 
 clean_restart ${testfile}
 
-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
 }
index 51532c9a4941c314ffceeccd73b2ef673f4fcada..9d4955f5f821de7b62c7c1975d0b2b8f1a3c36f4 100644 (file)
@@ -302,12 +302,12 @@ proc gdb_unavailable_registers_test_1 { } {
 
     # Test reading uncollected pseudo-registers.  The set of which
     # depends on target.
-    if [is_amd64_regs_target] {
+    if {[is_amd64_regs_target]} {
        # Check the raw register first.
        test_register_unavailable "\$rax"
        test_register_unavailable "\$eax"
        test_register_unavailable "\$ax"
-    } elseif [is_x86_like_target] {
+    } elseif {[is_x86_like_target]} {
        # Check the raw register first.
        test_register_unavailable "\$eax"
        test_register_unavailable "\$ax"
index 0dbff1819723fbf94201edb4c2223f07bbf6616e..5a082a3ff23d71e791de9910244982d9b7ff53d3 100644 (file)
@@ -105,7 +105,7 @@ if {[gdb_test "" "Breakpoint .*" "run to main"] != 0} {
     return -1
 }
 
-if ![gdb_target_supports_trace] {
+if {![gdb_target_supports_trace]} {
     unsupported "target does not support trace"
     return -1
 }