From: Tom de Vries Date: Tue, 30 Sep 2025 19:32:50 +0000 (+0200) Subject: [gdb/testsuite, tclint] Fix gdb.mi X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=038fec6514ad183f4ca96b982590a2acd239737b;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite, tclint] Fix gdb.mi Running tclint on the test-cases in gdb.mi shows a few problems. Fix these. --- diff --git a/gdb/tclint.toml b/gdb/tclint.toml index e6283e49d63..e37c7d9f3a5 100644 --- a/gdb/tclint.toml +++ b/gdb/tclint.toml @@ -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. ] diff --git a/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp b/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp index 05656817b99..074defa6158 100644 --- a/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp +++ b/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp @@ -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=\"\\\\"\},\{name=\"func_nofb_var2\",value=\"\\\\"\}\\\].*" \ @@ -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=\"\\\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 diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp index 9e7b14c041d..850cb995cdb 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp @@ -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 \"" \ @@ -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} diff --git a/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp b/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp index 517449cbe44..371d430b838 100644 --- a/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp +++ b/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp @@ -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 } diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp index 3ae593bf4ed..52a52763445 100644 --- a/gdb/testsuite/gdb.mi/mi-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi-var-display.exp @@ -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" diff --git a/gdb/testsuite/gdb.mi/mi-var-rtti.exp b/gdb/testsuite/gdb.mi/mi-var-rtti.exp index c2768b6b7cf..2482df7c403 100644 --- a/gdb/testsuite/gdb.mi/mi-var-rtti.exp +++ b/gdb/testsuite/gdb.mi/mi-var-rtti.exp @@ -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 } diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp index 43f23786aa2..1ddd94eff20 100644 --- a/gdb/testsuite/gdb.mi/mi-watch.exp +++ b/gdb/testsuite/gdb.mi/mi-watch.exp @@ -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 } diff --git a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp index 0d51dc5b867..4b1d440b868 100644 --- a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp +++ b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp @@ -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 } diff --git a/gdb/testsuite/gdb.mi/mi2-var-child.exp b/gdb/testsuite/gdb.mi/mi2-var-child.exp index 3618d5a756c..4ee19f04641 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-child.exp @@ -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 diff --git a/gdb/testsuite/gdb.mi/new-ui-bp-deleted.exp b/gdb/testsuite/gdb.mi/new-ui-bp-deleted.exp index aa18668a6f0..b5b748ef069 100644 --- a/gdb/testsuite/gdb.mi/new-ui-bp-deleted.exp +++ b/gdb/testsuite/gdb.mi/new-ui-bp-deleted.exp @@ -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 } diff --git a/gdb/testsuite/gdb.mi/print-simple-values.exp b/gdb/testsuite/gdb.mi/print-simple-values.exp index 23488e35e9e..023f87c1c3c 100644 --- a/gdb/testsuite/gdb.mi/print-simple-values.exp +++ b/gdb/testsuite/gdb.mi/print-simple-values.exp @@ -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 } diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp index a0bf11f2f22..c954057e90c 100644 --- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp +++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp @@ -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\\\)" }