]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix gdb.mi
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.mi shows a few problems.

Fix these.

53 files changed:
gdb/tclint.toml
gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp
gdb/testsuite/gdb.mi/gdb680.exp
gdb/testsuite/gdb.mi/gdb792.exp
gdb/testsuite/gdb.mi/list-thread-groups-available.exp
gdb/testsuite/gdb.mi/mi-async.exp
gdb/testsuite/gdb.mi/mi-basics.exp
gdb/testsuite/gdb.mi/mi-break.exp
gdb/testsuite/gdb.mi/mi-breakpoint-multiple-locations.exp
gdb/testsuite/gdb.mi/mi-breakpoint-script.exp
gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp
gdb/testsuite/gdb.mi/mi-cli.exp
gdb/testsuite/gdb.mi/mi-cmd-error.exp
gdb/testsuite/gdb.mi/mi-condbreak-fail.exp
gdb/testsuite/gdb.mi/mi-condbreak-throw.exp
gdb/testsuite/gdb.mi/mi-console.exp
gdb/testsuite/gdb.mi/mi-corefile.exp
gdb/testsuite/gdb.mi/mi-disassemble.exp
gdb/testsuite/gdb.mi/mi-dprintf.exp
gdb/testsuite/gdb.mi/mi-eval.exp
gdb/testsuite/gdb.mi/mi-exec-run.exp
gdb/testsuite/gdb.mi/mi-file.exp
gdb/testsuite/gdb.mi/mi-fill-memory.exp
gdb/testsuite/gdb.mi/mi-fortran-modules.exp
gdb/testsuite/gdb.mi/mi-frame-regs.exp
gdb/testsuite/gdb.mi/mi-info-os.exp
gdb/testsuite/gdb.mi/mi-logging.exp
gdb/testsuite/gdb.mi/mi-multi-commands.exp
gdb/testsuite/gdb.mi/mi-nonstop.exp
gdb/testsuite/gdb.mi/mi-pending.exp
gdb/testsuite/gdb.mi/mi-pthreads.exp
gdb/testsuite/gdb.mi/mi-reg-undefined.exp
gdb/testsuite/gdb.mi/mi-return.exp
gdb/testsuite/gdb.mi/mi-reverse.exp
gdb/testsuite/gdb.mi/mi-simplerun.exp
gdb/testsuite/gdb.mi/mi-stack.exp
gdb/testsuite/gdb.mi/mi-stepi.exp
gdb/testsuite/gdb.mi/mi-stepn.exp
gdb/testsuite/gdb.mi/mi-syn-frame.exp
gdb/testsuite/gdb.mi/mi-thread-bp-deleted.exp
gdb/testsuite/gdb.mi/mi-thread-specific-bp.exp
gdb/testsuite/gdb.mi/mi-until.exp
gdb/testsuite/gdb.mi/mi-var-child.exp
gdb/testsuite/gdb.mi/mi-var-cmd.exp
gdb/testsuite/gdb.mi/mi-var-create-rtti.exp
gdb/testsuite/gdb.mi/mi-var-display.exp
gdb/testsuite/gdb.mi/mi-var-rtti.exp
gdb/testsuite/gdb.mi/mi-watch.exp
gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp
gdb/testsuite/gdb.mi/mi2-var-child.exp
gdb/testsuite/gdb.mi/new-ui-bp-deleted.exp
gdb/testsuite/gdb.mi/print-simple-values.exp
gdb/testsuite/gdb.mi/user-selected-context-sync.exp

index e6283e49d63e1a3a3261ca6b2ec30fe45006bd01..e37c7d9f3a580888c292fae338d488e9e95709bb 100644 (file)
@@ -37,7 +37,6 @@ exclude = [
 "gdb/testsuite/gdb.arch",
 "gdb/testsuite/gdb.base",
 "gdb/testsuite/gdb.dwarf2",
-"gdb/testsuite/gdb.mi",
 # IGNORE (document reason in trailing comment):
 "gdb/testsuite/gdb.stabs", # To be removed.
 ]
index 05656817b99b71f374e904d8d155166e00844f98..074defa615869401e7a87957ef41fac6fae76e5b 100644 (file)
@@ -46,7 +46,7 @@ if {[mi_clean_restart $::testfile]} {
     return
 }
 
-if [mi_runto func_nofb_marker] {
+if {[mi_runto func_nofb_marker]} {
     # First try referencing DW_AT_frame_base which is not defined.
     mi_gdb_test "300-stack-list-locals --thread 1 --frame 1 --all-values" \
        "300\\^done,locals=\\\[\{name=\"func_nofb_var\",value=\"\\\<error reading variable: Could not find the frame base for \\\\\"func_nofb\\\\\"\\\.\\\>\"\},\{name=\"func_nofb_var2\",value=\"\\\<error reading variable: Could not find the frame base for \\\\\"func_nofb\\\\\"\\\.\\\>\"\}\\\].*" \
@@ -60,7 +60,7 @@ if {[mi_clean_restart $::testfile]} {
 
 # And now try referencing DW_AT_frame_base defined using a self-reference
 # (DW_OP_fbreg).
-if [mi_runto func_loopfb_marker] {
+if {[mi_runto func_loopfb_marker]} {
     mi_gdb_test "301-stack-list-locals --thread 1 --frame 1 --all-values" \
        "301\\^done,locals=\\\[\{name=\"func_loopfb_var\",value=\"\\\<error reading variable: DWARF-2 expression error: Loop detected.*\"\},\{name=\"func_loopfb_var2\",value=\"\\\<error reading variable: DWARF-2 expression error: Loop detected.*\"\}\\\]" \
        "test func_loopfb_var"
index 6eb8928562203a7f3d85bb7840a273e5760db6e6..bffdfa1c816b0a46f9d7533cd3cfe8dd82923da3 100644 (file)
@@ -30,7 +30,7 @@ proc do_test {count} {
     "-data-list-register-names -1, try $count"
 }
 
-# Tests a bug with ui-out and nested uiout types. When 
+# Tests a bug with ui-out and nested uiout types. When
 # an error is encountered building a nest typed, like
 # lists or tuples, the uiout is not reset to some sane
 # state. As a result, uiout still thinks it is building
index 64f218a2feb3a3d7ed6741501f94ce77f2e2c1f6..a2d17aa13ee75ebac61dbb8613646e71d8488d75 100644 (file)
@@ -36,7 +36,7 @@ mi_create_varobj "var1" "a" "create var for class A"
 
 mi_list_varobj_children "var1" {
     {var1.public public 2}
-    {var1.private private 2} 
+    {var1.private private 2}
     {var1.protected protected 2}
 } "list children of class A"
 
index b41c768739372f3ca64f39e6f1bb1362a305cbee..b68cca684af008ee2c7f0c4baf0045090fa409d9 100644 (file)
@@ -29,7 +29,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
     return -1
 }
 
-if [mi_gdb_start] {
+if {[mi_gdb_start]} {
     return
 }
 
index 1c4e06cd3a45862edaf754dcc5acf52ae80cb8b0..11ba52f9d3fe5a333aeaca7d3f893099a338d59f 100644 (file)
@@ -55,8 +55,8 @@ proc linux_async_tests {} {
     global hex
 
     set line_main_head     [gdb_get_line_number "main ("]
-    set line_main_body     [expr $line_main_head + 2]
-    set line_main_next     [expr $line_main_head + 3]
+    set line_main_body     [expr {$line_main_head + 2}]
+    set line_main_next     [expr {$line_main_head + 3}]
 
     mi_send_resuming_command_raw "start" "start: send"
     mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" "$line_main_body" { "" "disp=\"del\"" } "start: stop"
index 2add9db486d95c603897ab920dce8f4a32fb6d80..3038a2cbadf2762b4d14c3a2d7d5d4a2abb92279 100644 (file)
@@ -45,7 +45,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 # procedures work, so it makes no sense using them here.
 
 gdb_exit
-if [mi_gdb_start separate-inferior-tty] {
+if {[mi_gdb_start separate-inferior-tty]} {
     return
 }
 
@@ -61,9 +61,9 @@ proc test_mi_interpreter_selection {} {
 
     # All this test expects is to get the prompt back
     # with no syntax error message
-    if ![mi_gdb_test "-gdb-version" "~\"GNU gdb.*" "acceptance of MI operations"] {
+    if {![mi_gdb_test "-gdb-version" "~\"GNU gdb.*" "acceptance of MI operations"]} {
        return 1
-    } 
+    }
 
     note "Skipping all other MI tests."
     return 0
@@ -73,7 +73,7 @@ proc test_exec_and_symbol_mi_operatons {} {
     global mi_gdb_prompt
     global binfile testfile
 
-    if [is_remote host] {
+    if {[is_remote host]} {
        set filename ${testfile}
        remote_download host ${binfile} ${filename}
     } else {
@@ -84,8 +84,8 @@ proc test_exec_and_symbol_mi_operatons {} {
     # Tests:
     # -file-exec-and-symbols
 
-    if [mi_gdb_test "-file-exec-and-symbols ${filename}" "\\\^done" \
-       "file-exec-and-symbols operation"] {
+    if {[mi_gdb_test "-file-exec-and-symbols ${filename}" "\\\^done" \
+            "file-exec-and-symbols operation"]} {
        note "Skipping all other MI tests."
        return 0
     }
@@ -144,7 +144,7 @@ proc test_dir_specification {} {
     # Add to the search directories, display, then reset back to default
     # Tests:
     # -environment-directory arg
-    # -environment-directory 
+    # -environment-directory
     # -environment-directory -r
 
     mi_gdb_test "202-environment-directory ${testsubdir}" \
@@ -176,7 +176,7 @@ proc test_cwd_specification {} {
 
     # The canonical name of the working directory may differ on a
     # remote host from that on the build system.
-    if ![is_remote host] {
+    if {![is_remote host]} {
        mi_gdb_test "206-environment-pwd" \
              "206\\\^done,cwd=\"${escapedobjdir}\"" \
              "environment-pwd operation"
@@ -192,9 +192,9 @@ proc test_path_specification {} {
     global envirodir
     global expect_out
 
-    # Add to the path, display, then reset 
+    # Add to the path, display, then reset
     # Tests:
-    # -environment-path 
+    # -environment-path
     # -environment-path dir1 dir2
     # -environment-path -r dir
     # -environment-path -r
@@ -220,7 +220,7 @@ proc test_path_specification {} {
              "210\\\^done,path=\"$orig_path\"" \
              "environment-path -r operation"
 
-} 
+}
 
 proc test_setshow_inferior_tty {} {
     global mi_gdb_prompt
index cb7c14b48867cd4d8dc42aeedd8d47ae1055c52e..2064efe7c2fbd66de1e501519ba9edd24449e7b3 100644 (file)
@@ -32,17 +32,17 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 # Locate line numbers in basics.c.
 set line_callee4_head  [gdb_get_line_number "callee4 ("]
-set line_callee4_body  [expr $line_callee4_head + 2]
+set line_callee4_body  [expr {$line_callee4_head + 2}]
 set line_callee3_head  [gdb_get_line_number "callee3 ("]
-set line_callee3_body  [expr $line_callee3_head + 2]
+set line_callee3_body  [expr {$line_callee3_head + 2}]
 set line_callee2_head  [gdb_get_line_number "callee2 ("]
-set line_callee2_body  [expr $line_callee2_head + 2]
+set line_callee2_body  [expr {$line_callee2_head + 2}]
 set line_callee1_head  [gdb_get_line_number "callee1 ("]
-set line_callee1_body  [expr $line_callee1_head + 2]
+set line_callee1_body  [expr {$line_callee1_head + 2}]
 set line_main_head     [gdb_get_line_number "main ("]
-set line_main_body     [expr $line_main_head + 2]
+set line_main_body     [expr {$line_main_head + 2}]
 set line_callme_head   [gdb_get_line_number "callme ("]
-set line_callme_body   [expr $line_callme_head + 2]
+set line_callme_body   [expr {$line_callme_head + 2}]
 
 set fullname "fullname=\"${fullname_syntax}${srcfile}\""
 
@@ -362,7 +362,7 @@ proc_with_prefix test_forced_conditions {} {
        "${warning}\\^done" \
        "invalid condition is forced"
     set args [list -cond "bad == 42" -locations "\\\[$loc\\\]"]
-    set bp [eval mi_make_breakpoint_multi $args]
+    set bp [mi_make_breakpoint_multi {*}$args]
     mi_gdb_test "-break-info 16" \
        "\\^done,[mi_make_breakpoint_table [list $bp]]" \
        "invalid condition is defined"
@@ -398,7 +398,7 @@ proc test_break {mi_mode} {
     } else {
        set start_ops ""
     }
-    if [mi_clean_restart $::testfile $start_ops ] {
+    if {[mi_clean_restart $::testfile $start_ops ]} {
        return
     }
 
index 7995846771806b22b5aa70693fb608f8761f90fb..fe50cdcb7826c944efe4f1da32b30a4fb8a00552 100644 (file)
@@ -34,7 +34,7 @@ if {[gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable {debug c++}] !=
 
 
 proc make_breakpoints_pattern { expect_fixed_output bp_num loc1_en loc2_en } {
-    if $expect_fixed_output {
+    if {$expect_fixed_output} {
        return "bkpt=\{number=\"${bp_num}\",type=\"breakpoint\",.*,locations=\\\[\{number=\"${bp_num}\\.1\",enabled=\"${loc1_en}\",.*\},\{number=\"${bp_num}\\.2\",enabled=\"${loc2_en}\",.*\}\\\]\}"
     } else {
        return "bkpt=\{number=\"${bp_num}\",type=\"breakpoint\",.*\},\{number=\"${bp_num}\\.1\",enabled=\"${loc1_en}\",.*\},\{number=\"${bp_num}\\.2\",enabled=\"${loc2_en}\",.*\}"
@@ -60,7 +60,7 @@ proc do_test { mi_version use_fix_flag expect_fixed_output } {
 
            mi_runto_main
 
-           if $use_fix_flag {
+           if {$use_fix_flag} {
                mi_gdb_test "-fix-multi-location-breakpoint-output" "\\^done" \
                    "send -fix-multi-location-breakpoint-output"
            }
index ce30d4404b6f2c74a484eaafd0f931a46c854add..e4242a3f1b6c9c60d63cb9198896b7d00e728b41 100644 (file)
@@ -30,7 +30,7 @@ if {[gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable {debug}] != "" }
 #   script field, else expect it to output the broken pre-mi4 format.
 
 proc make_pattern { expect_fixed_output } {
-    if $expect_fixed_output {
+    if {$expect_fixed_output} {
        return "bkpt=\{number=\"${::decimal}\",type=\"breakpoint\",.*,script=\\\[\"abc\",\"def\"\\\],.*"
     } else {
        return "bkpt=\{number=\"${::decimal}\",type=\"breakpoint\",.*,script=\\\{\"abc\",\"def\"\\\},.*"
@@ -54,7 +54,7 @@ proc do_test { mi_version use_fix_flag expect_fixed_output } {
                mi_clean_restart $::testfile
            }
 
-           if $use_fix_flag {
+           if {$use_fix_flag} {
                mi_gdb_test "-fix-breakpoint-script-output" "\\^done" \
                    "send -fix-multi-location-breakpoint-output"
            }
index ec023e666aa7afd06ba8ac31bc2f3bd296a74d8c..802d0be180eefe836313a11d309a4f2248b9c0bd 100644 (file)
@@ -31,7 +31,7 @@ mi_clean_restart $::testfile
 if {[mi_runto_main] < 0} {
     return -1
 }
-set libstdcxx_probe_tests_supported [expr ![mi_skip_libstdcxx_probe_tests]]
+set libstdcxx_probe_tests_supported [expr {![mi_skip_libstdcxx_probe_tests]}]
 
 # Grab some line numbers we'll need.
 set catch_1_lineno [gdb_get_line_number "Catch 1"]
index b59a5ed3f9865214e9a2dc6f15150c1a9ba371fe..776368911be1192e9124c9f02f6c10c2d0c7bc17 100644 (file)
@@ -59,14 +59,14 @@ mi_gdb_test "-interpreter-exec console \"file $binfile\"" \
 mi_runto_main
 
 set line_main_head    [gdb_get_line_number "main ("]
-set line_main_body    [expr $line_main_head + 2]
+set line_main_body    [expr {$line_main_head + 2}]
 set line_main_hello   [gdb_get_line_number "Hello, World!"]
-set line_main_return  [expr $line_main_hello + 2]
-set line_main_callme_2 [expr $line_main_return + 1]
+set line_main_return  [expr {$line_main_hello + 2}]
+set line_main_callme_2 [expr {$line_main_return + 1}]
 set line_callee4_head [gdb_get_line_number "callee4 ("]
-set line_callee4_body [expr $line_callee4_head + 2]
-set line_callee4_next [expr $line_callee4_body + 1]
-set line_callee4_next_step [expr $line_callee4_next + 3]
+set line_callee4_body [expr {$line_callee4_head + 2}]
+set line_callee4_next [expr {$line_callee4_body + 1}]
+set line_callee4_next_step [expr {$line_callee4_next + 3}]
 
 mi_gdb_test "-interpreter-exec console \"set args foobar\"" \
   ".*=cmd-param-changed,param=\"args\",value=\"foobar\".*\\^done" \
@@ -233,7 +233,7 @@ mi_gdb_test "-interpreter-exec console \"set listsize 10\"" \
   "-interpreter-exec console \"set listsize 10\""
 
 # "list" should show 10 lines centered on where the program stopped.
-set first_list_line [expr $line_main_callme_2 - 5]
+set first_list_line [expr {$line_main_callme_2 - 5}]
 mi_gdb_test "-interpreter-exec console \"list\"" \
     ".*\~\"$first_list_line.*\\^done" \
     "-interpreter-exec console \"list\" at basics.c:\$line_main_callme_2"
index 195bced0a11693a3f68b74818bef56608bd4c471..81b3a23bdf4096147f94f50be6697f4a6a6dcdfd 100644 (file)
@@ -70,7 +70,9 @@ set cmdnames {
 for {set i 0} {$i < [llength $procs]} {incr i} {
     for {set j 0} {$j < [llength $procs]} {incr j} {
        with_test_prefix "[lindex $cmdnames $i] first ($i x $j)" {
+           # tclint-disable-next-line command-args
            with_test_prefix "1st" [lindex $procs $i]
+           # tclint-disable-next-line command-args
            with_test_prefix "2nd" [lindex $procs $j]
        }
     }
index 5bd899325407941a0b45c40629af7888e814cbdb..34e94948faa1347866e7b1479512c41781a784f2 100644 (file)
@@ -22,7 +22,7 @@ set MIFLAGS "-i=mi"
 
 standard_testfile
 
-if [build_executable ${testfile}.exp ${binfile} ${srcfile}] {
+if {[build_executable ${testfile}.exp ${binfile} ${srcfile}]} {
     return -1
 }
 
index b4960a858da7de7d15f67f7d619f229ee5a35d52..1b4f8175960d01119c7b722551e295062c36fd7e 100644 (file)
@@ -25,7 +25,7 @@ set MIFLAGS "-i=mi"
 
 standard_testfile .cc
 
-if [build_executable ${testfile}.exp ${binfile} ${srcfile} {debug c++}] {
+if {[build_executable ${testfile}.exp ${binfile} ${srcfile} {debug c++}]} {
     return -1
 }
 
index 861ef42659790032886dd98f9397dfcc23ede2cd..710c2c874edb56c19a939be7ead06285143d9fbc 100644 (file)
@@ -91,5 +91,5 @@ mi_gdb_test "220-exec-next" \
 set line [gdb_get_line_number "after-hello"]
 mi_expect_stop "end-stepping-range" "main" "" ".*mi-console.c" $line "" \
     "finished step over hello"
-    
+
 mi_gdb_exit
index b4914866dfc9bb1a042026141129e5483a9f1007..d663eec783b686457e0219833c769faded0ddc92 100644 (file)
@@ -33,7 +33,7 @@ if {$corefile == ""} {
     return 0
 }
 
-if [mi_gdb_start] {
+if {[mi_gdb_start]} {
     return
 }
 
index 90f79e384de7441eb7305a47dd079e29c7cb8952..6c6d05dbda6c90c599357ef31f6f0fcfc5bee691 100644 (file)
@@ -36,7 +36,7 @@ proc test_disassembly_only {} {
     global decimal
 
     set line_main_head [gdb_get_line_number "main ("]
-    set line_main_body [expr $line_main_head + 2]
+    set line_main_body [expr {$line_main_head + 2}]
 
     # Test disassembly more only for the current function.
     # Tests:
@@ -76,7 +76,7 @@ proc test_disassembly_with_opcodes {} {
     global decimal
 
     set line_main_head [gdb_get_line_number "main ("]
-    set line_main_body [expr $line_main_head + 2]
+    set line_main_body [expr {$line_main_head + 2}]
 
     # Test disassembly with opcodes for the current function.
     # Tests:
@@ -106,7 +106,7 @@ proc test_disassembly_lines_limit {} {
     global decimal
 
     set line_main_head [gdb_get_line_number "main ("]
-    set line_main_body [expr $line_main_head + 2]
+    set line_main_body [expr {$line_main_head + 2}]
 
     # Test disassembly more only for the current function.
     # Tests:
@@ -136,7 +136,7 @@ proc test_disassembly_mixed {} {
     global fullname_syntax
 
     set line_callee2_head       [gdb_get_line_number "callee2 ("]
-    set line_callee2_open_brace [expr $line_callee2_head + 1]
+    set line_callee2_open_brace [expr {$line_callee2_head + 1}]
 
     # Test disassembly more only for the current function.
     # Tests:
@@ -164,7 +164,7 @@ proc test_disassembly_mixed_with_opcodes {} {
     global fullname_syntax
 
     set line_callee2_head       [gdb_get_line_number "callee2 ("]
-    set line_callee2_open_brace [expr $line_callee2_head + 1]
+    set line_callee2_open_brace [expr {$line_callee2_head + 1}]
 
     # Test disassembly mixed with opcodes for the current function.
     # Tests:
@@ -192,8 +192,8 @@ proc test_disassembly_mixed_lines_limit {} {
     global fullname_syntax
 
     set line_main_head       [gdb_get_line_number "main ("]
-    set line_main_open_brace [expr $line_main_head + 1]
-    set line_main_body       [expr $line_main_head + 2]
+    set line_main_open_brace [expr {$line_main_head + 1}]
+    set line_main_body       [expr {$line_main_head + 2}]
 
     # Test disassembly more only for the current function.
     # Tests:
@@ -220,7 +220,7 @@ proc test_disassembly_bogus_args {} {
     global hex
 
     set line_main_head [gdb_get_line_number "main ("]
-    set line_main_body [expr $line_main_head + 2]
+    set line_main_body [expr {$line_main_head + 2}]
 
     # Test that bogus input to disassembly command is rejected.
     # Tests:
@@ -321,7 +321,7 @@ proc test_disassembly_opcode_format {} {
 
        # Load the actual byte value from memory, and check it matches
        # the opcode byte reported in the disassembler output.
-       set addr 0x[format %x [expr $longest_insn_addr + $idx]]
+       set addr 0x[format %x [expr {$longest_insn_addr + $idx}]]
        set actual [format %02x [mi_get_valueof "/x" "*((unsigned char *) $addr)" "XX"]]
        gdb_assert [string equal $actual "$b"] \
            "byte at $addr matches"
@@ -335,7 +335,7 @@ proc test_disassembly_opcode_format {} {
 
     # Figure out an end address at which to stop the disassembly.
     set byte_count [llength $split_bytes]
-    set end_addr 0x[format %x [expr $longest_insn_addr + $byte_count]]
+    set end_addr 0x[format %x [expr {$longest_insn_addr + $byte_count}]]
     set start_addr $longest_insn_addr
 
     verbose -log "Instruction is ${byte_count} bytes, end address ${end_addr}"
index 9d0b95a24cff79b15ac63d59101c8814f53841dd..5d2d5089d82231b2c8384ca35c11b8e78cc427db 100644 (file)
@@ -129,7 +129,7 @@ mi_continue_dprintf "gdb"
 # The "call" style depends on having I/O functions available, so test.
 set has_stderr_symbol [mi_gdb_is_stderr_available]
 
-if ![target_info exists gdb,noinferiorio] {
+if {![target_info exists gdb,noinferiorio]} {
 
     # Now switch styles and rerun; in the absence of redirection the
     # output should be the same.
@@ -165,7 +165,7 @@ gdb_expect {
     }
 }
 
-if $target_can_dprintf {
+if {$target_can_dprintf} {
     if {[mi_run_cmd] < 0} {
        # This likely means we failed to use target side commands in
        # combination with software breakpoints.  IOW, the target
@@ -174,7 +174,7 @@ if $target_can_dprintf {
        unsupported "send dprintf to target"
     }
 
-    if $target_can_dprintf {
+    if {$target_can_dprintf} {
        mi_expect_stop ".*" ".*" ".*" ".*" ".*" "" "mi expect stop"
 
        mi_send_resuming_command "exec-continue" "mi 1st dprintf continue, agent"
index 2b2189582df3373235b9ae058475968933162910..eafdf697e59e17b59a49d9fea9987066c8ed8eec 100644 (file)
@@ -37,10 +37,10 @@ if {[mi_clean_restart $::testfile]} {
 }
 
 set line_callee4_head [gdb_get_line_number "callee4 ("]
-set line_callee4_body [expr $line_callee4_head + 2]
+set line_callee4_body [expr {$line_callee4_head + 2}]
 
 mi_runto callee4
-mi_next_to "callee4" "" "basics.c" [expr $line_callee4_body + 1] "next at callee4"
+mi_next_to "callee4" "" "basics.c" [expr {$line_callee4_body + 1}] "next at callee4"
 
 mi_gdb_test "211-data-evaluate-expression A" "211\\^done,value=\"1\"" "eval A"
 
index 43406cf6ab4fc431ab490143b30aad3cf6497995..04283a13dcc830e5d28b31ed9e33326ffd532735 100644 (file)
@@ -59,7 +59,7 @@ proc test {inftty_mode mi_mode force_fail} {
        lappend start_ops "separate-mi-tty"
     }
 
-    if [mi_gdb_start $start_ops] {
+    if {[mi_gdb_start $start_ops]} {
        return
     }
 
index 68c9e34af17c828f582dd5a5e1bc59437034a265..9b039365d95ba364cdfdf6adb9f79225019ca7d6 100644 (file)
@@ -44,7 +44,7 @@ proc test_file_list_exec_source_file {} {
     # get the path and absolute path to the current executable
 
     set line_main_head [gdb_get_line_number "main ("]
-    set line_main_prologue [expr $line_main_head + 1]
+    set line_main_prologue [expr {$line_main_head + 1}]
     set line_default $line_main_prologue
 
     mi_gdb_test "111-file-list-exec-source-file" \
index ab7e03a87b062fae2cc67aa0b0105ce8c7eac1e5..bf0bcb1758fc92fac7deaab89a559731f40a49d0 100644 (file)
@@ -21,7 +21,7 @@ load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 standard_testfile "mi-read-memory"
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}.c" "${binfile}" executable {debug}] != "" } {
      untested "failed to compile"
      return -1
index 48391bc18c10f4842fd8193ddf811e0aefb1b466..9b5d71afa48c8e5997cfb384394dc0b50fd39a62 100644 (file)
@@ -100,7 +100,7 @@ gdb_test_multiple $cmd $test -prompt $mi_gdb_prompt$ {
        } else {
            fail $gdb_test_name
        }
-    }  
+    }
 }
 
 mi_gdb_test "105-symbol-info-module-functions --name _all" \
@@ -161,5 +161,5 @@ gdb_test_multiple $cmd $test -prompt $mi_gdb_prompt$ {
        } else {
            fail $gdb_test_name
        }
-    }  
+    }
 }
index 990abd5bd60fdfc5b9877b169c44d7bda6a7cb54..d34f244a39cc897fb33597dec08b1e2b01991a72 100644 (file)
@@ -80,7 +80,7 @@ proc_with_prefix do_floating_varobj_test {} {
        # Run to a breakpoint in each callee function in succession.
        # Note that we can't use mi_runto because we need the
        # breakpoint to be persistent, so we can use its address.
-       set bpnum [expr $i + 1]
+       set bpnum [expr {$i + 1}]
        mi_create_breakpoint \
            "basics.c:callee$i" \
            "insert breakpoint at basics.c:callee$i" \
@@ -101,7 +101,7 @@ proc_with_prefix do_floating_varobj_test {} {
        if {$bpaddr == ""} { return }
 
        # Check that the addresses are the same.
-       gdb_assert [expr $bpaddr == $pcval] "\$pc equals address of breakpoint in callee$i"
+       gdb_assert [expr {$bpaddr == $pcval}] "\$pc equals address of breakpoint in callee$i"
     }
 }
 
index c70dac6c6d6cf3d5532c4ae953b4adf46d0c675e..79307f32916f17c5c76bc7284979c7a89bcd5ce1 100644 (file)
@@ -27,8 +27,8 @@ require allow_xml_test
 
 standard_testfile basics.c
 
-if [build_executable "Failed to build $testfile" $testfile $srcfile \
-       debug] {
+if {[build_executable "Failed to build $testfile" $testfile $srcfile \
+        debug]} {
     return -1;
 }
 
index 82355913fafd66db976235f94170f1af556f8e1e..7fad225632a59f6337584ffd8e2c959e5a7069d6 100644 (file)
@@ -19,7 +19,7 @@ set MIFLAGS "-i=mi"
 standard_testfile basics.c
 set opts {debug}
 
-if [build_executable $testfile.exp $testfile $srcfile $opts] {
+if {[build_executable $testfile.exp $testfile $srcfile $opts]} {
     untested "failed to compile"
     return -1
 }
@@ -51,7 +51,7 @@ close $chan
 
 set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+"
 
-if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
+if {[regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent]} {
     pass "log file contents"
 } else {
     fail "log file contents"
@@ -74,7 +74,7 @@ set chan [open $milogfile]
 set logcontent [read $chan]
 close $chan
 
-if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
+if {[regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent]} {
     pass "redirect log file contents"
 } else {
     fail "redirect log file contents"
index 3bc63eb2747084855f34207c7d065c9a7cbcd77d..052d600daba312713c71f06ec9290669df7c5a1a 100644 (file)
@@ -38,7 +38,7 @@ proc run_test { args } {
     global mi_gdb_prompt
     global decimal
 
-    if [mi_clean_restart "" $args] {
+    if {[mi_clean_restart "" $args]} {
        return
     }
 
@@ -119,7 +119,7 @@ proc run_test { args } {
        # checking different command lengths.  The actual bug this
        # test checks for would result in a timeout, so we don't want
        # to risk lots more timeouts.
-       if { ! [expr $seen_first_message && $seen_second_message ] } {
+       if { ! ($seen_first_message && $seen_second_message) } {
            break
        }
     }
index 1ba37a3333135f4f98ba2a919b9e2c3bbebf68ec..07cf89918b2797e70ae9e202281ec51332ee948e 100644 (file)
@@ -63,7 +63,7 @@ mi_check_thread_states {"running" "stopped" "stopped"} "thread state, stop 1"
 mi_gdb_test "-thread-select 2" "\\^done.*" "select thread 2"
 mi_create_varobj I_W0 "i" "create varobj in first thread"
 mi_gdb_test "-thread-select 3" "\\^done.*" "select thread 3"
-mi_create_varobj I_W1 "i" "create varobj in second thread" 
+mi_create_varobj I_W1 "i" "create varobj in second thread"
 
 mi_nonstop_resume "exec-continue --thread 2" "resume 1"
 mi_check_thread_states {"running" "running" "stopped"} "thread state, resume 1"
@@ -95,7 +95,7 @@ mi_expect_stop "breakpoint-hit" "break_at_me" "\[^\n\]*" "non-stop.c" "\[0-9\]*"
 mi_expect_stop "breakpoint-hit" "break_at_me" ".*" "non-stop.c" ".*" {"" "disp=\"keep\""} "w1,i2 stop"
 
 # At this point, thread 1 (main) is running, and worker threads are stopped.
-# Check that we can modify breakpoint condition, even when operating on a 
+# Check that we can modify breakpoint condition, even when operating on a
 # running thread.
 mi_gdb_test "-break-condition --thread 1 2 id==1" "\\^done" "set condition, 1"
 
index eb0719cb07ef8c81ffd898c9c7ef092621a307f9..423167122645a8bce408630daa222619dca7fe36 100644 (file)
@@ -105,7 +105,7 @@ mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" \
 
 mi_send_resuming_command "exec-continue" "continuing execution to skip conditional bp"
 
-# We should not stop on the conditional breakpoint yet, but we stop on the original bp. 
+# We should not stop on the conditional breakpoint yet, but we stop on the original bp.
 mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" \
     { "" "disp=\"keep\"" } \
     "Run till MI pending breakpoint on pendfunc1 a second time"
index 117b2de69f3d326b5545ee3f35e971d5e649b5f7..13ea6ba58a55218c248c461f4e771db1836abf6a 100644 (file)
@@ -28,7 +28,7 @@ proc check_mi_thread_command_set {} {
   mi_runto done_making_threads
 
   set thread_list [get_mi_thread_list "in check_mi_thread_command_set"]
-  
+
   mi_gdb_test "-thread-select" \
     {\^error,msg="-thread-select: USAGE: threadnum."} \
     "check_mi_thread_command_set: -thread-select"
index ef102ceee03fc82f92ddf3dfbf15e9d356c5f1c7..d3ca0bcd614e25eef285166442685803acb9052c 100644 (file)
@@ -33,7 +33,7 @@ if {[mi_clean_restart $::testfile]} {
     return
 }
 
-if ![mi_runto stop_frame] {
+if {![mi_runto stop_frame]} {
     perror "Failed to stop in stop_frame"
     return -1
 }
index 998a1ffbe27804820acf268e0fb03e986a421f0e..665be990e0cd5fdb385ebae36232d3fe18286a97 100644 (file)
@@ -40,8 +40,8 @@ proc test_return_simple {} {
     global hex fullname_syntax srcfile
 
     set line_callee3_head         [gdb_get_line_number "callee3 ("]
-    set line_callee3_call         [expr $line_callee3_head + 2]
-    set line_callee3_close_brace  [expr $line_callee3_head + 3]
+    set line_callee3_call         [expr {$line_callee3_head + 2}]
+    set line_callee3_close_brace  [expr {$line_callee3_head + 3}]
 
     mi_gdb_test "111-exec-return" "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"($line_callee3_call|$line_callee3_close_brace)\",arch=\"\[^\"\]+\"\}" "return from callee4 now"
 }
index aa252553739539a7ec349afd72e47d081e8afe32..5f6eb3fbf72de5229b718a3dcdca08fe3dfc141f 100644 (file)
@@ -42,11 +42,11 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 mi_clean_restart $::testfile
 mi_runto_main
 
-if [supports_process_record] {
+if {[supports_process_record]} {
     # Activate process record/replay
-    if [mi_gdb_test "-interpreter-exec console record" \
-           "=record-started,thread-group=\"i1\",method=\"full\"\r\n\\^done" \
-           "Turn on process record"] {
+    if {[mi_gdb_test "-interpreter-exec console record" \
+            "=record-started,thread-group=\"i1\",method=\"full\"\r\n\\^done" \
+            "Turn on process record"]} {
        warning "Fail to activate process record/replay, tests in this group will not be performed.\n"
        return -1
     }
@@ -54,20 +54,20 @@ if [supports_process_record] {
 
 # Locate line numbers in basics.c.
 set line_callee4_head  [gdb_get_line_number "callee4 ("]
-set line_callee4_body  [expr $line_callee4_head + 2]
+set line_callee4_body  [expr {$line_callee4_head + 2}]
 set line_callee3_head  [gdb_get_line_number "callee3 ("]
-set line_callee3_body  [expr $line_callee3_head + 2]
-set line_callee3_close [expr $line_callee3_head + 3]
+set line_callee3_body  [expr {$line_callee3_head + 2}]
+set line_callee3_close [expr {$line_callee3_head + 3}]
 set line_callee2_head  [gdb_get_line_number "callee2 ("]
-set line_callee2_body  [expr $line_callee2_head + 2]
-set line_callee2_close [expr $line_callee2_head + 3]
+set line_callee2_body  [expr {$line_callee2_head + 2}]
+set line_callee2_close [expr {$line_callee2_head + 3}]
 set line_callee1_head  [gdb_get_line_number "callee1 ("]
-set line_callee1_body  [expr $line_callee1_head + 2]
-set line_callee1_close [expr $line_callee1_head + 3]
+set line_callee1_body  [expr {$line_callee1_head + 2}]
+set line_callee1_close [expr {$line_callee1_head + 3}]
 set line_callme_head   [gdb_get_line_number "callme"]
-set line_callme_body   [expr $line_callme_head + 2]
+set line_callme_body   [expr {$line_callme_head + 2}]
 set line_main_head     [gdb_get_line_number "main ("]
-set line_main_body     [expr $line_main_head + 2]
+set line_main_body     [expr {$line_main_head + 2}]
 set line_main_hello    [gdb_get_line_number "Hello, World!"]
 set line_main_callme_1 [gdb_get_line_number "callme (1"]
 
index 5ee7881783a54f39113ba669e8543c159024f0e2..b34097ef66979b392be5ef5bf42cd9f1be401ce9 100644 (file)
@@ -42,13 +42,13 @@ proc test_breakpoints_creation_and_listing {} {
     global srcfile
 
     set line_callee4_head  [gdb_get_line_number "callee4 ("]
-    set line_callee4_body  [expr $line_callee4_head + 2]
+    set line_callee4_body  [expr {$line_callee4_head + 2}]
     set line_callee3_head  [gdb_get_line_number "callee3 ("]
-    set line_callee3_body  [expr $line_callee3_head + 2]
+    set line_callee3_body  [expr {$line_callee3_head + 2}]
     set line_callee2_head  [gdb_get_line_number "callee2 ("]
-    set line_callee2_body  [expr $line_callee2_head + 2]
+    set line_callee2_body  [expr {$line_callee2_head + 2}]
     set line_main_head     [gdb_get_line_number "main ("]
-    set line_main_body     [expr $line_main_head + 2]
+    set line_main_body     [expr {$line_main_head + 2}]
 
     # Insert some breakpoints and list them
     # Also, disable some so they do not interfere with other tests
@@ -96,7 +96,7 @@ proc test_breakpoints_creation_and_listing {} {
 
 proc test_running_the_program {} {
     set line_main_head     [gdb_get_line_number "main ("]
-    set line_main_body     [expr $line_main_head + 2]
+    set line_main_body     [expr {$line_main_head + 2}]
 
     # Run the program without args, then specify srgs and rerun the program
     # Tests:
@@ -115,14 +115,14 @@ proc test_controlled_execution {} {
     global hex
 
     set line_callee4_head         [gdb_get_line_number "callee4 ("]
-    set line_callee4_body         [expr $line_callee4_head + 2]
+    set line_callee4_body         [expr {$line_callee4_head + 2}]
     set line_callee3_head         [gdb_get_line_number "callee3 ("]
-    set line_callee3_call         [expr $line_callee3_head + 2]
-    set line_callee3_close_brace  [expr $line_callee3_head + 3]
+    set line_callee3_call         [expr {$line_callee3_head + 2}]
+    set line_callee3_close_brace  [expr {$line_callee3_head + 3}]
     set line_callee1_head         [gdb_get_line_number "callee1 ("]
-    set line_callee1_body         [expr $line_callee1_head + 2]
+    set line_callee1_body         [expr {$line_callee1_head + 2}]
     set line_main_head            [gdb_get_line_number "main ("]
-    set line_main_body            [expr $line_main_head + 2]
+    set line_main_body            [expr {$line_main_head + 2}]
 
     # Continue execution until a breakpoint is reached, step into calls, verifying
     # if the arguments are correctly shown, continue to the end of a called
@@ -133,7 +133,7 @@ proc test_controlled_execution {} {
     # -exec-step
     # -exec-finish
 
-    mi_next_to "main" "" "basics.c" [expr $line_main_body + 1] "next at main"
+    mi_next_to "main" "" "basics.c" [expr {$line_main_body + 1}] "next at main"
 
     # FIXME: A string argument is not printed right; should be fixed and
     #        we should look for the right thing here.
index 89f58c8d83b75fa44d6b12980b490dc0fb5066f7..ebd685f4945697b809737c978259b5a9778a72d6 100644 (file)
@@ -87,7 +87,7 @@ proc test_stack_args_listing {} {
     # -stack-list-arguments 1
     # -stack-list-arguments 1 1 1
     # -stack-list-arguments 1 1 3
-    # -stack-list-arguments 
+    # -stack-list-arguments
     # -stack-list-arguments 1 1 300
     # -stack-list-arguments 2 1 1
     # -stack-list-arguments --simple-values 1 1
index 7f53c8b465e395844769ab4269a666f80ce9b7e6..f2871dca2564e479ce1edfa991b449326fd2b8b3 100644 (file)
@@ -35,7 +35,7 @@ proc test_stepi_nexti {} {
     global hex fullname_syntax srcfile
 
     set line_main_head  [gdb_get_line_number "main ("]
-    set line_main_body  [expr $line_main_head + 2]
+    set line_main_body  [expr {$line_main_head + 2}]
     set line_main_hello [gdb_get_line_number "Hello, World!"]
 
     set line [mi_execute_to "exec-step-instruction" "end-stepping-range" "main" "" \
@@ -44,7 +44,7 @@ proc test_stepi_nexti {} {
                pass "step-instruction at main, line check"
     } else {
        fail "step-instruction at main, line check"
-    }    
+    }
 
     set line [mi_execute_to "exec-next-instruction" "end-stepping-range" "main" "" \
                   ".*basics.c" "\[0-9\]+" "" "next-instruction at main"]
index f11e9c0882cdf6eed5b92bb4d9e9ebddfe46044a..85b2092c86b422141ad82c8a022c8ca05057085f 100644 (file)
@@ -22,7 +22,7 @@ set MIFLAGS "-i=mi"
 standard_testfile
 
 set opts {debug}
-if [build_executable ${testfile}.exp ${testfile} ${srcfile} $opts] {
+if {[build_executable ${testfile}.exp ${testfile} ${srcfile} $opts]} {
     return -1
 }
 
index b3ec3777e1e2e311c2491f6aa8b06e12b98aebdb..11e208d85051ed392be1d75ced615ad16a9e6d5f 100644 (file)
@@ -91,7 +91,7 @@ mi_gdb_test "409-stack-list-frames 0 0" \
 
 #
 # Call bar() by hand, which should get an exception while running.
-# 
+#
 
 mi_gdb_test "410-data-evaluate-expression bar()" \
   ".*410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwind-on-signal on\\\\\".\\\\nEvaluation of the expression containing the function\\\\n\\(bar\\) will be abandoned.\\\\nWhen the function is done executing, GDB will silently stop.\"" \
index 976b68d13f4466170167258250b59717c01a10f3..e07767c4a38907cf4727b99ade53bfd54f221b35 100644 (file)
@@ -24,9 +24,9 @@ set MIFLAGS "-i=mi"
 
 # We need to do things a little differently when using the remote protocol.
 set is_remote \
-    [expr [target_info exists gdb_protocol] \
-        && ([string equal [target_info gdb_protocol] "remote"] \
-            || [string equal [target_info gdb_protocol] "extended-remote"])]
+    [expr {[target_info exists gdb_protocol] \
+              && ([string equal [target_info gdb_protocol] "remote"] \
+                      || [string equal [target_info gdb_protocol] "extended-remote"])}]
 
 standard_testfile
 
index 81ff27413418d07c287cdc525519b4d209bdca11..c8543f41c36b53a124b77aef74e3b3d4f3a1627e 100644 (file)
@@ -25,7 +25,7 @@ if {[mi_clean_restart]} {
 
 standard_testfile
 
-if [build_executable ${testfile}.exp ${binfile} ${srcfile}] {
+if {[build_executable ${testfile}.exp ${binfile} ${srcfile}]} {
     return -1
 }
 
index e8f24bc7dfe904b8e9c90b56c2b71438523df5b1..b027c769a6bcf9abc6e54f9cf598102b274c6c0f 100644 (file)
@@ -67,7 +67,7 @@ proc test_until {} {
     # after foo is over.
     set line [gdb_get_line_number "at-return"]
     mi_execute_to "exec-until until.c:$line" "location-reached" "main" ""\
-       ".*until.c" "([expr $line-2]|[expr $line-1])" ""\
+       ".*until.c" "([expr {$line-2}]|[expr {$line-1}])" ""\
         "until after current function"
 }
 
index 4a3ba076db7d22cd3c1ed2b1e8b6d9a698c309bb..c69b72a374ecff89003e2b09272a39b7f39dc8bb 100644 (file)
@@ -667,7 +667,7 @@ mi_varobj_update * {} "update all vars. None changed"
 
 # Step over "struct_declarations.integer = 123;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_123 + 1] "step \$line_dct_123 + 1"
+    [expr {$line_dct_123 + 1}] "step \$line_dct_123 + 1"
 
 # Test: c_variable-5.2
 # Desc: check that integer changed
@@ -679,7 +679,7 @@ mi_varobj_update * {struct_declarations.integer} \
 #    bar = 2121;
 #    foo = &bar;
 mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_123 + 4] {} "step \$line_dct_123 + 4"
+    [expr {$line_dct_123 + 4}] {} "step \$line_dct_123 + 4"
 
 # Test: c_variable-5.3
 # Desc: check that char_ptr changed
@@ -688,7 +688,7 @@ mi_varobj_update * {struct_declarations.char_ptr struct_declarations.char_ptr.\\
 
 # Step over "struct_declarations.int_ptr_ptr = &foo;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_123 + 5] "step \$line_dct_123 + 5"
+    [expr {$line_dct_123 + 5}] "step \$line_dct_123 + 5"
 
 # Test: c_variable-5.4
 # Desc: check that int_ptr_ptr and children changed
@@ -702,7 +702,7 @@ mi_varobj_update * {weird->int_ptr_ptr
 
 # Step over "weird->long_array[0] = 1234;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_123 + 6] "step \$line_dct_123 + 6"
+    [expr {$line_dct_123 + 6}] "step \$line_dct_123 + 6"
 
 # Test: c_variable-5.5
 # Desc: check that long_array[0] changed
@@ -711,7 +711,7 @@ mi_varobj_update * {struct_declarations.long_array.0} \
 
 # Step over "struct_declarations.long_array[1] = 2345;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_123 + 7] "step \$line_dct_123 + 7"
+    [expr {$line_dct_123 + 7}] "step \$line_dct_123 + 7"
 
 # Test: c_variable-5.6
 # Desc: check that long_array[1] changed
@@ -720,7 +720,7 @@ mi_varobj_update * {struct_declarations.long_array.1} \
 
 # Step over "weird->long_array[2] = 3456;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_123 + 8] "step \$line_dct_123 + 8"
+    [expr {$line_dct_123 + 8}] "step \$line_dct_123 + 8"
 
 # Test: c_variable-5.7
 # Desc: check that long_array[2] changed
@@ -754,7 +754,7 @@ mi_varobj_update * {struct_declarations.long_array.3
 
 # Step over "weird->func_ptr = nothing";
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_nothing + 1] "step \$line_dct_nothing + 1"
+    [expr {$line_dct_nothing + 1}] "step \$line_dct_nothing + 1"
 
 # Test: c_variable-5.9
 # Desc: check that func_ptr changed
@@ -763,19 +763,19 @@ mi_varobj_update * {struct_declarations.func_ptr} \
 
 # Step over "weird->func_ptr_struct = nothing1"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_nothing + 2] "step \$line_dct_nothing + 2"
+    [expr {$line_dct_nothing + 2}] "step \$line_dct_nothing + 2"
 mi_varobj_update * {struct_declarations.func_ptr_struct} \
     "update all vars struct_declarations.func_ptr_struct changed"
 
 # Step over "weird->func_ptr_ptr = nothing2"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_nothing + 3] "step \$line_dct_nothing + 3"
+    [expr {$line_dct_nothing + 3}] "step \$line_dct_nothing + 3"
 mi_varobj_update * {struct_declarations.func_ptr_ptr} \
     "update all vars struct_declarations.func_ptr_ptr changed"
 
 # Step over "struct_declarations.long_array[10] = 3456";
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_nothing + 4] "step \$line_dct_nothing + 4"
+    [expr {$line_dct_nothing + 4}] "step \$line_dct_nothing + 4"
 
 mi_gdb_test "-var-update --no-values *" \
        "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.10\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \
@@ -837,7 +837,7 @@ mi_gdb_test "-var-delete weird->int_ptr_ptr" \
 
 set line_dct_snp0 [gdb_get_line_number "psnp = &snp0;"]
 mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_snp0 + 1] {} "step \$line_dct_snp0 + 1"
+    [expr {$line_dct_snp0 + 1}] {} "step \$line_dct_snp0 + 1"
 
 # Test: c_variable-5.10
 # Desc: create psnp->char_ptr
@@ -987,7 +987,7 @@ mi_create_varobj "psnp->ptrs" "psnp->ptrs" \
 
 # Test: c_variable-5.31
 # Desc: children of psnp->ptrs
-mi_list_varobj_children "psnp->ptrs" {    
+mi_list_varobj_children "psnp->ptrs" {
     {psnp->ptrs.0 0 4 {struct _struct_n_pointer \*}}
     {psnp->ptrs.1 1 4 {struct _struct_n_pointer \*}}
     {psnp->ptrs.2 2 4 {struct _struct_n_pointer \*}}
@@ -1123,7 +1123,7 @@ mi_list_varobj_children "psnp->ptrs.0.next.next.ptrs" {
 
 #  Step over "snp0.char_ptr = &b3;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_snp0 + 2] "step \$line_dct_snp0 + 2"
+    [expr {$line_dct_snp0 + 2}] "step \$line_dct_snp0 + 2"
 
 # Test: c_variable-5.47
 # Desc: check that psnp->char_ptr (and [0].char_ptr) changed
@@ -1136,7 +1136,7 @@ mi_varobj_update * {psnp->ptrs.0.char_ptr
 
 #  Step over "snp1.char_ptr = &c3;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_snp0 + 3] "step \$line_dct_snp0 + 3"
+    [expr {$line_dct_snp0 + 3}] "step \$line_dct_snp0 + 3"
 
 # Test: c_variable-5.48
 # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
@@ -1150,7 +1150,7 @@ mi_varobj_update * {psnp->ptrs.0.next.char_ptr
 
 #  Step over "snp2.char_ptr = &a3;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_snp0 + 4] "step \$line_dct_snp0 + 4"
+    [expr {$line_dct_snp0 + 4}] "step \$line_dct_snp0 + 4"
 
 # Test: c_variable-5.49
 # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
@@ -1160,7 +1160,7 @@ mi_varobj_update * {psnp->ptrs.0.next.next.char_ptr} \
 
 #  Step over "snp0.long_ptr = &y3;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_snp0 + 5] "step \$line_dct_snp0 + 5"
+    [expr {$line_dct_snp0 + 5}] "step \$line_dct_snp0 + 5"
 
 # Test: c_variable-5.50
 # Desc: check that psnp->long_ptr (and [0].long_ptr) changed
@@ -1174,7 +1174,7 @@ mi_varobj_update * {psnp->ptrs.0.long_ptr psnp->long_ptr
 
 #  Step over "snp1.long_ptr = &x3;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_snp0 + 6] "step \$line_dct_snp0 + 6"
+    [expr {$line_dct_snp0 + 6}] "step \$line_dct_snp0 + 6"
 
 # Test: c_variable-5.51
 # Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
@@ -1191,7 +1191,7 @@ clear_xfail *-*-*
 
 #  Step over "snp2.long_ptr = &z3;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_snp0 + 7] "step \$line_dct_snp0 + 7"
+    [expr {$line_dct_snp0 + 7}] "step \$line_dct_snp0 + 7"
 
 # Test: c_variable-5.52
 # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed
index 9e7b14c041d83d75625fe67fbe6f9aeb20a984e2..850cb995cdb8c5aa94676e690227b2f2b55479f9 100644 (file)
@@ -150,7 +150,7 @@ mi_gdb_test "-var-update *" \
        "update all vars: linteger changed"
 
 # Step over "lpinteger = &linteger;"
-mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 1] "step at do_locals_tests, 2"
+mi_step_to "do_locals_tests" "" "var-cmd.c" [expr {$line_dlt_linteger + 1}] "step at do_locals_tests, 2"
 
 # Test: c_variable-2.3
 # Desc: check whether only lpinteger changed
@@ -159,7 +159,7 @@ mi_gdb_test "-var-update *" \
        "update all vars: lpinteger changed"
 
 # Step over "lcharacter = 'a';"
-mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 2] "step at do_locals_tests, 3"
+mi_step_to "do_locals_tests" "" "var-cmd.c" [expr {$line_dlt_linteger + 2}] "step at do_locals_tests, 3"
 
 # Test: c_variable-2.4
 # Desc: check whether only lcharacter changed
@@ -168,7 +168,7 @@ mi_gdb_test "-var-update *" \
        "update all vars: lcharacter changed"
 
 # Step over "lpcharacter = &lcharacter;"
-mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 3] "step at do_locals_tests, 4"
+mi_step_to "do_locals_tests" "" "var-cmd.c" [expr {$line_dlt_linteger + 3}] "step at do_locals_tests, 4"
 
 # Test: c_variable-2.5
 # Desc: check whether only lpcharacter changed
@@ -189,7 +189,7 @@ mi_gdb_test "-var-update *" \
 #  lsimple.character = 'a';
 
 mi_execute_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \
-       "var-cmd.c" [expr $line_dlt_linteger + 12] "" "step at do_locals_tests, 5"
+       "var-cmd.c" [expr {$line_dlt_linteger + 12}] "" "step at do_locals_tests, 5"
 
 # Test: c_variable-2.6
 # Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer,
@@ -226,7 +226,7 @@ mi_gdb_test "-var-update *" \
 #  lsimple.character = 'b';
 
 mi_execute_to "exec-step 8" "end-stepping-range" "do_locals_tests" "" \
-       "var-cmd.c" [expr $line_dlt_4321 + 8] "" "step at do_locals_tests, 7"
+       "var-cmd.c" [expr {$line_dlt_4321 + 8}] "" "step at do_locals_tests, 7"
 
 # Test: c_variable-2.8
 # Desc: check whether linteger, lcharacter, llong, lfoat, ldouble, lsimple.integer,
@@ -238,7 +238,7 @@ mi_gdb_test "-var-update *" \
        "update all vars: lsimple and others changed"
 
 
-### 
+###
 #
 # Test assignment to variables. More tests on assignment are in other files.
 #
@@ -366,7 +366,7 @@ mi_gdb_test "-var-update *" \
 
 # Check that assignment of function and array values
 # promotes the assigned value to function pointer/data
-# pointer before comparing with the existing value, 
+# pointer before comparing with the existing value,
 # and does not incorrectly make the value as changed.
 mi_gdb_test "-var-assign func do_block_tests" \
        "\\^done,value=\"$hex <do_block_tests>\"" \
@@ -398,7 +398,7 @@ mi_gdb_test "-var-update *" \
 
 
 ######
-# End of assign tests 
+# End of assign tests
 #####
 
 set line_subroutine1_body [gdb_get_line_number "global_simple.integer = i + 3;"]
@@ -418,7 +418,7 @@ mi_gdb_test "-var-create linteger * linteger" \
        "create linteger"
 
 mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
-       "var-cmd.c" [expr $line_subroutine1_body + 1] "step at subroutine1"
+       "var-cmd.c" [expr {$line_subroutine1_body + 1}] "step at subroutine1"
 
 # Test: c_variable-2.12
 # Desc: change global_simple.integer
@@ -434,7 +434,7 @@ mi_gdb_test "-var-update *" \
 clear_xfail *-*-*
 
 mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
-       "var-cmd.c" [expr $line_subroutine1_body + 2] "step at subroutine1, 2"
+       "var-cmd.c" [expr {$line_subroutine1_body + 2}] "step at subroutine1, 2"
 
 # Test: c_variable-2.13
 # Desc: change subroutine1 local i
@@ -443,7 +443,7 @@ mi_gdb_test "-var-update *" \
        "update all vars: i changed"
 
 mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
-       "var-cmd.c" [expr $line_subroutine1_body + 3] "step at subroutine1, 3"
+       "var-cmd.c" [expr {$line_subroutine1_body + 3}] "step at subroutine1, 3"
 
 # Test: c_variable-2.14
 # Desc: change do_locals_tests local llong
@@ -453,7 +453,7 @@ mi_gdb_test "-var-update *" \
 
 set line_dlt_call_subroutine1 [gdb_get_line_number "subroutine1 (linteger, &llong);"]
 mi_next_to "do_locals_tests" ""        "var-cmd.c" \
-  [expr $line_dlt_call_subroutine1 + 1] "next out of subroutine1"
+  [expr {$line_dlt_call_subroutine1 + 1}] "next out of subroutine1"
 
 # Test: c_variable-2.15
 # Desc: check for out of scope subroutine1 locals
@@ -560,7 +560,7 @@ mi_gdb_test "-var-update selected_a" \
        "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"int\",new_num_children=\"0\",has_more=\"0\"\}\\\]" \
        "update selected_a in do_special_tests"
 
-if [is_remote host] {
+if {[is_remote host]} {
     set filename ${testfile}
 } else {
     set filename ${binfile}
index 517449cbe44cef6f5c984d1c0d648b38264ef3bc..371d430b838993171bbd647281d6fa823e0d8301 100644 (file)
@@ -19,7 +19,7 @@ set MIFLAGS "-i=mi"
 standard_testfile .c
 set opts {debug}
 
-if [build_executable $testfile.exp $testfile $srcfile $opts] {
+if {[build_executable $testfile.exp $testfile $srcfile $opts]} {
     return -1
 }
 
index 3ae593bf4eda1fc80878ed5d6122b07d84f3db17..52a527634451a3ddc5aa0bc7cf29096a0e8d7b32 100644 (file)
@@ -624,8 +624,8 @@ mi_gdb_test "-var-list-children anone" \
 
 
 # Record fp
-if ![mi_gdb_test "p/x \$fp" ".*($hex).*\\^done" "print FP register"] {
-    set fp $expect_out(3,string) 
+if {![mi_gdb_test "p/x \$fp" ".*($hex).*\\^done" "print FP register"]} {
+    set fp $expect_out(3,string)
 }
 
 mi_continue_to "incr_a"
index c2768b6b7cf38ac481fef27729244165bd7f714e..2482df7c403bf077bfb1106406973d2d97cf3587 100644 (file)
@@ -21,7 +21,7 @@ set MIFLAGS "-i=mi"
 standard_testfile .cc
 set opts {debug c++}
 
-if [build_executable $testfile.exp $testfile $srcfile $opts] {
+if {[build_executable $testfile.exp $testfile $srcfile $opts]} {
     return -1
 }
 
index 43f23786aa20aefc1d41b6c65b5d21c2e63dd870..1ddd94eff2053679ee950f6156705d5522055b4a 100644 (file)
@@ -44,7 +44,7 @@ proc test_watchpoint_creation_and_listing {} {
     global hex
 
     set line_callee4_head [gdb_get_line_number "callee4 ("]
-    set line_callee4_body [expr $line_callee4_head + 2]
+    set line_callee4_body [expr {$line_callee4_head + 2}]
 
     # Insert a watchpoint and list
     # Tests:
@@ -68,7 +68,7 @@ proc test_awatch_creation_and_listing {} {
     global hex
 
     set line_main_head [gdb_get_line_number "main ("]
-    set line_main_body [expr $line_main_head + 2]
+    set line_main_body [expr {$line_main_head + 2}]
 
     # Insert an access watchpoint and list it
     # Tests:
@@ -95,7 +95,7 @@ proc test_rwatch_creation_and_listing {} {
     global hex
 
     set line_main_head [gdb_get_line_number "main ("]
-    set line_main_body [expr $line_main_head + 2]
+    set line_main_body [expr {$line_main_head + 2}]
 
     # Insert a read watchpoint and list it.
     # Tests:
@@ -121,9 +121,9 @@ proc test_watchpoint_triggering {} {
 
     set line_callee4_return_0     [gdb_get_line_number "return 0;"]
     set line_callee3_head         [gdb_get_line_number "callee3 ("]
-    set line_callee3_close_brace  [expr $line_callee3_head + 3]
+    set line_callee3_close_brace  [expr {$line_callee3_head + 3}]
 
-    # Continue execution until the watchpoint is reached,  continue again, 
+    # Continue execution until the watchpoint is reached,  continue again,
     # to see the watchpoint go out of scope.
     # Does:
     # -exec-continue (Here wp triggers)
@@ -155,7 +155,7 @@ proc test_watchpoint_all {mi_mode type} {
     } else {
        set start_ops ""
     }
-    if [mi_clean_restart ${::testfile} $start_ops] {
+    if {[mi_clean_restart ${::testfile} $start_ops]} {
        return
     }
 
index 0d51dc5b8677466aab96c8a29827e0cf27390e87..4b1d440b86844b42ee499a493316387d9ce71ca0 100644 (file)
@@ -19,7 +19,7 @@ set MIFLAGS "-i=mi2"
 standard_testfile .s
 set opts {}
 
-if [info exists COMPILE] {
+if {[info exists COMPILE]} {
     # make check RUNTESTFLAGS="gdb.mi/mi2-amd64-entry-value.exp COMPILE=1"
     set srcfile ${testfile}.c
     lappend opts debug optimize=-O2
@@ -27,7 +27,7 @@ if [info exists COMPILE] {
     require is_x86_64_m64_target
 }
 
-if [build_executable ${testfile}.exp ${binfile} ${srcfile} $opts] {
+if {[build_executable ${testfile}.exp ${binfile} ${srcfile} $opts]} {
     return -1
 }
 
index 3618d5a756c1c96e58baf499c1ae743fbd37ead6..4ee19f04641b7c2ea64b2997447ec9fd30b7af70 100644 (file)
@@ -667,7 +667,7 @@ mi_varobj_update * {} "update all vars. None changed"
 
 # Step over "struct_declarations.integer = 123;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_123 + 1] "step \$line_dct_123 + 1"
+    [expr {$line_dct_123 + 1}] "step \$line_dct_123 + 1"
 
 # Test: c_variable-5.2
 # Desc: check that integer changed
@@ -679,7 +679,7 @@ mi_varobj_update * {struct_declarations.integer} \
 #    bar = 2121;
 #    foo = &bar;
 mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_123 + 4] {} "step \$line_dct_123 + 4"
+    [expr {$line_dct_123 + 4}] {} "step \$line_dct_123 + 4"
 
 # Test: c_variable-5.3
 # Desc: check that char_ptr changed
@@ -689,7 +689,7 @@ mi_varobj_update * {struct_declarations.char_ptr
 
 # Step over "struct_declarations.int_ptr_ptr = &foo;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_123 + 5] "step \$line_dct_123 + 5"
+    [expr {$line_dct_123 + 5}] "step \$line_dct_123 + 5"
 
 # Test: c_variable-5.4
 # Desc: check that int_ptr_ptr and children changed
@@ -703,7 +703,7 @@ mi_varobj_update * {weird->int_ptr_ptr
 
 # Step over "weird->long_array[0] = 1234;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_123 + 6] "step \$line_dct_123 + 6"
+    [expr {$line_dct_123 + 6}] "step \$line_dct_123 + 6"
 
 # Test: c_variable-5.5
 # Desc: check that long_array[0] changed
@@ -712,7 +712,7 @@ mi_varobj_update * {struct_declarations.long_array.0} \
 
 # Step over "struct_declarations.long_array[1] = 2345;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_123 + 7] "step \$line_dct_123 + 7"
+    [expr {$line_dct_123 + 7}] "step \$line_dct_123 + 7"
 
 # Test: c_variable-5.6
 # Desc: check that long_array[1] changed
@@ -721,7 +721,7 @@ mi_varobj_update * {struct_declarations.long_array.1} \
 
 # Step over "weird->long_array[2] = 3456;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_123 + 8] "step \$line_dct_123 + 8"
+    [expr {$line_dct_123 + 8}] "step \$line_dct_123 + 8"
 
 # Test: c_variable-5.7
 # Desc: check that long_array[2] changed
@@ -755,7 +755,7 @@ mi_varobj_update * {struct_declarations.long_array.3
 
 # Step over "weird->func_ptr = nothing;"
 mi_step_to do_children_tests {} ".*${srcfile}" \
-    [expr $line_dct_nothing + 1] "step \$line_dct_nothing + 1"
+    [expr {$line_dct_nothing + 1}] "step \$line_dct_nothing + 1"
 
 # Test: c_variable-5.9
 # Desc: check that func_ptr changed
@@ -777,7 +777,7 @@ mi_gdb_test "-var-delete weird->int_ptr_ptr" \
 
 set line_dct_snp0 [gdb_get_line_number "psnp = &snp0;"]
 mi_execute_to "exec-step 45" "end-stepping-range" do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_snp0 + 1] {} "step \$line_dct_snp0 + 1"
+    [expr {$line_dct_snp0 + 1}] {} "step \$line_dct_snp0 + 1"
 
 # Test: c_variable-5.10
 # Desc: create psnp->char_ptr
@@ -928,7 +928,7 @@ mi_create_varobj "psnp->ptrs" "psnp->ptrs" \
 
 # Test: c_variable-5.31
 # Desc: children of psnp->ptrs
-mi_list_varobj_children "psnp->ptrs" {    
+mi_list_varobj_children "psnp->ptrs" {
     {psnp->ptrs.0 0 4 {struct _struct_n_pointer \*}}
     {psnp->ptrs.1 1 4 {struct _struct_n_pointer \*}}
     {psnp->ptrs.2 2 4 {struct _struct_n_pointer \*}}
@@ -1065,7 +1065,7 @@ mi_list_varobj_children "psnp->ptrs.0.next.next.ptrs" {
 
 #  Step over "snp0.char_ptr = &b3;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_snp0 + 2] "step \$line_dct_snp0 + 2"
+    [expr {$line_dct_snp0 + 2}] "step \$line_dct_snp0 + 2"
 
 # Test: c_variable-5.47
 # Desc: check that psnp->char_ptr (and [0].char_ptr) changed
@@ -1078,7 +1078,7 @@ mi_varobj_update * {psnp->ptrs.0.char_ptr
 
 #  Step over "snp1.char_ptr = &c3;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_snp0 + 3] "step \$line_dct_snp0 + 3"
+    [expr {$line_dct_snp0 + 3}] "step \$line_dct_snp0 + 3"
 
 # Test: c_variable-5.48
 # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
@@ -1092,7 +1092,7 @@ mi_varobj_update * {psnp->ptrs.0.next.char_ptr
 
 #  Step over "snp2.char_ptr = &a3;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_snp0 + 4] "step \$line_dct_snp0 + 4"
+    [expr {$line_dct_snp0 + 4}] "step \$line_dct_snp0 + 4"
 
 # Test: c_variable-5.49
 # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
@@ -1102,7 +1102,7 @@ mi_varobj_update * {psnp->ptrs.0.next.next.char_ptr} \
 
 #  Step over "snp0.long_ptr = &y3;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_snp0 + 5] "step \$line_dct_snp0 + 5"
+    [expr {$line_dct_snp0 + 5}] "step \$line_dct_snp0 + 5"
 
 # Test: c_variable-5.50
 # Desc: check that psnp->long_ptr (and [0].long_ptr) changed
@@ -1116,7 +1116,7 @@ mi_varobj_update * {psnp->ptrs.0.long_ptr psnp->long_ptr
 
 #  Step over "snp1.long_ptr = &x3;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_snp0 + 6] "step \$line_dct_snp0 + 6"
+    [expr {$line_dct_snp0 + 6}] "step \$line_dct_snp0 + 6"
 
 # Test: c_variable-5.51
 # Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
@@ -1133,7 +1133,7 @@ clear_xfail *-*-*
 
 #  Step over "snp2.long_ptr = &z3;"
 mi_step_to do_children_tests {} {.*var-cmd.c} \
-    [expr $line_dct_snp0 + 7] "step \$line_dct_snp0 + 7"
+    [expr {$line_dct_snp0 + 7}] "step \$line_dct_snp0 + 7"
 
 # Test: c_variable-5.52
 # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed
index aa18668a6f05d5482954e22c39fb645655a3792e..b5b748ef069feff2ee9a8d32ec713e5cf9e27291 100644 (file)
@@ -51,7 +51,7 @@ foreach_mi_ui_mode mode {
        set start_ops ""
     }
 
-    if [mi_gdb_start $start_ops] {
+    if {[mi_gdb_start $start_ops]} {
        return
     }
 
index 23488e35e9e7331a85221bb75700d84e791ea33e..023f87c1c3c841c58c37ac8918f991e8181d0828 100644 (file)
@@ -30,11 +30,11 @@ lappend opts debug
 lappend opts c++
 lappend opts additional_flags=-std=c++11
 
-if [build_executable "failed to prepare" $testfile $srcfile $opts] {
+if {[build_executable "failed to prepare" $testfile $srcfile $opts]} {
     return -1
 }
 
-if [mi_clean_restart $::testfile] {
+if {[mi_clean_restart $::testfile]} {
     return
 }
 
index a0bf11f2f2214991e0d063285d25cf3bddd4f320..c954057e90c4ce22e5b0dc2e97c92981750bdcc0 100644 (file)
@@ -113,7 +113,7 @@ proc make_cli_re { mode inf thread frame } {
        }
        set thread_re $all_stop_thread_re
 
-       if [thread_is_running $mode $thread] {
+       if {[thread_is_running $mode $thread]} {
            set thread_re "$thread_re\\\(running\\\)"
        }