global gdbserver_reconnect_p
# Spawn GDB.
- set res [eval extended_gdbserver_mi_gdb_start $args]
+ set res [extended_gdbserver_mi_gdb_start {*}$args]
if { $res } {
return $res
}
foreach line [split $str \n] {
lappend result [string_to_regexp $line]
}
- return [eval multi_line $result]
+ return [multi_line {*}$result]
}
set inner_string { case ? is
}
if {$parentpid != 0} {
- eval exec kill -9 $parentpid
+ exec kill -9 $parentpid
}
kill_wait_spawned_process $test_spawn_id
gdb_test_multiple "step" "stopped at bp, 2nd instr" {
-re -wrap "Breakpoint $decimal, ($hex) in foo.*" {
set stop_addr $expect_out(1,string)
- if {[eval expr "$bp_addr == $stop_addr"]} {
+ if {$bp_addr == $stop_addr} {
pass "stopped at bp, 2nd instr"
} else {
fail "stopped at bp, 2nd instr (wrong address)"
set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
if {!$stop_addr_is_stmt} {
fail "stopped at bp, 2nd instr (missing hex prefix)"
- } elseif {[eval expr "$bp_addr == $stop_addr"]} {
+ } elseif {$bp_addr == $stop_addr} {
pass "stopped at bp, 2nd instr"
} else {
fail "stopped at bp, 2nd instr (wrong address)"
# Turn the arguments, which are literal strings, into
# regular expressions by quoting any special characters they contain.
foreach var { prototyped plain overprototyped } {
- eval "set val \$$var"
- regsub -all "\[\]\[*()\]" $val "\\\\&" val
+ set val [string_to_regexp [set $var]]
regsub -all "short int" $val "short( int)?" val
regsub -all "long int" $val "long( int)?" val
- eval "set $var \$val"
+ set $var $val
}
gdb_test_multiple "ptype $id" "ptype $id" {
if {!$use_gdb_stub
&& (! [target_info exists use_cygmon] || ! [target_info use_cygmon])} {
global program_exited
- if {[eval expr $program_exited == 0]} {
+ if {$program_exited == 0} {
gdb_test_multiple "n" "step to end of run" {
-re "$inferior_exited_re normally.*$gdb_prompt $" {
# If we actually have debug info for the start function,
if { [llength $hist_lines] == 1 } {
set pattern [lindex $hist_lines 0]
} else {
- set pattern [eval multi_line $hist_lines]
+ set pattern [multi_line {*}$hist_lines]
}
# Check the history.
# Turn the arguments, which are literal strings, into
# regular expressions by quoting any special characters they contain.
foreach var { prototyped plain overprototyped } {
- eval "set val \$$var"
- regsub -all "\[\]\[*()\]" $val "\\\\&" val
+ set val [string_to_regexp [set $var]]
regsub -all "short int" $val "short( int)?" val
regsub -all "long int" $val "long( int)?" val
- eval "set $var \$val"
+ set $var $val
}
gdb_test_multiple "ptype $id" "ptype $id" {
global currently_disabled_style
with_test_prefix "$prefix" {
- eval "clean_restart $args"
+ clean_restart {*}$args
if { $currently_disabled_style != "" } {
set st $currently_disabled_style
proc test_break {linespec msg_id args} {
global error_messages
- gdb_test "break $linespec" [string_to_regexp \
- [eval format \$error_messages($msg_id) \
- $args]] \
+ gdb_test "break $linespec" \
+ [string_to_regexp [format $error_messages($msg_id) {*}$args]] \
"'break $linespec'"
}
set loc [mi_make_breakpoint_loc -enabled "N"]
set args [list -cond "bad" -locations "\\\[$loc\\\]"]
- set bp [eval mi_make_breakpoint_multi $args]
+ set bp [mi_make_breakpoint_multi {*}$args]
mi_gdb_test "-break-insert -c bad --force-condition callme" \
"${warning}\\^done,$bp" \
# that we actually stop where we think we should.
for {set i 1} {$i < 4} {incr i} {
foreach inline {"not_inline" "inline"} {
- eval gdb_breakpoint "${inline}_func$i" $break_flags
+ gdb_breakpoint "${inline}_func$i" {*}$break_flags
}
}
gdb_test_multiple "step" $testmsg {
-re -wrap "Breakpoint $decimal, ($hex) in foo.*" {
set stop_addr $expect_out(1,string)
- if {[eval expr "$foo2_addr == $stop_addr"]} {
+ if {$foo2_addr == $stop_addr} {
pass "stopped at bp, 2nd instr"
} else {
fail "stopped at bp, 2nd instr (wrong address)"
set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
if { ! $stop_addr_is_stmt } {
fail "stopped at bp, 2nd instr (missing hex prefix)"
- } elseif {[eval expr "$foo2_addr == $stop_addr"]} {
+ } elseif {$foo2_addr == $stop_addr} {
pass "stopped at bp, 2nd instr"
} else {
fail "stopped at bp, 2nd instr (wrong address)"
gdb_test_multiple "step" "$test_msg" {
-re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" {
set stop_addr $expect_out(1,string)
- if {[eval expr "$foo1_addr == $stop_addr"]} {
+ if {$foo1_addr == $stop_addr} {
pass "$test_msg"
} else {
fail "$test_msg (wrong address)"
gdb_test_multiple "step" $testmsg {
-re -wrap "Breakpoint $decimal, ($hex) in foo.*" {
set stop_addr $expect_out(1,string)
- if {[eval expr "$foo2_addr == $stop_addr"]} {
+ if {$foo2_addr == $stop_addr} {
pass "stopped at bp, 2nd instr"
} else {
fail "stopped at bp, 2nd instr (wrong address)"
set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
if { ! $stop_addr_is_stmt } {
fail "stopped at bp, 2nd instr (missing hex prefix)"
- } elseif {[eval expr "$foo2_addr == $stop_addr"]} {
+ } elseif {$foo2_addr == $stop_addr} {
pass "stopped at bp, 2nd instr"
} else {
fail "stopped at bp, 2nd instr (wrong address)"
gdb_test_multiple "step" "$test_msg" {
-re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" {
set stop_addr $expect_out(1,string)
- if {[eval expr "$foo1_addr == $stop_addr"]} {
+ if {$foo1_addr == $stop_addr} {
pass "$test_msg"
} else {
fail "$test_msg (wrong address)"
proc run_one_test_small { test_proc_name } {
save_vars { env(TERM) stty_init } {
setup_small
- eval $test_proc_name
+ $test_proc_name
}
}
proc run_one_test_large { test_proc_name } {
save_vars { env(TERM) stty_init } {
setup_large
- eval $test_proc_name
+ $test_proc_name
}
}
# key/value pairs given in ARGS. NAME is used as the test name.
proc dap_match_values {name d args} {
foreach {key value} $args {
- if {[eval dict get [list $d] $key] != $value} {
+ if {[dict get $d {*}$key] != $value} {
fail "$name (checking $key)"
return ""
}
set result [_dap_wait_for_event $type]
set event [lindex $result 0]
- eval dap_match_values [list $name $event] $args
+ dap_match_values $name $event {*}$args
return $result
}
if {![info exists _deferred_output($_defer)]} {
set _deferred_output($_defer) ""
- eval _section $section_spec
+ _section {*}$section_spec
}
uplevel $body
global inotify_pid
if {[info exists inotify_pid]} {
- eval exec kill $inotify_pid
+ exec kill $inotify_pid
}
set output [remote_exec host "$GDB $INTERNAL_GDBFLAGS --version"]
if { [interp eval $temp "info procs ::unknown"] != "" } {
set old_args [interp eval $temp "info args ::unknown"]
set old_body [interp eval $temp "info body ::unknown"]
- eval proc gdb_tcl_unknown {$old_args} {$old_body}
+ proc gdb_tcl_unknown $old_args $old_body
}
interp delete $temp
unset temp
gdb_exit
if { [llength $cleanfiles_target] > 0 } {
- eval remote_file target delete $cleanfiles_target
+ remote_file target delete {*}$cleanfiles_target
set cleanfiles_target {}
}
if { [llength $cleanfiles_host] > 0 } {
- eval remote_file host delete $cleanfiles_host
+ remote_file host delete {*}$cleanfiles_host
set cleanfiles_host {}
}
lappend arglist $source $options
}
- return [eval build_executable_from_specs $arglist]
+ return [build_executable_from_specs {*}$arglist]
}
# Starts fresh GDB binary and loads an optional executable into GDB.
# Returns 0 on success, non-zero on failure.
proc prepare_for_testing_full {testname args} {
foreach spec $args {
- if {[eval build_executable_from_specs [list $testname] $spec] == -1} {
+ if {[build_executable_from_specs $testname {*}$spec] == -1} {
return -1
}
set executable [lindex $spec 0]
set len [llength $root_split]
- if {[eval file join $root_split]
- != [eval file join [lrange $full_split 0 [expr {$len - 1}]]]} {
+ if {[file join {*}$root_split]
+ != [file join {*}[lrange $full_split 0 [expr {$len - 1}]]]} {
error "$full not a subdir of $root"
}
- return [eval file join [lrange $full_split $len end]]
+ return [file join {*}[lrange $full_split $len end]]
}
# If GDB_PARALLEL exists, then set up the parallel-mode directories.
if {[llength $args] > 1 && [lindex $args 1] == ""} {
set args [lreplace $args 1 1 "/dev/null"]
}
- set result [eval remote_exec host [list $program] $args]
+ set result [remote_exec host $program {*}$args]
verbose "result is $result"
set status [lindex $result 0]
set output [lindex $result 1]
# Install the override.
set new_args [info_args_with_defaults $override]
set new_body [info body $override]
- eval proc $name {$new_args} {$new_body}
+ proc $name $new_args $new_body
# Execute body.
set code [catch {uplevel 1 $body} result]
# Restore old proc if it existed on entry, else delete it.
if { $existed } {
- eval proc $name {$old_args} {$old_body}
+ proc $name $old_args $old_body
} else {
rename $name ""
}
# Like gdb_target_cmd_ext, but returns 0 on success, 1 on failure.
proc gdb_target_cmd { args } {
- set res [eval gdb_target_cmd_ext $args]
+ set res [gdb_target_cmd_ext {*}$args]
return [expr $res == 0 ? 0 : 1]
}
# baseboard file.
#
proc mi_gdb_start { args } {
- return [eval default_mi_gdb_start $args]
+ return [default_mi_gdb_start {*}$args]
}
# Many of the tests depend on setting breakpoints at various places and
# -exec-continue, as appropriate. ARGS are passed verbatim to
# mi_run_cmd_full.
proc mi_run_cmd {args} {
- return [eval mi_run_cmd_full 1 $args]
+ return [mi_run_cmd_full 1 {*}$args]
}
# A wrapper for mi_run_cmd_full which uses the CLI commands 'run' and
# 'continue', as appropriate. ARGS are passed verbatim to
# mi_run_cmd_full.
proc mi_run_with_cli {args} {
- return [eval mi_run_cmd_full 0 $args]
+ return [mi_run_cmd_full 0 {*}$args]
}
# Starts fresh GDB binary and loads an optional executable into GDB.
# returns the breakpoint regexp from that procedure.
proc mi_create_breakpoint {location test args} {
- set bp [eval mi_make_breakpoint $args]
+ set bp [mi_make_breakpoint {*}$args]
mi_gdb_test "222-break-insert $location" "222\\^done,$bp" $test
return $bp
}
# locations using mi_make_breakpoint_multi instead.
proc mi_create_breakpoint_multi {location test args} {
- set bp [eval mi_make_breakpoint_multi $args]
+ set bp [mi_make_breakpoint_multi {*}$args]
mi_gdb_test "222-break-insert $location" "222\\^done,$bp" $test
return $bp
}
# Like mi_create_breakpoint, but creates a pending breakpoint.
proc mi_create_breakpoint_pending {location test args} {
- set bp [eval mi_make_breakpoint_pending $args]
+ set bp [mi_make_breakpoint_pending {*}$args]
mi_gdb_test "222-break-insert $location" ".*\r\n222\\^done,$bp" $test
return $bp
}
proc mi_info_frame { test args } {
parse_some_args {{frame ""} {thread ""}}
- set re [eval mi_make_info_frame_regexp $args]
+ set re [mi_make_info_frame_regexp {*}$args]
set cmd "235-stack-info-frame"
if {$frame ne ""} {
# gdb_trace_setactions_command.
#
proc gdb_trace_setactions { testname tracepoint args } {
- eval gdb_trace_setactions_command "actions" {$testname} {$tracepoint} $args
+ gdb_trace_setactions_command "actions" $testname $tracepoint {*}$args
}
# Define actions for a tracepoint, using the "commands" command. See
# gdb_trace_setactions_command.
#
proc gdb_trace_setcommands { testname tracepoint args } {
- eval gdb_trace_setactions_command "commands" {$testname} {$tracepoint} $args
+ gdb_trace_setactions_command "commands" $testname $tracepoint {*}$args
}
#
scan $expect_out(1,string) %c val
set hexval [format "%02x" $val]
set cmd $expect_out(2,string)
- eval _esc_0x${hexval}_$cmd
+ _esc_0x${hexval}_$cmd
}
-re "^(\[=>\])" {
scan $expect_out(1,string) %c val
-re "^($re_csi_cmd)" {
set cmd $expect_out(1,string)
_log "wait_for: _csi_$cmd"
- eval _csi_$cmd
+ _csi_$cmd
}
-re "^($re_csi_args*)($re_csi_cmd)" {
set params [split $expect_out(1,string) ";"]
set cmd $expect_out(2,string)
_log "wait_for: _csi_$cmd <<<$params>>>"
- eval _csi_$cmd $params
+ _csi_$cmd {*}$params
}
-re "^($re_csi_prefix?)($re_csi_args*)($re_csi_cmd)" {
set prefix $expect_out(1,string)
scan $prefix %c val
set hexval [format "%02x" $val]
_log "wait_for: _csi_0x${hexval}_$cmd <<<$expect_out(1,string)>>>"
- eval _csi_0x${hexval}_$cmd $params
+ _csi_0x${hexval}_$cmd {*}$params
}
timeout {