Running tclint on the test-cases in gdb.mi shows a few problems.
Fix these.
"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.
]
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\\\\\"\\\.\\\>\"\}\\\].*" \
# 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"
"-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
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"
return -1
}
-if [mi_gdb_start] {
+if {[mi_gdb_start]} {
return
}
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"
# 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
}
# 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
global mi_gdb_prompt
global binfile testfile
- if [is_remote host] {
+ if {[is_remote host]} {
set filename ${testfile}
remote_download host ${binfile} ${filename}
} else {
# 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
}
# 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}" \
# 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"
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
"210\\\^done,path=\"$orig_path\"" \
"environment-path -r operation"
-}
+}
proc test_setshow_inferior_tty {} {
global mi_gdb_prompt
# 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}\""
"${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"
} else {
set start_ops ""
}
- if [mi_clean_restart $::testfile $start_ops ] {
+ if {[mi_clean_restart $::testfile $start_ops ]} {
return
}
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}\",.*\}"
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"
}
# 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\"\\\},.*"
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"
}
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"]
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" \
"-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"
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]
}
}
standard_testfile
-if [build_executable ${testfile}.exp ${binfile} ${srcfile}] {
+if {[build_executable ${testfile}.exp ${binfile} ${srcfile}]} {
return -1
}
standard_testfile .cc
-if [build_executable ${testfile}.exp ${binfile} ${srcfile} {debug c++}] {
+if {[build_executable ${testfile}.exp ${binfile} ${srcfile} {debug c++}]} {
return -1
}
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
return 0
}
-if [mi_gdb_start] {
+if {[mi_gdb_start]} {
return
}
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:
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:
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:
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:
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:
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:
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:
# 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"
# 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}"
# 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.
}
}
-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
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"
}
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"
lappend start_ops "separate-mi-tty"
}
- if [mi_gdb_start $start_ops] {
+ if {[mi_gdb_start $start_ops]} {
return
}
# 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" \
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
} else {
fail $gdb_test_name
}
- }
+ }
}
mi_gdb_test "105-symbol-info-module-functions --name _all" \
} else {
fail $gdb_test_name
}
- }
+ }
}
# 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" \
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"
}
}
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;
}
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
}
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"
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"
global mi_gdb_prompt
global decimal
- if [mi_clean_restart "" $args] {
+ if {[mi_clean_restart "" $args]} {
return
}
# 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
}
}
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"
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"
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"
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"
return
}
-if ![mi_runto stop_frame] {
+if {![mi_runto stop_frame]} {
perror "Failed to stop in stop_frame"
return -1
}
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"
}
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
}
# 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"]
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
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:
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
# -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.
# -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
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" "" \
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"]
standard_testfile
set opts {debug}
-if [build_executable ${testfile}.exp ${testfile} ${srcfile} $opts] {
+if {[build_executable ${testfile}.exp ${testfile} ${srcfile} $opts]} {
return -1
}
#
# 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.\"" \
# 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
standard_testfile
-if [build_executable ${testfile}.exp ${binfile} ${srcfile}] {
+if {[build_executable ${testfile}.exp ${binfile} ${srcfile}]} {
return -1
}
# 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"
}
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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\"\}\\\]" \
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
# 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 \*}}
# 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
# 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
# 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
# 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
# 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
# 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
"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
"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
"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
# 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,
# 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,
"update all vars: lsimple and others changed"
-###
+###
#
# Test assignment to variables. More tests on assignment are in other files.
#
# 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>\"" \
######
-# End of assign tests
+# End of assign tests
#####
set line_subroutine1_body [gdb_get_line_number "global_simple.integer = i + 3;"]
"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
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
"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
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
"\\^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}
standard_testfile .c
set opts {debug}
-if [build_executable $testfile.exp $testfile $srcfile $opts] {
+if {[build_executable $testfile.exp $testfile $srcfile $opts]} {
return -1
}
# 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"
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
}
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:
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:
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:
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)
} else {
set start_ops ""
}
- if [mi_clean_restart ${::testfile} $start_ops] {
+ if {[mi_clean_restart ${::testfile} $start_ops]} {
return
}
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
require is_x86_64_m64_target
}
-if [build_executable ${testfile}.exp ${binfile} ${srcfile} $opts] {
+if {[build_executable ${testfile}.exp ${binfile} ${srcfile} $opts]} {
return -1
}
# 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
# 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
# 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
# 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
# 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
# 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
# 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
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
# 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 \*}}
# 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
# 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
# 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
# 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
# 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
# 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
set start_ops ""
}
- if [mi_gdb_start $start_ops] {
+ if {[mi_gdb_start $start_ops]} {
return
}
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
}
}
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\\\)"
}