From 433e1aeb52247acb6ebed9b7ecba5077eb7a7083 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Mon, 22 May 2006 06:01:35 +0000 Subject: * runtest.exp, baseboards/basic-sim.exp, baseboards/cf.exp, baseboards/cris-sim.exp, baseboards/i960-cyclone.exp, baseboards/mcore-moto-sim.exp, baseboards/mips64vr4100-sim.exp, baseboards/mmixware-sim.exp, baseboards/op50n.exp, baseboards/rom68k-idp.exp, baseboards/sparclite-sim-le.exp, baseboards/usparc-cygmon.exp, config/base-config.exp, config/base68k.exp, config/ddb-ether.exp, config/ddb.exp, config/dos.exp, config/gdb-comm.exp, config/gdb_stub.exp, config/i386-bozo.exp, config/i960.exp, config/m68k-emc.exp, config/netware.exp, config/sid.exp, config/sim.exp, config/tic80.exp, config/unix.exp, config/vxworks.exp, lib/debugger.exp, lib/dejagnu.exp, lib/dg.exp, lib/framework.exp, lib/ftp.exp, lib/kermit.exp, lib/libgloss.exp, lib/remote.exp, lib/rlogin.exp, lib/rsh.exp, lib/target.exp, lib/targetdb.exp, lib/telnet.exp, lib/tip.exp, lib/utils.exp: Put braces around if expressions throughout. --- config/base-config.exp | 4 ++-- config/base68k.exp | 26 +++++++++++++------------- config/ddb-ether.exp | 8 ++++---- config/ddb.exp | 6 +++--- config/dos.exp | 34 +++++++++++++++++----------------- config/gdb-comm.exp | 40 ++++++++++++++++++++-------------------- config/gdb_stub.exp | 48 ++++++++++++++++++++++++------------------------ config/i386-bozo.exp | 2 +- config/i960.exp | 8 ++++---- config/m68k-emc.exp | 2 +- config/netware.exp | 16 ++++++++-------- config/sid.exp | 2 +- config/sim.exp | 12 ++++++------ config/tic80.exp | 2 +- config/unix.exp | 16 ++++++++-------- config/vxworks.exp | 22 +++++++++++----------- 16 files changed, 124 insertions(+), 124 deletions(-) (limited to 'config') diff --git a/config/base-config.exp b/config/base-config.exp index 35fde19..2961d9e 100644 --- a/config/base-config.exp +++ b/config/base-config.exp @@ -22,11 +22,11 @@ # success, 0 otherwise. # proc reboot_via_x10 { dest } { - if [board_info $dest exists name] { + if {[board_info $dest exists name]} { set dest [board_info $dest name] } - if [board_info $dest exists x10] { + if {[board_info $dest exists x10]} { set x10 [board_info $dest x10] verbose "rebooting x10 unit $x10" 1 rsh_exec rtl "/usr/unsupported/bin/x10-hellcab unit $x10 off" diff --git a/config/base68k.exp b/config/base68k.exp index ace41cb..2c9856c 100644 --- a/config/base68k.exp +++ b/config/base68k.exp @@ -29,11 +29,11 @@ proc base68k_ld { dest prog } { set shell_prompt [board_info $dest shell_prompt] - if ![file exists $prog] then { + if {![file exists $prog]} then { verbose -log "$prog does not exist." return "untested" } - if [is_remote host] { + if {[is_remote host]} { set prog [remote_download host $prog] if { $prog == "" } { verbose -log "Unable to download $prog to host." @@ -41,11 +41,11 @@ proc base68k_ld { dest prog } { } } - if [board_info $dest exists objcopy] { + if {[board_info $dest exists objcopy]} { set OBJCOPY [board_info $dest objcopy] set exec_file "${prog}.srec" set objcopy_args "" - if [board_info $dest exists use_vma_offset] { + if {[board_info $dest exists use_vma_offset]} { set objcopy_args "--adjust-vma=[board_info $dest hex_startaddr]" } set status [remote_exec host "$OBJCOPY $objcopy_args -O srec $prog ${prog}.srec"] @@ -64,7 +64,7 @@ proc base68k_ld { dest prog } { } set value 0 - if ![board_info $dest exists fileid] { + if {![board_info $dest exists fileid]} { while { $value < 2 } { set rom68k_shell_id [remote_open $dest] if { $rom68k_shell_id < 0 } { @@ -79,14 +79,14 @@ proc base68k_ld { dest prog } { } # dbug has problems if we go into binary mode, so this allows us to # disable entry into binary mode. - if ![board_info $dest exists no_binary_mode] { + if {![board_info $dest exists no_binary_mode]} { remote_binary $dest } } # if we built the srecord on a remote host, copy it back here so we # can load it - if [is_remote host] { + if {[is_remote host]} { global objdir set exec_file [remote_upload host ${exec_file} "${objdir}/a.out"] } @@ -131,7 +131,7 @@ proc base68k_ld { dest prog } { } } - if [board_info $dest exists download_command] { + if {[board_info $dest exists download_command]} { # Load the program. remote_send $dest "\r\n" # dbug has problems sending download command immediately after a @@ -145,7 +145,7 @@ proc base68k_ld { dest prog } { } } remote_send $dest [board_info $dest download_command] - if [board_info $dest exists download_response] { + if {[board_info $dest exists download_response]} { remote_expect $dest 5 { [board_info $dest download_response] { } timeout { @@ -201,7 +201,7 @@ proc base68k_spawn { dest prog args } { return [list $result ""] } - if [board_info $dest exists startaddr] { + if {[board_info $dest exists startaddr]} { set go_command "[board_info $dest go_command] [board_info $dest startaddr]" } else { set go_command "[board_info $dest go_command]" @@ -246,13 +246,13 @@ proc base68k_wait { dest timeout } { } } - if [board_info $dest exists output_end] { + if {[board_info $dest exists output_end]} { regsub "[board_info $dest output_end]" "$output" "\n" output } # There has got to be a better way. (We need to do this in order to remove # the echoed "go command". - if [board_info $dest exists startaddr] { + if {[board_info $dest exists startaddr]} { set go_command "[board_info $dest go_command] [board_info $dest startaddr]" } else { set go_command "[board_info $dest go_command]" @@ -308,7 +308,7 @@ proc base68k_load { dest prog args } { } elseif { $status == 0 } { return [list "pass" $output] } else { - if [info exists base68k_retry] { + if {[info exists base68k_retry]} { return [list "fail" $output] } set base68k_retry 1 diff --git a/config/ddb-ether.exp b/config/ddb-ether.exp index 2a469ba..c10988d 100644 --- a/config/ddb-ether.exp +++ b/config/ddb-ether.exp @@ -23,7 +23,7 @@ proc ${board}_init { dest } { global doing_ddb_init - if ![info exists doing_ddb_init] { + if {![info exists doing_ddb_init]} { set doing_ddb_init 1 remote_close $dest @@ -75,12 +75,12 @@ proc ddb_ether_load { dest prog args } { } proc ddb_ether_ld { dest prog } { - if ![board_info $dest exists tftpdir] { + if {![board_info $dest exists tftpdir]} { perror "Must set_board_info tftpdir for [board_info $dest name]" return "fail" } - if ![board_info $dest exists fileid] { + if {![board_info $dest exists fileid]} { set spawn_id [remote_open $dest] if { $spawn_id == "" || $spawn_id < 0 } { return "retry" @@ -164,7 +164,7 @@ proc ddb_ether_wait { dest timeout } { if { $status > 0 } { return [list $status $output] } else { - if [regexp "Exception Cause=" $output] { + if {[regexp "Exception Cause=" $output]} { remote_reboot $dest return [list -1 $output] } diff --git a/config/ddb.exp b/config/ddb.exp index 6a8cc96..4a982e8 100644 --- a/config/ddb.exp +++ b/config/ddb.exp @@ -34,11 +34,11 @@ set_board_info output_end "\[\r\n\](Exception Cause|\[0-9a-z\]+ \[0-9a-z\]+ brea # Reset the prompt to what GDB needs. proc ${board}_init { dest } { global doing_ddb_init - if [is_remote host] { + if {[is_remote host]} { return } - if ![info exists doing_ddb_init] { + if {![info exists doing_ddb_init]} { set doing_ddb_init 1 for { set i 1 } { $i <= 3 } { incr i } { @@ -85,7 +85,7 @@ set_board_info send_initial_cr 1 set_board_info dont_wait_for_prompt 1 # If no output format is specified, use objcopy. -if ![board_info $board exists output_format] { +if {![board_info $board exists output_format]} { set tempfil [lookfor_file $tool_root_dir binutils/objcopy] if { $tempfil != "" } { set_board_info objcopy $tempfil diff --git a/config/dos.exp b/config/dos.exp index bbb49ae..5c6f69b 100644 --- a/config/dos.exp +++ b/config/dos.exp @@ -25,7 +25,7 @@ proc dos_open { dest args } { global destbat_num - if ![info exists destbat_num] { + if {![info exists destbat_num]} { set destbat_num [pid] } if { [board_info $dest conninfo] == "" } { @@ -36,7 +36,7 @@ proc dos_open { dest args } { incr destbat_num } - if [board_info $dest exists fileid] { + if {[board_info $dest exists fileid]} { return [board_info $dest fileid] } @@ -50,7 +50,7 @@ proc dos_open { dest args } { return -1 } - if [board_info $dest exists init_command] { + if {[board_info $dest exists init_command]} { remote_send $dest "[board_info $dest init_command]\n" remote_expect $dest 10 { -re "$shell_prompt" { } @@ -61,7 +61,7 @@ proc dos_open { dest args } { } } - if [board_info $dest exists ftp_directory] { + if {[board_info $dest exists ftp_directory]} { set dir [board_info $dest ftp_directory] regsub -all "/" "$dir" "\\" dir remote_send $dest "cd $dir\n" @@ -74,7 +74,7 @@ proc dos_open { dest args } { } } - if [board_info $dest exists dos_dir] { + if {[board_info $dest exists dos_dir]} { set dos_dir [board_info $dest dos_dir] regsub -all "^(\[a-zA-Z]:).*$" "$dos_dir" "\\1" drive regsub -all "^\[a-zA-Z]:" "$dos_dir" "" dos_dir @@ -97,21 +97,21 @@ proc dos_open { dest args } { } global target_alias - if [info exists target_alias] { + if {[info exists target_alias]} { set talias $target_alias } else { set talias "foo-bar" } global board_info - if [board_info $dest exists name] { + if {[board_info $dest exists name]} { set n [board_info $dest name] } else { set n $dest } set board_info($n,fileid) $shell_id - if [board_info $dest exists init_script] { + if {[board_info $dest exists init_script]} { remote_exec $dest "[board_info $dest init_script] $talias" } @@ -124,7 +124,7 @@ proc dos_open { dest args } { # need to exit the connection first (ataman telnetd gets confused otherwise). # proc dos_close { dest args } { - if [board_info $dest exists fileid] { + if {[board_info $dest exists fileid]} { if { [board_info $dest connect] == "telnet" } { remote_send $dest "exit\n" sleep 2 @@ -366,21 +366,21 @@ proc dos_load { dest prog args } { if { [llength $args] > 1 } { set inpfile [lindex $args 1] } - if ![info exists dos_dll_loaded] { - if ![is_remote host] { + if {![info exists dos_dll_loaded]} { + if {![is_remote host]} { global target_alias set comp [get_multilibs] - if [file exists "${comp}/winsup/new-cygwin1.dll"] { + if {[file exists "${comp}/winsup/new-cygwin1.dll"]} { set dll "${comp}/winsup/new-cygwin1.dll" set dll_name "cygwin1.dll" - } elseif [file exists "${comp}/winsup/new-cygwin.dll"] { + } elseif {[file exists "${comp}/winsup/new-cygwin.dll"]} { set dll "${comp}/winsup/new-cygwin.dll" set dll_name "cygwin.dll" - } elseif [file exists ${comp}/lib/cygwin1.dll] { + } elseif {[file exists ${comp}/lib/cygwin1.dll]} { set dll "${comp}/lib/cygwin1.dll" set dll_name "cygwin1.dll" - } elseif [file exists ${comp}/lib/cygwin.dll] { + } elseif {[file exists ${comp}/lib/cygwin.dll]} { set dll "${comp}/lib/cygwin.dll" set dll_name "cygwin.dll" } else { @@ -448,7 +448,7 @@ proc dos_interrupt_job { host } { proc dos_copy_download { host localfile remotefile } { remote_file build delete "[board_info $host local_dir]/$remotefile" - if [remote_file build exists $localfile] { + if {[remote_file build exists $localfile]} { set result [remote_download build $localfile "[board_info $host local_dir]/$remotefile"] if { $result != "" } { remote_exec build "chmod" "a+rw $result" @@ -461,7 +461,7 @@ proc dos_copy_download { host localfile remotefile } { proc dos_copy_upload { host remotefile localfile } { remote_file build delete $localfile - if [file exists "[board_info $host local_dir]/$remotefile"] { + if {[file exists "[board_info $host local_dir]/$remotefile"]} { set result [remote_download build "[board_info $host local_dir]/$remotefile" $localfile] } else { set result "" diff --git a/config/gdb-comm.exp b/config/gdb-comm.exp index 9b3151c..92af199 100644 --- a/config/gdb-comm.exp +++ b/config/gdb-comm.exp @@ -23,7 +23,7 @@ # Load up some standard junk. load_lib remote.exp -if ![info exists board] { +if {![info exists board]} { perror "$board must be set before loading gdb-comm" } @@ -69,7 +69,7 @@ proc gdb_comm_file_cmd { arg } { # The "file" command loads up a new symbol file for gdb, deal with # the various messages it might spew out. - if [is_remote host] { + if {[is_remote host]} { set arg [remote_download host $arg a.out] } remote_send host "file $arg\n" @@ -129,7 +129,7 @@ proc gdb_comm_file_cmd { arg } { proc gdb_comm_go_idle { } { global gdb_prompt - if ![board_info host exists fileid] { + if {![board_info host exists fileid]} { return -1 } @@ -157,20 +157,20 @@ proc gdb_comm_start { dest } { # The variable gdb_prompt is a regexp which matches the gdb prompt. Set it # if it is not already set. - if ![board_info $dest exists gdb_prompt] then { + if {![board_info $dest exists gdb_prompt]} then { set gdb_prompt "\\(gdb\\)" } else { set gdb_prompt [board_info $dest gdb_prompt] } # Similarly for GDB. Look in the object directory for gdb if we aren't # provided with one. - if ![info exists GDB] then { + if {![info exists GDB]} then { set GDB "[lookfor_file ${tool_root_dir} gdb/gdb]" if { $GDB == "" } { set GDB [transform gdb] } } - if [board_info host exists gdb_opts] { + if {[board_info host exists gdb_opts]} { set gdb_opts [board_info host gdb_opts] } else { set gdb_opts "" @@ -227,13 +227,13 @@ proc quit_gdb { } { } } } - if ![is_remote host] { + if {![is_remote host]} { remote_close host } } proc gdb_comm_leave { } { - if [is_remote host] { + if {[is_remote host]} { quit_gdb } else { gdb_comm_go_idle @@ -259,7 +259,7 @@ proc gdb_comm_load { dest prog args } { } } # Make sure the file we're supposed to load really exists. - if ![file exists $prog] then { + if {![file exists $prog]} then { perror "$prog does not exist." return [list "untested" ""] } @@ -278,7 +278,7 @@ proc gdb_comm_load { dest prog args } { gdb_comm_leave return [gdb_comm_reload $dest $prog $args] } - if [board_info $dest exists gdb_sect_offset] { + if {[board_info $dest exists gdb_sect_offset]} { set textoff [board_info $dest gdb_sect_offset] remote_send host "sect .text $textoff\n" remote_expect host 10 { @@ -315,18 +315,18 @@ proc gdb_comm_load { dest prog args } { gdb_comm_add_breakpoint abort set protocol [board_info $dest gdb_protocol] - if [board_info $dest exists gdb_serial] { + if {[board_info $dest exists gdb_serial]} { set targetname [board_info $dest gdb_serial] - } elseif [board_info $dest exists netport] { + } elseif {[board_info $dest exists netport]} { set targetname [board_info $dest netport] } else { - if [board_info $dest exists serial] { + if {[board_info $dest exists serial]} { set targetname [board_info $dest serial] } else { set targetname "" } } - if [board_info $dest exists baud] { + if {[board_info $dest exists baud]} { remote_send host "set remotebaud [board_info $dest baud]\n" remote_expect host 10 { -re ".*$gdb_prompt $" {} @@ -369,7 +369,7 @@ proc gdb_comm_load { dest prog args } { } } - if [target_info exists gdb_init_command] { + if {[target_info exists gdb_init_command]} { remote_send host "[target_info gdb_init_command]\n" remote_expect host 10 { -re ".*$gdb_prompt $" { } @@ -381,7 +381,7 @@ proc gdb_comm_load { dest prog args } { } # Now download the executable to the target board. If communications # with the target are very slow the timeout might need to be increased. - if [board_info $dest exists gdb_load_offset] { + if {[board_info $dest exists gdb_load_offset]} { remote_send host "load $prog [board_info $dest gdb_load_offset]\n" } else { remote_send host "load\n" @@ -406,13 +406,13 @@ proc gdb_comm_load { dest prog args } { # Now start up the program and look for our magic breakpoints. # And a whole lot of other magic stuff too. - if [board_info $dest exists gdb_run_command] { + if {[board_info $dest exists gdb_run_command]} { remote_send host "[board_info $dest gdb_run_command]\n" } else { remote_send host "run\n" } # FIXME: The value 300 below should be a parameter. - if [board_info $dest exists testcase_timeout] { + if {[board_info $dest exists testcase_timeout]} { set testcase_timeout [board_info $dest testcase_timeout] } else { set testcase_timeout 300 @@ -460,7 +460,7 @@ proc gdb_comm_load { dest prog args } { if { $result == 0 } { return [list "pass" $output] } - if [board_info $dest exists exit_statuses_bad] { + if {[board_info $dest exists exit_statuses_bad]} { return [list "pass" $output] } return [list "fail" $output] @@ -501,7 +501,7 @@ proc gdb_comm_load { dest prog args } { } default { gdb_comm_leave - if [board_info $dest exists unreliable] { + if {[board_info $dest exists unreliable]} { if { [board_info $dest unreliable] > 0 } { global board_info set name [board_info $dest name] diff --git a/config/gdb_stub.exp b/config/gdb_stub.exp index 9e517dc..6c33a5f 100644 --- a/config/gdb_stub.exp +++ b/config/gdb_stub.exp @@ -28,14 +28,14 @@ proc gdb_stub_init { dest args } { global GDB global tool_root_dir - if ![info exists GDB] then { + if {![info exists GDB]} then { set GDB "[lookfor_file ${tool_root_dir} gdb/gdb]" if { $GDB == "" } { set GDB [transform gdb] } } - if [board_info $dest exists gdb_prompt] { + if {[board_info $dest exists gdb_prompt]} { set gdb_prompt [board_info $dest gdb_prompt] } else { set gdb_prompt "\\(gdb\\)" @@ -54,7 +54,7 @@ proc gdb_stub_restart { dest } { remote_close $dest sleep 2 set command "$GDB -nw -nx" - if [host_info exists gdb_opts] { + if {[host_info exists gdb_opts]} { append command " [host_info gdb_opts]" } set spawn_id [remote_spawn host $command] @@ -62,7 +62,7 @@ proc gdb_stub_restart { dest } { -re "$gdb_prompt" { } } if { $spawn_id >= 0 } { - if [board_info $dest exists baud] { + if {[board_info $dest exists baud]} { remote_send host "set remotebaud [board_info $dest baud]\n" remote_expect host 5 { -re "$gdb_prompt" { } @@ -97,9 +97,9 @@ proc gdb_stub_restart { dest } { proc gdb_stub_remote_check { dest } { global gdb_prompt - if [board_info $dest exists gdb_serial] { + if {[board_info $dest exists gdb_serial]} { set serial [board_info $dest gdb_serial] - } elseif [board_info $dest exists serial] { + } elseif {[board_info $dest exists serial]} { set serial [board_info $dest serial] } else { set serial [board_info $dest netport] @@ -135,11 +135,11 @@ proc gdb_stub_startup { dest } { set is_running_stub 0 - if [gdb_stub_remote_check $dest] { + if {[gdb_stub_remote_check $dest]} { set is_running_stub 1 } - if [board_info $dest exists serial] { + if {[board_info $dest exists serial]} { set serial [board_info $dest serial] } else { set serial [board_info $dest netport] @@ -165,14 +165,14 @@ proc gdb_stub_startup { dest } { verbose "building loader" set loader "loader" - if ![file exists $loader] { - if [board_info $dest exists gdb_stub_offset] { + if {![file exists $loader]} { + if {[board_info $dest exists gdb_stub_offset]} { set result [target_compile "${libdir}/stub-loader.c" $loader executable "libs=-Wl,-Ttext,[board_info $dest gdb_stub_offset]"] } else { set result [target_compile "${libdir}/stub-loader.c" $loader executable "ldscript=[board_info $dest gdb_stub_ldscript]"] } verbose "result is $result" - if [is_remote host] { + if {[is_remote host]} { set loader [remote_download host $loader] } } @@ -194,7 +194,7 @@ proc gdb_stub_startup { dest } { } } - if [board_info $dest exists serial] { + if {[board_info $dest exists serial]} { set serial [board_info $dest serial] } else { set serial [board_info $dest netport] @@ -215,7 +215,7 @@ proc gdb_stub_startup { dest } { # We only send the offset if gdb_load_offset is set. Otherwise, we # assume that sending the offset isn't needed. - if [board_info $dest exists gdb_load_offset] { + if {[board_info $dest exists gdb_load_offset]} { remote_send host "load $loader [board_info $dest gdb_stub_offset]\n" } else { remote_send host "load $loader\n" @@ -362,7 +362,7 @@ proc gdb_stub_start { dest } { -re "$gdb_prompt" { } } # This is needed for the SparcLite. Whee. - if [board_info $dest exists gdb,start_symbol] { + if {[board_info $dest exists gdb,start_symbol]} { set start_comm "jump *[board_info $dest gdb,start_symbol]\n" } else { set start_comm "jump *start\n" @@ -494,12 +494,12 @@ proc gdb_stub_load { dest prog args } { if { $status == 0 } { return [list "pass" $output] - } else if { $status > 0 } { + } elseif { $status > 0 } { return [list "fail" $output] } else { global gdb_stub_retry - if ![info exists gdb_stub_retry] { + if {![info exists gdb_stub_retry]} { set gdb_stub_retry 1 set result [eval gdb_stub_load \{$dest\} \{$prog\} $args] @@ -521,8 +521,8 @@ proc gdb_stub_ld { dest prog } { global gdb_prompt global GDB - if ![board_info $dest exists gdb_is_running] { - if ![gdb_stub_restart $dest] { + if {![board_info $dest exists gdb_is_running]} { + if {![gdb_stub_restart $dest]} { return 0 } } @@ -555,9 +555,9 @@ proc gdb_stub_ld { dest prog } { # just in case there are old breakpoints lying around. gdb_stub_delete_breakpoints - if [board_info $dest exists gdb_serial] { + if {[board_info $dest exists gdb_serial]} { set serial [board_info $dest gdb_serial] - } elseif [board_info $dest exists serial] { + } elseif {[board_info $dest exists serial]} { set serial [board_info $dest serial] } else { set serial [board_info $dest netport] @@ -578,7 +578,7 @@ proc gdb_stub_ld { dest prog } { } } - if [board_info $dest exists gdb_load_offset] { + if {[board_info $dest exists gdb_load_offset]} { set offset "[board_info $dest gdb_load_offset]" } else { set offset "" @@ -612,7 +612,7 @@ proc gdb_stub_retry_ld { dest prog } { global gdb_stub_retry_ld remote_reboot $dest - if [info exists gdb_stub_retry_ld] { + if {[info exists gdb_stub_retry_ld]} { unset gdb_stub_retry_ld return 0 } else { @@ -620,7 +620,7 @@ proc gdb_stub_retry_ld { dest prog } { } gdb_stub_restart $dest set status [gdb_stub_ld $dest $prog] - if [info exists gdb_stub_retry_ld] { + if {[info exists gdb_stub_retry_ld]} { unset gdb_stub_retry_ld } return $status @@ -629,7 +629,7 @@ proc gdb_stub_retry_ld { dest prog } { proc gdb_stub_close { dest } { global board_info set name [board_info $dest name] - if [info exists board_info($name,gdb_is_running)] { + if {[info exists board_info($name,gdb_is_running)]} { unset board_info($name,gdb_is_running) } return [remote_close host] diff --git a/config/i386-bozo.exp b/config/i386-bozo.exp index 6c8c0cd..5282f42 100644 --- a/config/i386-bozo.exp +++ b/config/i386-bozo.exp @@ -32,7 +32,7 @@ proc ${board}_init { args } { proc ${board}_close { board } { set linux_box [board_info $board linux_box] - if [board_info $linux_box exists fileid] { + if {[board_info $linux_box exists fileid]} { remote_send $linux_box "\003" remote_close $linux_box } diff --git a/config/i960.exp b/config/i960.exp index 0ee0c1a..18810d4 100644 --- a/config/i960.exp +++ b/config/i960.exp @@ -28,7 +28,7 @@ proc ${board}_init { dest } { set prompt [board_info $dest shell_prompt] set done 0 - if ![info exists i960_try_count] { + if {![info exists i960_try_count]} { set i960_try_count 1 } @@ -56,13 +56,13 @@ proc ${board}_init { dest } { remote_reboot $dest } } - if [info exists i960_try_count] { + if {[info exists i960_try_count]} { unset i960_try_count } } proc i960_ld { dest prog } { - if ![file exists $prog] { + if {![file exists $prog]} { perror "$prog does not exist." return "untested" } @@ -105,7 +105,7 @@ proc i960_ld { dest prog } { } else { set id2 [exp_open -leaveopen -i $id] } - if [catch "exec sx -bX a.out <@$id2 >@$id2 2>/dev/null" error] { + if {[catch "exec sx -bX a.out <@$id2 >@$id2 2>/dev/null" error]} { perror "exec sx failed: $error" } if { [board_info $dest connect] == "telnet" } { diff --git a/config/m68k-emc.exp b/config/m68k-emc.exp index e84ebc7..33dbc93 100644 --- a/config/m68k-emc.exp +++ b/config/m68k-emc.exp @@ -20,7 +20,7 @@ proc ${board}_init { dest } { global doing_emc_init - if [info exists doing_emc_init] { + if {[info exists doing_emc_init]} { return } set doing_emc_init 1 diff --git a/config/netware.exp b/config/netware.exp index d6df7df..922fc39 100644 --- a/config/netware.exp +++ b/config/netware.exp @@ -28,17 +28,17 @@ load_lib remote.exp proc ${board}_init { args } { global NLMCONV - if ![info exists NLMCONV] then { + if {![info exists NLMCONV]} then { set NLMCONV [findfile "$rootme/../binutils/nlmconv"] } global LD - if ![info exists LD] then { + if {![info exists LD]} then { set LD [findfile "$rootme/../ld/ld-new" "$rootme/../ld/ld-new" [transform "ld"]] } set shell_prompt "Password:" set shell_id [remote_open target] - if [target_info exists passwd] { + if {[target_info exists passwd]} { set passwd [target_info passwd] } else { set passwd "" @@ -48,7 +48,7 @@ proc ${board}_init { args } { return -1 } - if [string match "" $passwd] then { + if {[string match "" $passwd]} then { stty -echo send_user "Password: " expect_user -re "(.*)\n" @@ -94,7 +94,7 @@ proc ${board}_load { dest prog args } { global tmpdir global errorCode - if [board_info $dest exists fileid] { + if {[board_info $dest exists fileid]} { set shell_id [board_info $dest fileid] } else { set shell_id -1 @@ -132,10 +132,10 @@ proc ${board}_load { dest prog args } { # run nlmconv verbose "Executing: $NLMCONV -l$LD -T$lnk" 1 catch "exec $NLMCONV -l$LD -T$lnk" output - if ![string match "" $output] then { + if {![string match "" $output]} then { verbose $output 1 } - if ![string match "NONE" $errorCode] { + if {![string match "NONE" $errorCode]} { verbose -log "Can't link $prog" 3 return "fail" } @@ -143,7 +143,7 @@ proc ${board}_load { dest prog args } { # download verbose "Downloading $nlm" 1 catch "exec cp $nlm /.NetWare/[board_info $dest name].nws/sys.nwv/tmp/x.nlm" output - if ![string match "" $output] then { + if {![string match "" $output]} then { verbose $output 1 verbose -log "cp failed for $nlm" 3 return "unresolved" diff --git a/config/sid.exp b/config/sid.exp index bb91933..a105bbb 100644 --- a/config/sid.exp +++ b/config/sid.exp @@ -41,7 +41,7 @@ proc set_host_info { entry value } { verbose "set_host_info $entry $value" 3 set machine host - if [info exists target_info($machine,name)] { + if {[info exists target_info($machine,name)]} { set machine $target_info($machine,name) } set board_info($machine,$entry) $value diff --git a/config/sim.exp b/config/sim.exp index 886aa17..1ea3079 100644 --- a/config/sim.exp +++ b/config/sim.exp @@ -24,27 +24,27 @@ # proc sim_spawn { dest cmdline args } { - if ![board_info $dest exists sim] { + if {![board_info $dest exists sim]} { perror "no simulator defined for [board_info $dest name]" exit 1 } else { set sim [board_info $dest sim] } - if [board_info $dest exists sim,options] { + if {[board_info $dest exists sim,options]} { set simflags [board_info $dest sim,options] } else { set simflags "" } - if ![is_remote host] { + if {![is_remote host]} { if { [which $sim] == 0 } { verbose -log "Simulator $sim missing." 3 return -1 } } - if [is_remote host] { + if {[is_remote host]} { # download the program to remote. # we're assuming the program is the first word in the command. # FIXME: "prog < infile" won't work until we download infile. @@ -68,13 +68,13 @@ proc sim_load { dest prog args } { } } - if ![file exists $prog] then { + if {![file exists $prog]} then { perror "sim.exp: $prog to be downloaded does not exist." verbose -log "$prog to be downloaded does not exist." 3 return [list "untested" ""] } - if [board_info $dest exists sim_time_limit] { + if {[board_info $dest exists sim_time_limit]} { set sim_time_limit [board_info $dest sim_time_limit] } else { set sim_time_limit 240 diff --git a/config/tic80.exp b/config/tic80.exp index 9b980c4..8d449c4 100644 --- a/config/tic80.exp +++ b/config/tic80.exp @@ -39,7 +39,7 @@ proc tic80_load { dest prog args } { set result [remote_wait $dos_box 300] set output [lindex $result 1] if { [lindex $result 0] < 0 } { - if [board_info $dos_box exists fileid] { + if {[board_info $dos_box exists fileid]} { dos_interrupt_job $dos_box } else { remote_close $dos_box diff --git a/config/unix.exp b/config/unix.exp index 1dcf06e..6133cf5 100644 --- a/config/unix.exp +++ b/config/unix.exp @@ -19,7 +19,7 @@ # This file was written by Rob Savoye . -if ![info exists board] { +if {![info exists board]} { error "must set $board before loading unix.exp" } @@ -50,21 +50,21 @@ proc unix_load { dest prog args } { set inp "" } - if ![file exists $prog] then { + if {![file exists $prog]} then { # We call both here because this should never happen. perror "$prog does not exist in unix_load." verbose -log "$prog does not exist." 3 return "untested" } verbose "loading to $dest" 2 - if ![is_remote $dest] { + if {![is_remote $dest]} { if { "$inp" != "" } { set command "$prog $parg < $inp" } else { set command "$prog $parg" } - if ![info exists ld_library_path] { + if {![info exists ld_library_path]} { set ld_library_path "" } @@ -86,7 +86,7 @@ proc unix_load { dest prog args } { # non-testcase executable. (Setting LD_LIBRARY_PATH is the wrong # fix in the first place; this just tries to minimize the resulting # crap.) - if [info exists ld_library_path] { + if {[info exists ld_library_path]} { setenv LD_LIBRARY_PATH $orig_ld_library_path setenv SHLIB_PATH $orig_ld_library_path } @@ -97,8 +97,8 @@ proc unix_load { dest prog args } { verbose -log "Download of $prog to [board_info $dest name] failed." 3 return [list "unresolved" ""] } - if [board_info $dest exists remote_link] { - if [[board_info $dest remote_link] $remotefile] { + if {[board_info $dest exists remote_link]} { + if {[[board_info $dest remote_link] $remotefile]} { verbose -log "Couldn't do remote link" remote_exec $dest "\\rm -f $remotefile" return [list "unresolved" ""] @@ -128,7 +128,7 @@ proc unix_load { dest prog args } { setenv SHLIB_PATH $orig_ld_library_path verbose "Executed $prog, status $status" 2 - if ![string match "" $output] { + if {![string match "" $output]} { verbose -- "$output" 2 } if { $status == 0 } { diff --git a/config/vxworks.exp b/config/vxworks.exp index 44ca48c..fa669fe 100644 --- a/config/vxworks.exp +++ b/config/vxworks.exp @@ -79,7 +79,7 @@ proc ${board}_init { dest } { } -re "$boot_mon_prompt" { } } - if ![info exists curr_file] { + if {![info exists curr_file]} { remote_close $dest remote_reboot $dest return @@ -112,7 +112,7 @@ proc ${board}_init { dest } { } proc vxworks_final_init { dest } { - if [board_info $dest exists preload_obj] { + if {[board_info $dest exists preload_obj]} { if { [target_compile [board_info $dest preload_obj] foo.out object [board_info $dest preload_obj_flags]] == "" } { vxworks_ld $dest foo.out } @@ -167,7 +167,7 @@ proc vxworks_exec { dest program pargs inp outp } { } proc vxworks_download { dest localfile remotefile } { - if [board_info $dest exists vxworks_homedir] { + if {[board_info $dest exists vxworks_homedir]} { set rfile "[board_info $dest vxworks_homedir]/$remotefile" remote_download build $localfile $rfile return $rfile @@ -177,7 +177,7 @@ proc vxworks_download { dest localfile remotefile } { proc vxworks_file { dest op args } { set file [lindex $args 0] - if [board_info $dest exists vxworks_homedir] { + if {[board_info $dest exists vxworks_homedir]} { set dir "[board_info $dest vxworks_homedir]" switch $op { exists { @@ -206,7 +206,7 @@ proc vxworks_send { dest string } { } proc vxworks_open { dest args } { - if [board_info $dest exists fileid] { + if {[board_info $dest exists fileid]} { return [board_info $dest fileid] } @@ -218,9 +218,9 @@ proc vxworks_open { dest args } { return -1 } - if [board_info $dest exists logname] { + if {[board_info $dest exists logname]} { set logname [board_info $dest logname] - if [board_info $dest exists password] { + if {[board_info $dest exists password]} { remote_send $dest "iam \"$logname\",\"[board_info $dest passwd]\"\r" } else { remote_send $dest "iam \"$logname\"\r" @@ -241,15 +241,15 @@ proc vxworks_open { dest args } { } set dir "" - if [board_info $dest exists ftp_directory] { + if {[board_info $dest exists ftp_directory]} { set dir [board_info $dest ftp_directory] } - if [board_info $dest exists vxworks_homedir] { + if {[board_info $dest exists vxworks_homedir]} { set dir [board_info $dest vxworks_homedir] } if { $dir != "" } { set status [remote_exec $dest "cd" "\"$dir\""] - if [lindex $status 0] { + if {[lindex $status 0]} { perror "Error in cd to $dir--[lindex $status 1]" return 1 } @@ -427,7 +427,7 @@ proc vxworks_run { dest function pargs inp outp } { proc vxworks_unld { dest } { global board_info - if [board_info $dest exists vx_module] { + if {[board_info $dest exists vx_module]} { # Vxworks5.0 does not have the unld command. if { [board_info $dest os] != "vxworks5.0" } { remote_exec $dest "unld" "[board_info $dest vx_module]" -- cgit v1.1