From d7b7156075df25716082174f6baf2ac0e163e939 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Thu, 7 Aug 2003 03:42:42 +0000 Subject: Strip trailing semicolons from Tcl source files. --- Clean.tcl | 2 +- baseboards/a29k-udi.exp | 12 +- baseboards/am33_2.0-libremote.exp | 16 +- baseboards/arc-sim.exp | 2 +- baseboards/arm-ice.exp | 4 +- baseboards/arm-sim.exp | 6 +- baseboards/basic-sim.exp | 26 +- baseboards/cf.exp | 22 +- baseboards/cygmon.exp | 18 +- baseboards/cygwin.exp | 12 +- baseboards/d10v-sim.exp | 6 +- baseboards/d10v.exp | 14 +- baseboards/d30v-sim.exp | 4 +- baseboards/danlite-elf.exp | 28 +- baseboards/dos.exp | 10 +- baseboards/fr30-cygmon.exp | 20 +- baseboards/fr30-sim.exp | 2 +- baseboards/frv-sim.exp | 2 +- baseboards/frv-tiger.exp | 22 +- baseboards/frv-tomcat.exp | 22 +- baseboards/gdbserver-sample.exp | 16 +- baseboards/h8300.exp | 6 +- baseboards/i386-bozo.exp | 12 +- baseboards/i960-cyclone.exp | 2 +- baseboards/i960-sim.exp | 20 +- baseboards/jmr3904-sim.exp | 2 +- baseboards/linux-gdbserver.exp | 12 +- baseboards/linux-libremote.exp | 12 +- baseboards/m32r-sim.exp | 2 +- baseboards/m68hc11-sim.exp | 8 +- baseboards/m68k-emc.exp | 10 +- baseboards/mcore-moto-sim.exp | 32 +- baseboards/mcore-sim.exp | 2 +- baseboards/mips-idt.exp | 16 +- baseboards/mips-lnews-sim.exp | 2 +- baseboards/mips-lsi-sim.exp | 2 +- baseboards/mips-sim-idt32.exp | 22 +- baseboards/mips-sim-idt64.exp | 22 +- baseboards/mips-sim.exp | 22 +- baseboards/mips64-sim.exp | 18 +- baseboards/mips64vr4100-sim.exp | 4 +- baseboards/mn10200-cygmon.exp | 20 +- baseboards/mn10200-sim.exp | 2 +- baseboards/mn10300-cygmon.exp | 22 +- baseboards/mn10300-sim.exp | 2 +- baseboards/msparc-cygmon.exp | 2 +- baseboards/op50n.exp | 22 +- baseboards/powerpc-bug.exp | 8 +- baseboards/powerpc-sim.exp | 2 +- baseboards/powerpcle-sim.exp | 2 +- baseboards/rom68k-idp.exp | 22 +- baseboards/sh-hms-sim.exp | 4 +- baseboards/sh-hms.exp | 2 +- baseboards/sparc-sim.exp | 20 +- baseboards/sparc64-sim.exp | 2 +- baseboards/sparclet-aout.exp | 12 +- baseboards/sparclite-coff.exp | 28 +- baseboards/sparclite-sim-le.exp | 28 +- baseboards/sparclite-sim.exp | 20 +- baseboards/strongarm-cygmon.exp | 20 +- baseboards/tic80-sim.exp | 20 +- baseboards/tx39-dve.exp | 8 +- baseboards/tx39-sim.exp | 2 +- baseboards/unix.exp | 14 +- baseboards/usparc-cygmon.exp | 42 +-- baseboards/v850-sim.exp | 2 +- baseboards/vr4100-sim.exp | 2 +- baseboards/vr4111-sim.exp | 2 +- baseboards/vr4300-ddb.exp | 2 +- baseboards/vr4300-sim.exp | 2 +- baseboards/vr5000-ddb.exp | 8 +- baseboards/vx4300.exp | 16 +- baseboards/vx68k.exp | 16 +- baseboards/vx960.exp | 18 +- baseboards/vxsparc.exp | 16 +- baseboards/x86-cygmon.exp | 2 +- baseboards/xscale-cygmon.exp | 20 +- baseboards/xtensa-sim.exp | 4 +- config/arc.exp | 2 +- config/arm-ice.exp | 2 +- config/base-config.exp | 14 +- config/base68k.exp | 154 ++++---- config/bug.exp | 2 +- config/cfdbug.exp | 2 +- config/cygmon.exp | 4 +- config/d10v.exp | 2 +- config/ddb-ether.exp | 128 +++---- config/ddb.exp | 48 +-- config/dos.exp | 296 +++++++-------- config/dve.exp | 2 +- config/gdb-comm.exp | 240 ++++++------ config/gdb_stub.exp | 304 ++++++++-------- config/h8300.exp | 2 +- config/i386-bozo.exp | 24 +- config/i960.exp | 160 ++++---- config/m32r-stub.exp | 2 +- config/m32r.exp | 2 +- config/m68hc11.exp | 2 +- config/m68k-emc.exp | 34 +- config/mips-idt.exp | 4 +- config/mn10200-eval.exp | 2 +- config/mn10300-eval.exp | 2 +- config/netware.exp | 12 +- config/powerpc-bug.exp | 2 +- config/proelf.exp | 4 +- config/rom68k.exp | 6 +- config/sh.exp | 2 +- config/sid.exp | 2 +- config/sim.exp | 36 +- config/slite.exp | 2 +- config/sparclet.exp | 4 +- config/tic80.exp | 64 ++-- config/udi.exp | 58 +-- config/unix.exp | 32 +- config/vr4100.exp | 2 +- config/vr4300.exp | 2 +- config/vr5000.exp | 2 +- config/vrtx.exp | 2 +- config/vxworks.exp | 264 +++++++------- lib/debugger.exp | 2 +- lib/dejagnu.exp | 10 +- lib/dg.exp | 10 +- lib/framework.exp | 114 +++--- lib/ftp.exp | 136 +++---- lib/kermit.exp | 54 +-- lib/libgloss.exp | 244 ++++++------- lib/mondfe.exp | 56 +-- lib/remote.exp | 746 +++++++++++++++++++------------------- lib/rlogin.exp | 32 +- lib/rsh.exp | 40 +- lib/standard.exp | 8 +- lib/target.exp | 128 +++---- lib/targetdb.exp | 38 +- lib/telnet.exp | 78 ++-- lib/tip.exp | 12 +- lib/xsh.exp | 26 +- runtest.exp | 402 ++++++++++---------- 137 files changed, 2498 insertions(+), 2498 deletions(-) diff --git a/Clean.tcl b/Clean.tcl index d4ba0b7..85096f1 100755 --- a/Clean.tcl +++ b/Clean.tcl @@ -96,7 +96,7 @@ for { set i 0 } { $i < $argc } { incr i } { switch -glob -- $option { "--he*" { # (--help) help text - usage; + usage exit 0 } diff --git a/baseboards/a29k-udi.exp b/baseboards/a29k-udi.exp index 3b4c506..c3b365a 100644 --- a/baseboards/a29k-udi.exp +++ b/baseboards/a29k-udi.exp @@ -1,22 +1,22 @@ # This is a list of toolchains that are supported on this board. -set_board_info target_install {a29k-amd-udi}; +set_board_info target_install {a29k-amd-udi} # Load the generic configuration for this board. -load_generic_config "udi"; +load_generic_config "udi" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" # The basic set of flags needed to build "hello world" for this # board. This target uses libgloss and newlib. -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # We don't need a linker script. -set_board_info ldscript ""; +set_board_info ldscript "" # mondfe can't return exit statuses, so gcc (ctorture et al) needs to # do what it can to get them. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. diff --git a/baseboards/am33_2.0-libremote.exp b/baseboards/am33_2.0-libremote.exp index 7ba2e7c..722ac2d 100644 --- a/baseboards/am33_2.0-libremote.exp +++ b/baseboards/am33_2.0-libremote.exp @@ -1,23 +1,23 @@ # This file is useful for gdb testing with libremote on an embedded linux # board. In this case a Matsushita ASB2305 AM33 v2.0 board. -load_generic_config "libremote_server"; +load_generic_config "libremote_server" -process_multilib_options ""; +process_multilib_options "" # The default compiler for this target. -#set_board_info compiler "[find_gcc]"; -set_board_info compiler "am33_2.0-linux-gnu-gcc"; +#set_board_info compiler "[find_gcc]" +set_board_info compiler "am33_2.0-linux-gnu-gcc" # We will be using the standard GDB remote protocol set_board_info gdb_protocol "remote" # Use techniques appropriate to a stub -set_board_info use_gdb_stub 1; -set_board_info gdb,gdb_stub 1; +set_board_info use_gdb_stub 1 +set_board_info gdb,gdb_stub 1 # This gdbserver can only run a process once per session. -set_board_info gdb,do_reload_on_run 1; +set_board_info gdb,do_reload_on_run 1 # There's no support for argument-passing (yet). set_board_info noargs 1 @@ -26,7 +26,7 @@ set_board_info noargs 1 set_board_info gdb,noinferiorio 1 # Can't do hardware watchpoints, in general -set_board_info gdb,no_hardware_watchpoints 1; +set_board_info gdb,no_hardware_watchpoints 1 # New set_board_info gdb,nosignals 1 diff --git a/baseboards/arc-sim.exp b/baseboards/arc-sim.exp index 8ca7c2e..62260b3 100644 --- a/baseboards/arc-sim.exp +++ b/baseboards/arc-sim.exp @@ -24,7 +24,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. diff --git a/baseboards/arm-ice.exp b/baseboards/arm-ice.exp index 8e03737..3480460 100644 --- a/baseboards/arm-ice.exp +++ b/baseboards/arm-ice.exp @@ -20,7 +20,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] $additional_options" # This board doesn't use a linker script. -set_board_info ldscript ""; +set_board_info ldscript "" # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. @@ -33,7 +33,7 @@ set_board_info gdb_protocol "rdi" set_board_info gdb,nosignals 1 # Make this variable go away, we don't need it. -unset additional_options; +unset additional_options # Can't call functions from GDB. set_board_info gdb,cannot_call_functions 1 diff --git a/baseboards/arm-sim.exp b/baseboards/arm-sim.exp index 32b5eeb..af91f7f 100644 --- a/baseboards/arm-sim.exp +++ b/baseboards/arm-sim.exp @@ -21,7 +21,7 @@ if { [board_info $board obj_format] == "pe" } { load_base_board_description "basic-sim" # The name of the directory in the build tree where the simulator lives. -setup_sim arm; +setup_sim arm # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. @@ -31,7 +31,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] $additional_options" # This board doesn't use a linker script. -set_board_info ldscript ""; +set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this. set_board_info needs_status_wrapper 1 @@ -46,4 +46,4 @@ set_board_info gdb,nosignals 1 set_board_info gcc,timeout 800 # Make this variable go away, we don't need it. -unset additional_options; +unset additional_options diff --git a/baseboards/basic-sim.exp b/baseboards/basic-sim.exp index 3fa7c4d..7195adf 100644 --- a/baseboards/basic-sim.exp +++ b/baseboards/basic-sim.exp @@ -4,7 +4,7 @@ # Otherwise we search the build tree, then $PATH. proc find_sim { target_alias sim_dir sim_name } { - global tool_root_dir; + global tool_root_dir global SIM if [info exists SIM] { @@ -13,39 +13,39 @@ proc find_sim { target_alias sim_dir sim_name } { if [is_remote host] { if ![board_info host exists no_transform_name] { - return ${target_alias}-${sim_name}; + return ${target_alias}-${sim_name} } else { - return ${sim_name}; + return ${sim_name} } } # We have to search because tool_root_dir may actually point to that blasted # "target" subdirectory. - set try [lookfor_file ${tool_root_dir} sim/${sim_dir}/${sim_name}]; + set try [lookfor_file ${tool_root_dir} sim/${sim_dir}/${sim_name}] if { $try != "" } { - return $try; + return $try } - return ${target_alias}-${sim_name}; + return ${target_alias}-${sim_name} } proc setup_sim { subdir_name } { - global target_alias; - global tool_root_dir; - global board; + global target_alias + global tool_root_dir + global board if [info exists target_alias] { - set tmp $target_alias; + set tmp $target_alias } else { if [board_info $board exists target_install] { - set tmp [lindex [board_info $board target_install] 0]; + set tmp [lindex [board_info $board target_install] 0] } } if ![board_info $board exists sim] { - set_board_info sim [find_sim $tmp $subdir_name run]; + set_board_info sim [find_sim $tmp $subdir_name run] } verbose "Using simulator [board_info $board sim]\n" } -set_board_info is_simulator 1; +set_board_info is_simulator 1 diff --git a/baseboards/cf.exp b/baseboards/cf.exp index f4d73c3..fbfa426 100644 --- a/baseboards/cf.exp +++ b/baseboards/cf.exp @@ -1,9 +1,9 @@ # This is a list of toolchains that are supported on this board. -set_board_info target_install {m68k-elf}; +set_board_info target_install {m68k-elf} # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board. -load_generic_config "cfdbug"; +load_generic_config "cfdbug" # Need -m5200 by default. process_multilib_options "-m5200" @@ -12,19 +12,19 @@ process_multilib_options "-m5200" # with what compiler is tested when testing gcc. set_board_info compiler "[find_gcc]" -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" # Nasty hack. if { [board_info $board obj_format] == "a.out" } { # Need to pass the start address to objcopy. - set_board_info use_vma_offset 1; + set_board_info use_vma_offset 1 # Wrapping has to be specially done for m68k-aout, for whatever reason. - set_board_info wrap_m68k_aout 1; + set_board_info wrap_m68k_aout 1 set extra_m68k_ld_flags "-N" # We need to tell GDB to load at the correct offset. - set_board_info gdb_load_offset [board_info $board hex_startaddr]; + set_board_info gdb_load_offset [board_info $board hex_startaddr] } else { set extra_m68k_ld_flags "" } @@ -35,7 +35,7 @@ unset extra_m68k_ld_flags # If no output format is specified, use objcopy. if ![board_info $board exists output_format] { - set tempfil [lookfor_file $tool_root_dir binutils/objcopy]; + set tempfil [lookfor_file $tool_root_dir binutils/objcopy] if { $tempfil != "" } { set_board_info objcopy $tempfil } else { @@ -45,17 +45,17 @@ if ![board_info $board exists output_format] { } # SBC5204 linker script. -set_board_info ldscript "-Wl,-Tsbc5204.ld"; +set_board_info ldscript "-Wl,-Tsbc5204.ld" # The idt interface can't return exit statuses, so gcc (ctorture et # al) needs to do what it can to get them. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # Used by a few gcc.c-torture testcases to delimit how large the stack can be. # The board has 192K of RAM. We will set stack size to one third of that. set_board_info gcc,stack_size 65536 # GDB needs to use "target dbug" to talk to the board. -set_board_info gdb_protocol "dbug"; +set_board_info gdb_protocol "dbug" # Can't pass arguments to the program under test. set_board_info noargs 1 @@ -70,4 +70,4 @@ set_board_info gdb,nosignals 1 set_board_info gdb,noresults 1 # Pseudo-random guess. -set_board_info sys_speed_value 200; +set_board_info sys_speed_value 200 diff --git a/baseboards/cygmon.exp b/baseboards/cygmon.exp index 6ee4458..c848bf1 100644 --- a/baseboards/cygmon.exp +++ b/baseboards/cygmon.exp @@ -4,28 +4,28 @@ set_board_info target_install {sparc-elf sparc64-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "cygmon"; +load_generic_config "cygmon" # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "-nostdlib [libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "-nostdlib [libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]" # CygMON linker script. set_board_info ldscript "-Tcygmon.ld" # Standard remote protocol. -set_board_info gdb_protocol "remote"; +set_board_info gdb_protocol "remote" # We can't do input in GDB (yet! HA!). It *will* do output, hurrah. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info noargs 1; +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 set_board_info shell_prompt "cygmon>" -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 diff --git a/baseboards/cygwin.exp b/baseboards/cygwin.exp index 80d4407..7a1726b 100644 --- a/baseboards/cygwin.exp +++ b/baseboards/cygwin.exp @@ -1,12 +1,12 @@ # The canonical unix board description. -load_generic_config "unix"; +load_generic_config "unix" -process_multilib_options ""; +process_multilib_options "" -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" -set_board_info bmk,use_alarm 1; +set_board_info bmk,use_alarm 1 -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 -send_user "configuring for cygwin testing\n"; +send_user "configuring for cygwin testing\n" diff --git a/baseboards/d10v-sim.exp b/baseboards/d10v-sim.exp index f744cdc..20af4f7 100644 --- a/baseboards/d10v-sim.exp +++ b/baseboards/d10v-sim.exp @@ -3,7 +3,7 @@ set_board_info target_install {d10v-elf} # Load the generic configuration for this board. This will define any # routines needed to communicate with the board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" @@ -12,7 +12,7 @@ load_base_board_description "basic-sim" setup_sim d10v # No multilib options needed by default. -process_multilib_options ""; +process_multilib_options "" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. @@ -23,7 +23,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # Can't pass arguments to programs on this target.. set_board_info noargs 1 diff --git a/baseboards/d10v.exp b/baseboards/d10v.exp index 254556e..f6df58b 100644 --- a/baseboards/d10v.exp +++ b/baseboards/d10v.exp @@ -6,15 +6,15 @@ set_board_info target_install {d10v-elf} load_generic_config "d10v" # No multilib options are needed by default for this board. -process_multilib_options ""; +process_multilib_options "" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # The board can't really return exit statuses and we need to indicate this; # however, the standard GCC wrapper won't work with this target because @@ -32,8 +32,8 @@ set_board_info disable_x_packet 1 set_board_info disable_z_packet 1 # Used by gdb-comm. -set_board_info gdb_run_command "jump *_start"; -set_board_info gdb,start_symbol "_start"; +set_board_info gdb_run_command "jump *_start" +set_board_info gdb,start_symbol "_start" # Can't pass arguments to programs on this target. set_board_info noargs 1 diff --git a/baseboards/d30v-sim.exp b/baseboards/d30v-sim.exp index c795165..f0dde67 100644 --- a/baseboards/d30v-sim.exp +++ b/baseboards/d30v-sim.exp @@ -3,7 +3,7 @@ set_board_info target_install {d30v-elf} # Load the generic configuration for this board. This will define any # routines needed to communicate with the board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" @@ -21,7 +21,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags] -Wa,-C" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] -mextmem -Wl,--defsym,__stack=0x80800000" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # Can't pass arguments to programs on this target.. set_board_info noargs 1 diff --git a/baseboards/danlite-elf.exp b/baseboards/danlite-elf.exp index e22db2f..8a70f9e 100644 --- a/baseboards/danlite-elf.exp +++ b/baseboards/danlite-elf.exp @@ -4,39 +4,39 @@ set_board_info target_install {sparc86x-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "slite"; +load_generic_config "slite" # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" -set_board_info ldflags "-nostartfiles [libgloss_link_flags] [newlib_link_flags]"; +set_board_info ldflags "-nostartfiles [libgloss_link_flags] [newlib_link_flags]" # DANlite (sparc86x) linker script. -set_board_info ldscript "-Tsparc86x.ld"; +set_board_info ldscript "-Tsparc86x.ld" # The address at which the stub needs to be linked. -# set_board_info gdb_stub_offset "0x40000000"; +# set_board_info gdb_stub_offset "0x40000000" # The board doesn't return exit statuses and we need to indicate this. # However, the standard GCC wrapper won't work with this target because # it doesn't return stuff from printf (). -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # We use a GDB stub to talk to the board. -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 # For GDB, we need to use a real stub (not the separate loader scheme # we use for Sparclet). -set_board_info gdb_stub ""; +set_board_info gdb_stub "" # And the protocol is "sparclite". -set_board_info gdb_protocol "sparclite"; +set_board_info gdb_protocol "sparclite" # No mathlib. -set_board_info mathlib ""; +set_board_info mathlib "" # We can't do I/O in GDB. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info noargs 1; +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 diff --git a/baseboards/dos.exp b/baseboards/dos.exp index 8702a03..29097fb 100644 --- a/baseboards/dos.exp +++ b/baseboards/dos.exp @@ -5,21 +5,21 @@ set_board_info target_install {i386-cygwin32} # Load the generic configuration for the board. This will define any routines # needed by the tool to communicate with the board. -load_generic_config "dos"; +load_generic_config "dos" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" # The basic set of flags needed to build "hello world" for this # board. This target uses libgloss, libio and winsup. -set_board_info cflags "[newlib_include_flags] [libio_include_flags] [winsup_include_flags]"; +set_board_info cflags "[newlib_include_flags] [libio_include_flags] [winsup_include_flags]" set_board_info ldflags "[newlib_link_flags] [libio_link_flags] [winsup_link_flags]" # We don't need a link script. -set_board_info ldscript ""; +set_board_info ldscript "" # mondfe can't return exit statuses, so gcc (ctorture et al) needs to # do what it can to get them. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 set_board_info gdb_opts "--command gdbinit" set_board_info gdb,nointerrupts 1 diff --git a/baseboards/fr30-cygmon.exp b/baseboards/fr30-cygmon.exp index b18fa59..7664681 100644 --- a/baseboards/fr30-cygmon.exp +++ b/baseboards/fr30-cygmon.exp @@ -4,28 +4,28 @@ set_board_info target_install {fr30-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "cygmon"; +load_generic_config "cygmon" # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]" # CygMON linker script. set_board_info ldscript "-specs=eval1.specs" # Standard remote protocol. -set_board_info gdb_protocol "remote"; +set_board_info gdb_protocol "remote" # We can't do input in GDB (yet! HA!). It *will* do output, hurrah. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info gdb,noargs 1; -set_board_info noargs 1; +set_board_info gdb,noargs 1 +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 set_board_info shell_prompt "cygmon>" -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 diff --git a/baseboards/fr30-sim.exp b/baseboards/fr30-sim.exp index aed4809..f11b1bc 100644 --- a/baseboards/fr30-sim.exp +++ b/baseboards/fr30-sim.exp @@ -21,7 +21,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. diff --git a/baseboards/frv-sim.exp b/baseboards/frv-sim.exp index 7e0dc47..5d800d3 100644 --- a/baseboards/frv-sim.exp +++ b/baseboards/frv-sim.exp @@ -21,7 +21,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # Doesn't pass arguments or signals, can't return results, and doesn't # do inferiorio. diff --git a/baseboards/frv-tiger.exp b/baseboards/frv-tiger.exp index db757b4..e3e87eb 100644 --- a/baseboards/frv-tiger.exp +++ b/baseboards/frv-tiger.exp @@ -4,29 +4,29 @@ set_board_info target_install {frv-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "cygmon"; +load_generic_config "cygmon" # -mcpu=tomcat is needed for the board. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]" # CygMON linker script. set_board_info ldscript "-specs=tiger.specs" # Standard remote protocol. -set_board_info gdb_protocol "remote"; +set_board_info gdb_protocol "remote" # We can't do input in GDB (yet! HA!). It *will* do output, hurrah. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info gdb,noargs 1; -set_board_info noargs 1; +set_board_info gdb,noargs 1 +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 set_board_info shell_prompt "cygmon>" -set_board_info use_gdb_stub 1; -set_board_info gdb,do_reload_on_run 1; +set_board_info use_gdb_stub 1 +set_board_info gdb,do_reload_on_run 1 diff --git a/baseboards/frv-tomcat.exp b/baseboards/frv-tomcat.exp index a0c9612..b76d179 100644 --- a/baseboards/frv-tomcat.exp +++ b/baseboards/frv-tomcat.exp @@ -4,29 +4,29 @@ set_board_info target_install {frv-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "cygmon"; +load_generic_config "cygmon" # -mcpu=tomcat is needed for the board. process_multilib_options "-mcpu=tomcat" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]" # CygMON linker script. set_board_info ldscript "-specs=tomcat.specs" # Standard remote protocol. -set_board_info gdb_protocol "remote"; +set_board_info gdb_protocol "remote" # We can't do input in GDB (yet! HA!). It *will* do output, hurrah. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info gdb,noargs 1; -set_board_info noargs 1; +set_board_info gdb,noargs 1 +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 set_board_info shell_prompt "cygmon>" -set_board_info use_gdb_stub 1; -set_board_info gdb,do_reload_on_run 1; +set_board_info use_gdb_stub 1 +set_board_info gdb,do_reload_on_run 1 diff --git a/baseboards/gdbserver-sample.exp b/baseboards/gdbserver-sample.exp index 48be917..6158f31 100644 --- a/baseboards/gdbserver-sample.exp +++ b/baseboards/gdbserver-sample.exp @@ -1,14 +1,14 @@ # gdbserver running over ssh. -load_generic_config "gdbserver"; +load_generic_config "gdbserver" -process_multilib_options ""; +process_multilib_options "" # The default compiler for this target. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" -#set_board_info compiler "/opt/src/gcc/install-30/bin/gcc"; -#set_board_info c++compiler "/opt/src/gcc/install-30/bin/g++"; +#set_board_info compiler "/opt/src/gcc/install-30/bin/gcc" +#set_board_info c++compiler "/opt/src/gcc/install-30/bin/g++" set_board_info rsh_prog /usr/bin/ssh set_board_info rcp_prog /usr/bin/scp @@ -30,10 +30,10 @@ set_board_info sockethost "voltaire:" # set_board_info gdb,socketport "4004" # Use techniques appropriate to a stub -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 # This gdbserver can only run a process once per session. -set_board_info gdb,do_reload_on_run 1; +set_board_info gdb,do_reload_on_run 1 # There's no support for argument-passing (yet). set_board_info noargs 1 @@ -42,5 +42,5 @@ set_board_info noargs 1 set_board_info gdb,noinferiorio 1 # Can't do hardware watchpoints, in general -set_board_info gdb,no_hardware_watchpoints 1; +set_board_info gdb,no_hardware_watchpoints 1 diff --git a/baseboards/h8300.exp b/baseboards/h8300.exp index f42dbb0..7651df7 100644 --- a/baseboards/h8300.exp +++ b/baseboards/h8300.exp @@ -17,7 +17,7 @@ set_board_info ldflags "[newlib_link_flags]" # The GDB protocol used with this board. set_board_info gdb_protocol "remote" # It's running a GDB stub in ROM. -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 # There's no support for argument-passing. set_board_info noargs 1 @@ -45,8 +45,8 @@ set_board_info gdb,short_int 1 set linker_script "h8300.ld" foreach x $board_variant_list { - regsub -all "^\[ \t\]*" "$x" "" x; - regsub -all "\[ \t\]*$" "$x" "" x; + regsub -all "^\[ \t\]*" "$x" "" x + regsub -all "\[ \t\]*$" "$x" "" x case $x in { { h -mh } { diff --git a/baseboards/i386-bozo.exp b/baseboards/i386-bozo.exp index 1dbfae0..c954d82 100644 --- a/baseboards/i386-bozo.exp +++ b/baseboards/i386-bozo.exp @@ -7,12 +7,12 @@ load_generic_config "i386-bozo" process_multilib_options "" # Default to COFF. -set add_flags ""; +set add_flags "" if { [board_info $board obj_format] == "a.out" } { set_board_info support_libs "${prefix_dir}/i386-aout/" - set_board_info gdb_load_offset "0x41000000"; - set_board_info gdb_sect_offset "0x41000000"; - set add_flags "-N "; + set_board_info gdb_load_offset "0x41000000" + set_board_info gdb_sect_offset "0x41000000" + set add_flags "-N " } elseif { [board_info $board obj_format] == "elf" } { set_board_info support_libs "${prefix_dir}/i386-elf/" } else { @@ -32,7 +32,7 @@ set_board_info ldscript "-Tbozo.ld" # The GDB protocol used with this board. set_board_info gdb_protocol "remote" # It's running a GDB stub in ROM. -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 # There's no support for argument-passing. set_board_info noargs 1 @@ -48,4 +48,4 @@ set_board_info gcc,stack_size 16384 set_board_info needs_status_wrapper 1 # This is the start symbol in crt0.o. -set_board_info gdb,start_symbol "_start"; +set_board_info gdb,start_symbol "_start" diff --git a/baseboards/i960-cyclone.exp b/baseboards/i960-cyclone.exp index 6ce5ce7..2dd4f59 100644 --- a/baseboards/i960-cyclone.exp +++ b/baseboards/i960-cyclone.exp @@ -10,7 +10,7 @@ process_multilib_options "" # We want to strip executables before downloading them via xmodem. if ![board_info $board exists strip] { - set tempfil [lookfor_file $tool_root_dir binutils/strip]; + set tempfil [lookfor_file $tool_root_dir binutils/strip] if { $tempfil != "" } { set_board_info strip $tempfil } else { diff --git a/baseboards/i960-sim.exp b/baseboards/i960-sim.exp index 98ca8de..9767e8a 100644 --- a/baseboards/i960-sim.exp +++ b/baseboards/i960-sim.exp @@ -1,28 +1,28 @@ # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. -load_base_board_description "basic-sim"; +load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. -setup_sim i960; +setup_sim i960 # No multilib flags are set by default. # Set -msoft-float, because the simulator doesn't have FP support yet. -process_multilib_options "-msoft-float"; +process_multilib_options "-msoft-float" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" -set_board_info cflags "-mka [libgloss_include_flags] [newlib_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"; +set_board_info cflags "-mka [libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use mon960. -set_board_info ldscript "-Wl,-Tmon960.ld"; +set_board_info ldscript "-Wl,-Tmon960.ld" # And, it can't do arguments, and doesn't have real signals. # ??? Unknown if this is right. -set_board_info noargs 1; -set_board_info gdb,nosignals 1; +set_board_info noargs 1 +set_board_info gdb,nosignals 1 diff --git a/baseboards/jmr3904-sim.exp b/baseboards/jmr3904-sim.exp index 244e2b5..4118de4 100644 --- a/baseboards/jmr3904-sim.exp +++ b/baseboards/jmr3904-sim.exp @@ -11,4 +11,4 @@ set_board_info libjava,options "-G 0" set_board_info gcc,stack_size "8192" # Otherwise we're the same as the standard MIPS simulator. -load_base_board_description "mips-sim"; +load_base_board_description "mips-sim" diff --git a/baseboards/linux-gdbserver.exp b/baseboards/linux-gdbserver.exp index abf06d7..6f541da 100644 --- a/baseboards/linux-gdbserver.exp +++ b/baseboards/linux-gdbserver.exp @@ -1,11 +1,11 @@ # gdbserver running native. -load_generic_config "gdbserver"; +load_generic_config "gdbserver" -process_multilib_options ""; +process_multilib_options "" # The default compiler for this target. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" # We will be using the standard GDB remote protocol set_board_info gdb_protocol "remote" @@ -21,10 +21,10 @@ set_board_info sockethost "localhost:" # set_board_info gdb,socketport "4004" # Use techniques appropriate to a stub -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 # This gdbserver can only run a process once per session. -set_board_info gdb,do_reload_on_run 1; +set_board_info gdb,do_reload_on_run 1 # There's no support for argument-passing (yet). set_board_info noargs 1 @@ -33,4 +33,4 @@ set_board_info noargs 1 set_board_info gdb,noinferiorio 1 # Can't do hardware watchpoints, in general -set_board_info gdb,no_hardware_watchpoints 1; +set_board_info gdb,no_hardware_watchpoints 1 diff --git a/baseboards/linux-libremote.exp b/baseboards/linux-libremote.exp index 8310969..2c408c5 100644 --- a/baseboards/linux-libremote.exp +++ b/baseboards/linux-libremote.exp @@ -1,11 +1,11 @@ # Libremote gdbserver running native. -load_generic_config "gdbserver"; +load_generic_config "gdbserver" -process_multilib_options ""; +process_multilib_options "" # The default compiler for this target. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" # We will be using the standard GDB remote protocol set_board_info gdb_protocol "remote" @@ -21,10 +21,10 @@ set_board_info gdb_server_prog \ # set_board_info gdb,socketport "4004" # Use techniques appropriate to a stub -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 # This gdbserver can only run a process once per session. -set_board_info gdb,do_reload_on_run 1; +set_board_info gdb,do_reload_on_run 1 # There's no support for argument-passing (yet). set_board_info noargs 1 @@ -33,4 +33,4 @@ set_board_info noargs 1 set_board_info gdb,noinferiorio 1 # Can't do hardware watchpoints, in general -set_board_info gdb,no_hardware_watchpoints 1; +set_board_info gdb,no_hardware_watchpoints 1 diff --git a/baseboards/m32r-sim.exp b/baseboards/m32r-sim.exp index 5bc73d4..e80c38d 100644 --- a/baseboards/m32r-sim.exp +++ b/baseboards/m32r-sim.exp @@ -21,7 +21,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. diff --git a/baseboards/m68hc11-sim.exp b/baseboards/m68hc11-sim.exp index 8f4477c..11d6896 100644 --- a/baseboards/m68hc11-sim.exp +++ b/baseboards/m68hc11-sim.exp @@ -3,7 +3,7 @@ set_board_info target_install {m6811-elf} # Load the generic configuration for this board. This will define any # routines needed to communicate with the board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. load_base_board_description "basic-sim" @@ -17,15 +17,15 @@ set_board_info compiler "[find_gcc]" # We only support newlib on this target. We assume that all multilib # options have been specified before we get here. -set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"; +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" # The GCC testsuite programs create quite large executables for the 68HC11. # We have to give enough room for the text section and we must make sure # that the data section does not overlay the 68HC11 IO registers. We could # relocate the IO registers but this would add some complexity to the crt0. -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] -Wl,-Ttext,0x2000 -Wl,-Tdata,0x1100"; +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] -Wl,-Ttext,0x2000 -Wl,-Tdata,0x1100" # No linker script needed. -set_board_info ldscript "-Wl,--script,sim-valid.x"; +set_board_info ldscript "-Wl,--script,sim-valid.x" # Can't pass arguments to programs on this target.. set_board_info noargs 1 diff --git a/baseboards/m68k-emc.exp b/baseboards/m68k-emc.exp index 7b57649..cdba398 100644 --- a/baseboards/m68k-emc.exp +++ b/baseboards/m68k-emc.exp @@ -1,6 +1,6 @@ # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board. -load_generic_config "m68k-emc"; +load_generic_config "m68k-emc" # No multilib options by default. process_multilib_options "" @@ -9,18 +9,18 @@ process_multilib_options "" # with what compiler is tested when testing gcc. set_board_info compiler "[find_gcc]" -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" set_board_info ldflags "-nostdlib [libgloss_link_flags] [newlib_link_flags]" # No linker script. -set_board_info ldscript ""; +set_board_info ldscript "" # The idt interface can't return exit statuses, so gcc (ctorture et # al) needs to do what it can to get them. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # GDB needs to use "target remote" to talk to the board. -set_board_info gdb_protocol "remote"; +set_board_info gdb_protocol "remote" # Can't pass arguments to the program under test. set_board_info noargs 1 diff --git a/baseboards/mcore-moto-sim.exp b/baseboards/mcore-moto-sim.exp index a362f4f..92fac5f 100644 --- a/baseboards/mcore-moto-sim.exp +++ b/baseboards/mcore-moto-sim.exp @@ -20,7 +20,7 @@ set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. @@ -55,11 +55,11 @@ proc sim_spawn { dest cmdline args } { puts $handle "quit" close $handle - return [eval remote_spawn host \{ $sim $simflags "-sdoit" \} $args]; + return [eval remote_spawn host \{ $sim $simflags "-sdoit" \} $args] } proc sim_wait { dest timeout } { - return [remote_wait host $timeout]; + return [remote_wait host $timeout] } proc sim_load { dest prog args } { @@ -67,25 +67,25 @@ proc sim_load { dest prog args } { 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" ""]; + return [list "untested" ""] } set sim_time_limit 240 - set output ""; + set output "" - set res [remote_spawn target "${prog}"]; + set res [remote_spawn target "${prog}"] if { $res <= 0 } { - return [list "fail" "remote_spawn failed"]; + return [list "fail" "remote_spawn failed"] } - set state [remote_wait target $sim_time_limit]; - set status [lindex $state 0]; - set output [lindex $state 1]; - verbose "Output is $output"; + set state [remote_wait target $sim_time_limit] + set status [lindex $state 0] + set output [lindex $state 1] + verbose "Output is $output" - set status2 [check_for_board_status output]; + set status2 [check_for_board_status output] if { $status2 >= 0 } { set status $status2 } @@ -99,10 +99,10 @@ proc sim_load { dest prog args } { } else { set result "fail" } - return [list $result $output]; + return [list $result $output] } -set_board_info protocol "sim"; +set_board_info protocol "sim" # By default, assume the simulator is slow. This causes some tests # to either be simplified or skipped completely. @@ -119,7 +119,7 @@ proc find_sim { target_alias sim_dir sim_name } { ## XXX - fixme - this should not be hardcoded. ## XXX - fixme - this should vary depending upon endianism selected. - return "/home/nickc/bin/linux/sim-be"; + return "/home/nickc/bin/linux/sim-be" } -set_board_info is_simulator 1; +set_board_info is_simulator 1 diff --git a/baseboards/mcore-sim.exp b/baseboards/mcore-sim.exp index 21ef68a..b5a015b 100644 --- a/baseboards/mcore-sim.exp +++ b/baseboards/mcore-sim.exp @@ -21,7 +21,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. diff --git a/baseboards/mips-idt.exp b/baseboards/mips-idt.exp index 17c6ca8..9cd10d0 100644 --- a/baseboards/mips-idt.exp +++ b/baseboards/mips-idt.exp @@ -1,30 +1,30 @@ # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board. -load_generic_config "mips-idt"; +load_generic_config "mips-idt" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" # We don't use any multilib options by default. process_multilib_options "" -set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"; +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use idt. if { [board_info $board obj_format] == "ecoff" } { - set_board_info ldscript "-Wl,-Tidtecoff.ld"; + set_board_info ldscript "-Wl,-Tidtecoff.ld" } else { - set_board_info ldscript "-Wl,-Tidt.ld"; + set_board_info ldscript "-Wl,-Tidt.ld" } # The idt interface can't return exit statuses, so gcc (ctorture et # al) needs to do what it can to get them. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # GDB needs to use "target mips" to talk to the board. -set_board_info gdb_protocol "mips"; +set_board_info gdb_protocol "mips" # And, it can't do arguments, and doesn't have real signals. set_board_info noargs 1 diff --git a/baseboards/mips-lnews-sim.exp b/baseboards/mips-lnews-sim.exp index b4685df..e0cec94 100644 --- a/baseboards/mips-lnews-sim.exp +++ b/baseboards/mips-lnews-sim.exp @@ -2,4 +2,4 @@ set_board_info ldscript "-Wl,-Tlnews.ld" # Otherwise, it's the same as the standard mips simulator. -load_base_board_description "mips-sim"; +load_base_board_description "mips-sim" diff --git a/baseboards/mips-lsi-sim.exp b/baseboards/mips-lsi-sim.exp index 47cae89..42a141d 100644 --- a/baseboards/mips-lsi-sim.exp +++ b/baseboards/mips-lsi-sim.exp @@ -5,4 +5,4 @@ add_multilib_option "-mips16" set_board_info ldscript "-Wl,-Tlsi.ld" # Otherwise we're the same as the standard MIPS simulator. -load_base_board_description "mips-sim"; +load_base_board_description "mips-sim" diff --git a/baseboards/mips-sim-idt32.exp b/baseboards/mips-sim-idt32.exp index 98e6ea8..72e3009 100644 --- a/baseboards/mips-sim-idt32.exp +++ b/baseboards/mips-sim-idt32.exp @@ -1,34 +1,34 @@ # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. -load_base_board_description "basic-sim"; +load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. -setup_sim mips; +setup_sim mips # No multilib flags are set by default. -process_multilib_options ""; +process_multilib_options "" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" #set_board_info needs_status_wrapper 1 -set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"; +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use idt. if { [board_info $board obj_format] == "ecoff" } { - set_board_info ldscript "-Tidtecoff.ld"; + set_board_info ldscript "-Tidtecoff.ld" } else { - set_board_info ldscript "-Tidt32.ld"; + set_board_info ldscript "-Tidt32.ld" } # And, it can't do arguments, and doesn't have real signals. -set_board_info noargs 1; -set_board_info gdb,nosignals 1; +set_board_info noargs 1 +set_board_info gdb,nosignals 1 # Tell gdb to assume no fpu for -msoft-float compilation if {[string match "*soft-float*" $current_target_name]} { diff --git a/baseboards/mips-sim-idt64.exp b/baseboards/mips-sim-idt64.exp index a0f9d0c..94042f2 100644 --- a/baseboards/mips-sim-idt64.exp +++ b/baseboards/mips-sim-idt64.exp @@ -1,34 +1,34 @@ # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. -load_base_board_description "basic-sim"; +load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. -setup_sim mips; +setup_sim mips # No multilib flags are set by default. -process_multilib_options ""; +process_multilib_options "" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" #set_board_info needs_status_wrapper 1 -set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"; +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use idt. if { [board_info $board obj_format] == "ecoff" } { - set_board_info ldscript "-Tidtecoff.ld"; + set_board_info ldscript "-Tidtecoff.ld" } else { - set_board_info ldscript "-Tidt64.ld"; + set_board_info ldscript "-Tidt64.ld" } # And, it can't do arguments, and doesn't have real signals. -set_board_info noargs 1; -set_board_info gdb,nosignals 1; +set_board_info noargs 1 +set_board_info gdb,nosignals 1 # Tell gdb to assume no fpu for -msoft-float compilation if {[string match "*soft-float*" $current_target_name]} { diff --git a/baseboards/mips-sim.exp b/baseboards/mips-sim.exp index 1df7e97..b9c549b 100644 --- a/baseboards/mips-sim.exp +++ b/baseboards/mips-sim.exp @@ -1,30 +1,30 @@ # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. -load_base_board_description "basic-sim"; +load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. -setup_sim mips; +setup_sim mips # No multilib flags are set by default. -process_multilib_options ""; +process_multilib_options "" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" -set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"; +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # Use idt. if { [board_info $board obj_format] == "ecoff" } { - set_board_info ldscript "-Tidtecoff.ld"; + set_board_info ldscript "-Tidtecoff.ld" } else { - set_board_info ldscript "-Tidt.ld"; + set_board_info ldscript "-Tidt.ld" } # And, it can't do arguments, and doesn't have real signals. -set_board_info noargs 1; -set_board_info gdb,nosignals 1; +set_board_info noargs 1 +set_board_info gdb,nosignals 1 diff --git a/baseboards/mips64-sim.exp b/baseboards/mips64-sim.exp index 99f8831..b3364bb 100644 --- a/baseboards/mips64-sim.exp +++ b/baseboards/mips64-sim.exp @@ -4,26 +4,26 @@ set_board_info target_install {mips64vr4300-elf # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. -load_base_board_description "basic-sim"; +load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. -setup_sim mips; +setup_sim mips # No multilib flags are set by default. -process_multilib_options ""; +process_multilib_options "" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" -set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"; +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # PMON linker script. set_board_info ldscript "-Tpmon.ld" # And, it can't do arguments or signals in GDB. -set_board_info noargs 1; -set_board_info gdb,nosignals 1; +set_board_info noargs 1 +set_board_info gdb,nosignals 1 diff --git a/baseboards/mips64vr4100-sim.exp b/baseboards/mips64vr4100-sim.exp index 6e1d5eb..7cc39f8 100644 --- a/baseboards/mips64vr4100-sim.exp +++ b/baseboards/mips64vr4100-sim.exp @@ -29,5 +29,5 @@ set board_info($board,ldscript) "-Wl,-Tidt.ld" # the standard GCC wrapper will work with this target. set board_info($board,needs_status_wrapper) 1 set board_info($board,gdb,noargs) 1 -set_board_info gdb,nosignals 1; -set_board_info noargs 1; +set_board_info gdb,nosignals 1 +set_board_info noargs 1 diff --git a/baseboards/mn10200-cygmon.exp b/baseboards/mn10200-cygmon.exp index 1d122e3..4c3dd8a 100644 --- a/baseboards/mn10200-cygmon.exp +++ b/baseboards/mn10200-cygmon.exp @@ -4,29 +4,29 @@ set_board_info target_install {mn10200-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "mn10200-eval"; +load_generic_config "mn10200-eval" # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]" # CygMON linker script. set_board_info ldscript "-Teval.ld" # Standard remote protocol. -set_board_info gdb_protocol "remote"; +set_board_info gdb_protocol "remote" # We can't do input in GDB (yet! HA!). It *will* do output, hurrah. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info gdb,noargs 1; -set_board_info noargs 1; +set_board_info gdb,noargs 1 +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 set_board_info shell_prompt "cygmon>" -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 diff --git a/baseboards/mn10200-sim.exp b/baseboards/mn10200-sim.exp index 01c5673..f307b30 100644 --- a/baseboards/mn10200-sim.exp +++ b/baseboards/mn10200-sim.exp @@ -42,4 +42,4 @@ set_board_info no_double 1 # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. -set_board_info gcc,stack_size 4096; +set_board_info gcc,stack_size 4096 diff --git a/baseboards/mn10300-cygmon.exp b/baseboards/mn10300-cygmon.exp index 2f0b45f..3a435ea 100644 --- a/baseboards/mn10300-cygmon.exp +++ b/baseboards/mn10300-cygmon.exp @@ -4,35 +4,35 @@ set_board_info target_install {mn10300-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "mn10300-eval"; +load_generic_config "mn10300-eval" # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]" # CygMON linker script. set_board_info ldscript "-Teval.ld" if {[string compare [board_info $board boardtype] "asb2303"] == 0} { - set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags] -mno-crt0 -mam33-2"; + set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags] -mno-crt0 -mam33-2" set_board_info ldscript "-mam33-2 -Tasb2303.ld" } # Standard remote protocol. -set_board_info gdb_protocol "remote"; +set_board_info gdb_protocol "remote" # We can't do input in GDB (yet! HA!). It *will* do output, hurrah. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info gdb,noargs 1; -set_board_info noargs 1; +set_board_info gdb,noargs 1 +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 set_board_info shell_prompt "cygmon>" -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 diff --git a/baseboards/mn10300-sim.exp b/baseboards/mn10300-sim.exp index a4f3bfd..177f5bc 100644 --- a/baseboards/mn10300-sim.exp +++ b/baseboards/mn10300-sim.exp @@ -38,4 +38,4 @@ set_board_info gdb,noinferiorio 1 # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. -set_board_info gcc,stack_size 4096; +set_board_info gcc,stack_size 4096 diff --git a/baseboards/msparc-cygmon.exp b/baseboards/msparc-cygmon.exp index 55fc491..0e8d7c4 100644 --- a/baseboards/msparc-cygmon.exp +++ b/baseboards/msparc-cygmon.exp @@ -1 +1 @@ -load_base_board_description "cygmon"; +load_base_board_description "cygmon" diff --git a/baseboards/op50n.exp b/baseboards/op50n.exp index dee8ca3..836c8ce 100644 --- a/baseboards/op50n.exp +++ b/baseboards/op50n.exp @@ -1,13 +1,13 @@ # Load the tool-specific configuration for this board, as well as the # generic configuration. This will define any routines needed by the # tool to communicate with the board. -load_generic_config "proelf"; +load_generic_config "proelf" # GDB needs to use "target op50n" to talk to the board. -set_board_info gdb_protocol "op50n"; +set_board_info gdb_protocol "op50n" if ![board_info $board exists output_format] { - set tempfil [lookfor_file $tool_root_dir binutils/objcopy]; + set tempfil [lookfor_file $tool_root_dir binutils/objcopy] if { $tempfil != "" } { set_board_info objcopy $tempfil } else { @@ -18,19 +18,19 @@ if ![board_info $board exists output_format] { # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # It's an op50n board. -set_board_info ldscript "-Wl,-Top50n.ld"; +set_board_info ldscript "-Wl,-Top50n.ld" # The proelf interface has no way to return status information, so we # need to indicate this. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # No support for signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 # Nor can we do I/O. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # The monitor interface is really slow. -set_board_info gdb,timeout 540; +set_board_info gdb,timeout 540 diff --git a/baseboards/powerpc-bug.exp b/baseboards/powerpc-bug.exp index 2428f72..87eb11d 100644 --- a/baseboards/powerpc-bug.exp +++ b/baseboards/powerpc-bug.exp @@ -1,10 +1,10 @@ -load_generic_config "powerpc-bug"; +load_generic_config "powerpc-bug" # This is a list of toolchains that are supported on this board. -set_board_info target_install {powerpc-eabi}; +set_board_info target_install {powerpc-eabi} # We need mvme by default. -process_multilib_options "mvme"; +process_multilib_options "mvme" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. @@ -14,7 +14,7 @@ set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script needed for this board. -set_board_info ldscript ""; +set_board_info ldscript "" # Can't pass arguments to programs on this target.. set_board_info noargs 1 diff --git a/baseboards/powerpc-sim.exp b/baseboards/powerpc-sim.exp index e52d0b5..f3faa7c 100644 --- a/baseboards/powerpc-sim.exp +++ b/baseboards/powerpc-sim.exp @@ -22,7 +22,7 @@ set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "-msim [libgloss_link_flags] [newlib_link_flags]" # No support for signals on this target. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 # Can't call functions from GDB. # set_board_info gdb,cannot_call_functions 1 diff --git a/baseboards/powerpcle-sim.exp b/baseboards/powerpcle-sim.exp index 20754fa..d1ae076 100644 --- a/baseboards/powerpcle-sim.exp +++ b/baseboards/powerpcle-sim.exp @@ -22,7 +22,7 @@ set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "-msim [libgloss_link_flags] [newlib_link_flags]" # No support for signals on this target. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 # Can't call functions from GDB. set_board_info gdb,cannot_call_functions 1 diff --git a/baseboards/rom68k-idp.exp b/baseboards/rom68k-idp.exp index 4f0d1ad..aadd656 100644 --- a/baseboards/rom68k-idp.exp +++ b/baseboards/rom68k-idp.exp @@ -1,9 +1,9 @@ # This is a list of toolchains that are supported on this board. -set_board_info target_install {m68k-coff m68k-elf}; +set_board_info target_install {m68k-coff m68k-elf} # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board. -load_generic_config "rom68k"; +load_generic_config "rom68k" # Need soft-float by default. process_multilib_options "-msoft-float" @@ -12,19 +12,19 @@ process_multilib_options "-msoft-float" # with what compiler is tested when testing gcc. set_board_info compiler "[find_gcc]" -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" # Nasty hack. if { [board_info $board obj_format] == "a.out" } { # Need to pass the start address to objcopy. - set_board_info use_vma_offset 1; + set_board_info use_vma_offset 1 # Wrapping has to be specially done for m68k-aout, for whatever reason. - set_board_info wrap_m68k_aout 1; + set_board_info wrap_m68k_aout 1 set extra_m68k_ld_flags "-N -nostdlib " # We need to tell GDB to load at the correct offset. - set_board_info gdb_load_offset [board_info $board hex_startaddr]; + set_board_info gdb_load_offset [board_info $board hex_startaddr] } else { set extra_m68k_ld_flags "" } @@ -35,7 +35,7 @@ unset extra_m68k_ld_flags # If no output format is specified, use objcopy. if ![board_info $board exists output_format] { - set tempfil [lookfor_file $tool_root_dir binutils/objcopy]; + set tempfil [lookfor_file $tool_root_dir binutils/objcopy] if { $tempfil != "" } { set_board_info objcopy $tempfil } else { @@ -45,13 +45,13 @@ if ![board_info $board exists output_format] { } # IDP linker script. -set_board_info ldscript "-Wl,-Tidp.ld"; +set_board_info ldscript "-Wl,-Tidp.ld" # The idt interface can't return exit statuses, so gcc (ctorture et # al) needs to do what it can to get them. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # GDB needs to use "target rom68k" to talk to the board. -set_board_info gdb_protocol "rom68k"; +set_board_info gdb_protocol "rom68k" # Can't pass arguments to the program under test. set_board_info noargs 1 @@ -66,4 +66,4 @@ set_board_info gdb,nosignals 1 set_board_info gdb,noresults 1 # Pseudo-random guess. -set_board_info sys_speed_value 200; +set_board_info sys_speed_value 200 diff --git a/baseboards/sh-hms-sim.exp b/baseboards/sh-hms-sim.exp index 69da8d6..aa1d79a 100644 --- a/baseboards/sh-hms-sim.exp +++ b/baseboards/sh-hms-sim.exp @@ -24,7 +24,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" set_board_info ldflags "[newlib_link_flags]" # No linker script for this board. -set_board_info ldscript ""; +set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this. # Doesn't work on SH yet. # set_board_info needs_status_wrapper 1 @@ -40,7 +40,7 @@ set_board_info gdb,cannot_call_functions 1 set_board_info gcc,stack_size 16384 # Need to pass -mieee in order to for the compiler to be IEEE-fp compliant. -set_board_info ieee_multilib_flags "-mieee"; +set_board_info ieee_multilib_flags "-mieee" #We want to pass "18" to GDB"s "targt sim" command. set_board_info gdb,target_sim_options "18" diff --git a/baseboards/sh-hms.exp b/baseboards/sh-hms.exp index 4653707..662f1d4 100644 --- a/baseboards/sh-hms.exp +++ b/baseboards/sh-hms.exp @@ -44,4 +44,4 @@ set_board_info gcc,stack_size 16384 set_board_info exit_statuses_bad 1 # Need to pass -mieee in order to for the compiler to be IEEE-fp compliant. -set_board_info ieee_multilib_flags "-mieee"; +set_board_info ieee_multilib_flags "-mieee" diff --git a/baseboards/sparc-sim.exp b/baseboards/sparc-sim.exp index 878d452..78e4d3e 100644 --- a/baseboards/sparc-sim.exp +++ b/baseboards/sparc-sim.exp @@ -4,31 +4,31 @@ set_board_info target_install {sparc-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. -load_base_board_description "basic-sim"; +load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. -setup_sim erc32; +setup_sim erc32 # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "-nostdlib -nostartfiles [libgloss_link_flags] [newlib_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "-nostdlib -nostartfiles [libgloss_link_flags] [newlib_link_flags]" # ELF simulator linker script. -set_board_info ldscript "-Telfsim.ld"; +set_board_info ldscript "-Telfsim.ld" # The simulator doesn't return exit statuses and we need to indicate this. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # We can't pass arguments. -set_board_info noargs 1; +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 # We want to specify the sparclite emulator in GDB. #set_board_info gdb,target_sim_options "-sparclite" diff --git a/baseboards/sparc64-sim.exp b/baseboards/sparc64-sim.exp index 914a571..937bf86 100644 --- a/baseboards/sparc64-sim.exp +++ b/baseboards/sparc64-sim.exp @@ -19,7 +19,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script. -set_board_info ldscript ""; +set_board_info ldscript "" # Used by a few gcc.c-torture testcases to delimit how large the stack can # be. diff --git a/baseboards/sparclet-aout.exp b/baseboards/sparclet-aout.exp index 153549c..4ac59c4 100644 --- a/baseboards/sparclet-aout.exp +++ b/baseboards/sparclet-aout.exp @@ -3,7 +3,7 @@ set_board_info target_install {sparclet-aout} # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board,. -load_generic_config "sparclet"; +load_generic_config "sparclet" # It needs broken-saverestore by default. process_multilib_options "-mbroken-saverestore" @@ -31,18 +31,18 @@ set_board_info gdb_load_offset "0x12020000" # And the place in memory where we load the stub. set_board_info gdb_stub_offset "0x12010000" # No mathlib. -set_board_info mathlib ""; +set_board_info mathlib "" # We can't do I/O in GDB. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info noargs 1; +set_board_info noargs 1 set_board_info gcc,no_varargs 1 set_board_info gcc,no_label_values 1 # This is the old GDB prompt for the toolchain. # Uncomment for old tests -set_board_info gdb_prompt "\\(gdb\\)"; +set_board_info gdb_prompt "\\(gdb\\)" # We always have to set a breakpoint at exit(), instead of just _exit(). -set_board_info always_break_exit 1; +set_board_info always_break_exit 1 diff --git a/baseboards/sparclite-coff.exp b/baseboards/sparclite-coff.exp index 61eafc4..b1db2b0 100644 --- a/baseboards/sparclite-coff.exp +++ b/baseboards/sparclite-coff.exp @@ -4,38 +4,38 @@ set_board_info target_install {sparclite-coff} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "slite"; +load_generic_config "slite" # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "-nostdlib [libgloss_link_flags] [newlib_link_flags] -Wl,-Ttext,0x40005000 -N"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "-nostdlib [libgloss_link_flags] [newlib_link_flags] -Wl,-Ttext,0x40005000 -N" # ex930 linker script. -set_board_info ldscript "-Tex930.ld"; +set_board_info ldscript "-Tex930.ld" # The address at which the stub needs to be linked. -set_board_info gdb_stub_offset "0x40000000"; +set_board_info gdb_stub_offset "0x40000000" # The board doesn't return exit statuses and we need to indicate this. # However, the standard GCC wrapper won't work with this target because # it doesn't return stuff from printf (). -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # We use a GDB stub to talk to the board. -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 # For GDB, we need to use a real stub (not the separate loader scheme # we use for Sparclet). -set_board_info gdb_stub ""; +set_board_info gdb_stub "" # And the protocol is "sparclite serial". -set_board_info gdb_protocol "sparclite serial"; +set_board_info gdb_protocol "sparclite serial" # No mathlib. -set_board_info mathlib ""; +set_board_info mathlib "" # We can't do I/O in GDB. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info noargs 1; +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 diff --git a/baseboards/sparclite-sim-le.exp b/baseboards/sparclite-sim-le.exp index 5daec2e..60d29ee 100644 --- a/baseboards/sparclite-sim-le.exp +++ b/baseboards/sparclite-sim-le.exp @@ -4,44 +4,44 @@ set_board_info target_install {sparclite-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. -load_base_board_description "basic-sim"; +load_base_board_description "basic-sim" if ![info exists board_info($board,multilib_flags)] { set board_info($board,multilib_flags) "-mlittle-endian-data" } # This tells it which directory to look in for the simulator. -setup_sim erc32; +setup_sim erc32 # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "-nostdlib -nostartfiles [libgloss_link_flags] [newlib_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "-nostdlib -nostartfiles [libgloss_link_flags] [newlib_link_flags]" # ELF simulator linker script. -set_board_info ldscript "-Telfsim.ld"; +set_board_info ldscript "-Telfsim.ld" # The simulator doesn't return exit statuses and we need to indicate this. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # We use a GDB stub to talk to the board. -# set_board_info use_gdb_stub 1; +# set_board_info use_gdb_stub 1 # For GDB, we need to use a real stub (not the separate loader scheme # we use for Sparclet). -# set_board_info gdb_stub ""; +# set_board_info gdb_stub "" # No mathlib. -# set_board_info mathlib ""; +# set_board_info mathlib "" # We can't do I/O in GDB. -# set_board_info gdb,noinferiorio 1; +# set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info noargs 1; +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 #We want to specify the sparclite emulator in GDB. set_board_info gdb,target_sim_options "-sparclite" diff --git a/baseboards/sparclite-sim.exp b/baseboards/sparclite-sim.exp index a977ffa..d5171a9 100644 --- a/baseboards/sparclite-sim.exp +++ b/baseboards/sparclite-sim.exp @@ -4,31 +4,31 @@ set_board_info target_install {sparclite-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. -load_base_board_description "basic-sim"; +load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. -setup_sim erc32; +setup_sim erc32 # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "-nostdlib -nostartfiles [libgloss_link_flags] [newlib_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "-nostdlib -nostartfiles [libgloss_link_flags] [newlib_link_flags]" # ELF simulator linker script. -set_board_info ldscript "-Telfsim.ld"; +set_board_info ldscript "-Telfsim.ld" # The simulator doesn't return exit statuses and we need to indicate this. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # We can't pass arguments. -set_board_info noargs 1; +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 # We want to specify the sparclite emulator in GDB. set_board_info gdb,target_sim_options "-sparclite" diff --git a/baseboards/strongarm-cygmon.exp b/baseboards/strongarm-cygmon.exp index 8e41199..c3ebecf 100644 --- a/baseboards/strongarm-cygmon.exp +++ b/baseboards/strongarm-cygmon.exp @@ -4,14 +4,14 @@ set_board_info target_install {strongarm-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "cygmon"; +load_generic_config "cygmon" # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]" # CygMON linker script. @@ -26,16 +26,16 @@ if {[string compare [board_info $board boardtype] "sa1100dp"] == 0} { } # Standard remote protocol. -set_board_info gdb_protocol "remote"; +set_board_info gdb_protocol "remote" # We can't do input in GDB (yet! HA!). It *will* do output, hurrah. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info gdb,noargs 1; -set_board_info noargs 1; +set_board_info gdb,noargs 1 +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 set_board_info shell_prompt "cygmon>" -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 set_board_info use_cygmon 1 diff --git a/baseboards/tic80-sim.exp b/baseboards/tic80-sim.exp index dc2cecc..2f5abc7 100644 --- a/baseboards/tic80-sim.exp +++ b/baseboards/tic80-sim.exp @@ -1,28 +1,28 @@ # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. -load_generic_config "sim"; +load_generic_config "sim" # basic-sim.exp is a basic description for the standard Cygnus simulator. -load_base_board_description "basic-sim"; +load_base_board_description "basic-sim" # This tells it which directory to look in for the simulator. -setup_sim tic80; +setup_sim tic80 # No multilib flags are set by default. -process_multilib_options ""; +process_multilib_options "" # The compiler used to build for this board. This has *nothing* to do # with what compiler is tested if we're testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" -set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"; +set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # No linker script is needed. -# set_board_info ldscript ""; +# set_board_info ldscript "" # And, it can't do arguments, and doesn't have real signals. -set_board_info noargs 1; -set_board_info gdb,nosignals 1; +set_board_info noargs 1 +set_board_info gdb,nosignals 1 # Used by a few gcc.c-torture testcases when trampolines are used. set_board_info gcc,no_varargs 1 diff --git a/baseboards/tx39-dve.exp b/baseboards/tx39-dve.exp index 8973e43..2496b9b 100644 --- a/baseboards/tx39-dve.exp +++ b/baseboards/tx39-dve.exp @@ -4,9 +4,9 @@ set_board_info target_install {mips-tx39-elf mips-elf} # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. if { [board_info $board cygmon] == "yes" } { - load_generic_config "cygmon"; + load_generic_config "cygmon" } else { - load_generic_config "dve"; + load_generic_config "dve" } # It's a big-endian board. @@ -18,11 +18,11 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # DDB linker script. -set_board_info ldscript "-Wl,-Tdve.ld"; +set_board_info ldscript "-Wl,-Tdve.ld" # GDB doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # The GDB protocol used with this board. if { [board_info $board cygmon] == "yes" } { diff --git a/baseboards/tx39-sim.exp b/baseboards/tx39-sim.exp index 8af9912..549def3 100644 --- a/baseboards/tx39-sim.exp +++ b/baseboards/tx39-sim.exp @@ -5,4 +5,4 @@ add_multilib_option "" set_board_info ldscript "-Wl,-Tdve.ld" # Otherwise we're the same as the standard MIPS simulator. -load_base_board_description "mips-sim"; +load_base_board_description "mips-sim" diff --git a/baseboards/unix.exp b/baseboards/unix.exp index 48c6e99..a1b8005 100644 --- a/baseboards/unix.exp +++ b/baseboards/unix.exp @@ -1,23 +1,23 @@ # The canonical unix board description. -load_generic_config "unix"; +load_generic_config "unix" -process_multilib_options ""; +process_multilib_options "" -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" -set_board_info bmk,use_alarm 1; +set_board_info bmk,use_alarm 1 # Set host_library_path to pick up libs such as libstdc++ -#set_board_info host_library_path "[file dirname [file dirname [file dirname [file dirname [file dirname [exec [find_gcc] --print-prog-name=cc1]]]]]]/lib"; +#set_board_info host_library_path "[file dirname [file dirname [file dirname [file dirname [file dirname [exec [find_gcc] --print-prog-name=cc1]]]]]]/lib" # Do not use -lm on Cygwin if { [istarget "*-*-cygwin*"] } { - set_board_info mathlib ""; + set_board_info mathlib "" } # For the alpha, force use ieee if { [istarget "alpha*-*"] } { - set_board_info ieee_multilib_flags "-mieee"; + set_board_info ieee_multilib_flags "-mieee" } diff --git a/baseboards/usparc-cygmon.exp b/baseboards/usparc-cygmon.exp index f827c60..076c03c 100644 --- a/baseboards/usparc-cygmon.exp +++ b/baseboards/usparc-cygmon.exp @@ -1,47 +1,47 @@ -load_base_board_description "cygmon"; +load_base_board_description "cygmon" -set_board_info testcase_timeout 30; +set_board_info testcase_timeout 30 proc ${board}_init { dest } { - global usparc_init_count; - set shell_prompt [board_info $dest shell_prompt]; + global usparc_init_count + set shell_prompt [board_info $dest shell_prompt] if ![info exists usparc_init_count] { - set usparc_init_count 0; + set usparc_init_count 0 } else { - incr usparc_init_count; + incr usparc_init_count if { $usparc_init_count == 3 } { - return -1; + return -1 } } - remote_close $dest; - set shell_id [remote_open $dest]; + remote_close $dest + set shell_id [remote_open $dest] if { $shell_id == "" || $shell_id < 0 } { - return [remote_reboot $dest]; + return [remote_reboot $dest] } else { - remote_binary $dest; - remote_send $dest "\n"; - set got_one 0; + remote_binary $dest + remote_send $dest "\n" + set got_one 0 remote_expect $dest 5 { -re "$shell_prompt" { set got_one 1; exp_continue; } default { if { ! $got_one } { - remote_close $dest; - return [remote_reboot $dest]; + remote_close $dest + return [remote_reboot $dest] } } } - remote_send $dest "m \[15\]1fff1001f00 32\n"; + remote_send $dest "m \[15\]1fff1001f00 32\n" remote_expect $dest 5 { -re "$shell_prompt" { - unset usparc_init_count; - remote_close $dest; - return 0; + unset usparc_init_count + remote_close $dest + return 0 } default { - remote_close $dest; - return [remote_reboot $dest]; + remote_close $dest + return [remote_reboot $dest] } } } diff --git a/baseboards/v850-sim.exp b/baseboards/v850-sim.exp index ce3f210..2be74dd 100644 --- a/baseboards/v850-sim.exp +++ b/baseboards/v850-sim.exp @@ -19,7 +19,7 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # DDB linker script. -set_board_info ldscript ""; +set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. diff --git a/baseboards/vr4100-sim.exp b/baseboards/vr4100-sim.exp index c3b278a..3123ec4 100644 --- a/baseboards/vr4100-sim.exp +++ b/baseboards/vr4100-sim.exp @@ -9,4 +9,4 @@ if { [board_info $board obj_format] == "ecoff" } { set_board_info needs_status_wrapper 1 # Otherwise, we're a standard MIPS config. -load_base_board_description "mips64-sim"; +load_base_board_description "mips64-sim" diff --git a/baseboards/vr4111-sim.exp b/baseboards/vr4111-sim.exp index c3b278a..3123ec4 100644 --- a/baseboards/vr4111-sim.exp +++ b/baseboards/vr4111-sim.exp @@ -9,4 +9,4 @@ if { [board_info $board obj_format] == "ecoff" } { set_board_info needs_status_wrapper 1 # Otherwise, we're a standard MIPS config. -load_base_board_description "mips64-sim"; +load_base_board_description "mips64-sim" diff --git a/baseboards/vr4300-ddb.exp b/baseboards/vr4300-ddb.exp index a25afb8..d7cc6b4 100644 --- a/baseboards/vr4300-ddb.exp +++ b/baseboards/vr4300-ddb.exp @@ -16,4 +16,4 @@ set_board_info nullstone,ticks_per_sec 3782018 set_board_info gdb_protocol "ddb" # Otherwise, we're the same as a generic vr4300 board. -load_base_board_description "vr4300"; +load_base_board_description "vr4300" diff --git a/baseboards/vr4300-sim.exp b/baseboards/vr4300-sim.exp index c3b278a..3123ec4 100644 --- a/baseboards/vr4300-sim.exp +++ b/baseboards/vr4300-sim.exp @@ -9,4 +9,4 @@ if { [board_info $board obj_format] == "ecoff" } { set_board_info needs_status_wrapper 1 # Otherwise, we're a standard MIPS config. -load_base_board_description "mips64-sim"; +load_base_board_description "mips64-sim" diff --git a/baseboards/vr5000-ddb.exp b/baseboards/vr5000-ddb.exp index 8cf4b0f..7744b71 100644 --- a/baseboards/vr5000-ddb.exp +++ b/baseboards/vr5000-ddb.exp @@ -3,7 +3,7 @@ set_board_info target_install {mips64vr5000-elf mips64-elf} # Load the generic configuration for this board. This will define a basic # set of routines needed by the tool to communicate with the board. -load_generic_config "vr5000"; +load_generic_config "vr5000" # It's a big-endian board. process_multilib_options "big-endian" @@ -14,14 +14,14 @@ set_board_info compiler "[find_gcc]" set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # DDB linker script. -set_board_info ldscript "-Wl,-Tddb.ld"; +set_board_info ldscript "-Wl,-Tddb.ld" # GDB doesn't return exit statuses and we need to indicate this; # the standard GCC wrapper will work with this target. -set_board_info needs_status_wrapper 1; +set_board_info needs_status_wrapper 1 # The GDB protocol used with this board. -set_board_info gdb_protocol "ddb"; +set_board_info gdb_protocol "ddb" # This is needed for compiling nullstone. set_board_info nullstone,lib "mips-clock.c" diff --git a/baseboards/vx4300.exp b/baseboards/vx4300.exp index 2547b1c..595ebfb 100644 --- a/baseboards/vx4300.exp +++ b/baseboards/vx4300.exp @@ -3,23 +3,23 @@ set_board_info target_install {mips-vxworks5.3} # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board. -load_generic_config "vxworks"; +load_generic_config "vxworks" # No multilib flags by default. -process_multilib_options ""; +process_multilib_options "" # The compiler used to build for this board. Note that this has nothing to do # with what compiler is tested when testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" # These are probably wrong. -set_board_info cflags "-EL"; +set_board_info cflags "-EL" # vxworks 5.1 needs the executable to be relinkable. -set_board_info ldflags "-nostdlib -r"; -set_board_info libs "-lgcc"; +set_board_info ldflags "-nostdlib -r" +set_board_info libs "-lgcc" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # GDB needs to use "target vxworks" to talk to the board. -set_board_info gdb_protocol "vxworks"; +set_board_info gdb_protocol "vxworks" diff --git a/baseboards/vx68k.exp b/baseboards/vx68k.exp index d79f5bd..8968e61 100644 --- a/baseboards/vx68k.exp +++ b/baseboards/vx68k.exp @@ -3,23 +3,23 @@ set_board_info target_install {m68k-vxworks5.1 m68k-vxworks5.2} # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board. -load_generic_config "vxworks"; +load_generic_config "vxworks" # No multilib flags by default. -process_multilib_options ""; +process_multilib_options "" # The compiler used to build for this board. Note that this has nothing to do # with what compiler is tested when testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" # These are probably wrong. -set_board_info cflags ""; +set_board_info cflags "" # vxworks 5.1 needs the executable to be relinkable. -set_board_info ldflags "-nostdlib -r"; -set_board_info libs "-lgcc"; +set_board_info ldflags "-nostdlib -r" +set_board_info libs "-lgcc" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # GDB needs to use "target vxworks" to talk to the board. -set_board_info gdb_protocol "vxworks"; +set_board_info gdb_protocol "vxworks" diff --git a/baseboards/vx960.exp b/baseboards/vx960.exp index e25c79d..1c5d71e 100644 --- a/baseboards/vx960.exp +++ b/baseboards/vx960.exp @@ -3,27 +3,27 @@ set_board_info target_install {i960-vxworks5.1 i960-vxworks5.2} # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board. -load_generic_config "vxworks"; +load_generic_config "vxworks" # No multilib flags by default. -process_multilib_options ""; +process_multilib_options "" # The compiler used to build for this board. Note that this has nothing to do # with what compiler is tested when testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" # These are probably wrong, but at least it is configurable now. if { [board_info $board cpu] == "I960CA" } { - set_board_info cflags "-mca"; + set_board_info cflags "-mca" } else { - set_board_info cflags ""; + set_board_info cflags "" } # vxworks 5.1 needs the executable to be relinkable. -set_board_info ldflags "-nostdlib -r"; -set_board_info libs "-lgcc"; +set_board_info ldflags "-nostdlib -r" +set_board_info libs "-lgcc" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # GDB needs to use "target vxworks" to talk to the board. -set_board_info gdb_protocol "vxworks"; +set_board_info gdb_protocol "vxworks" diff --git a/baseboards/vxsparc.exp b/baseboards/vxsparc.exp index c943e70..a8f41d0 100644 --- a/baseboards/vxsparc.exp +++ b/baseboards/vxsparc.exp @@ -3,23 +3,23 @@ set_board_info target_install {sparc-vxworks5.1 sparc-vxworks5.2} # Load the generic configuration for this board. This will define any # routines needed by the tool to communicate with the board. -load_generic_config "vxworks"; +load_generic_config "vxworks" # No multilib flags by default. -process_multilib_options ""; +process_multilib_options "" # The compiler used to build for this board. Note that this has nothing to do # with what compiler is tested when testing gcc. -set_board_info compiler "[find_gcc]"; +set_board_info compiler "[find_gcc]" # These are probably right. -set_board_info cflags ""; +set_board_info cflags "" # vxworks 5.1 needs the executable to be relinkable. -set_board_info ldflags "-nostdlib -r"; -set_board_info libs "-lgcc"; +set_board_info ldflags "-nostdlib -r" +set_board_info libs "-lgcc" # No linker script needed. -set_board_info ldscript ""; +set_board_info ldscript "" # GDB needs to use "target vxworks" to talk to the board. -set_board_info gdb_protocol "vxworks"; +set_board_info gdb_protocol "vxworks" diff --git a/baseboards/x86-cygmon.exp b/baseboards/x86-cygmon.exp index 45f2422..fc89988 100644 --- a/baseboards/x86-cygmon.exp +++ b/baseboards/x86-cygmon.exp @@ -1,4 +1,4 @@ -load_base_board_description "cygmon"; +load_base_board_description "cygmon" # Default to ELF. if { [board_info $board obj_format] == "a.out" } { diff --git a/baseboards/xscale-cygmon.exp b/baseboards/xscale-cygmon.exp index b7c28de..113b098 100644 --- a/baseboards/xscale-cygmon.exp +++ b/baseboards/xscale-cygmon.exp @@ -4,14 +4,14 @@ set_board_info target_install {xscale-elf} # Load the generic configuration for this board. This will define a # set of generic routines used by the tool to communicate with the # board. -load_generic_config "cygmon"; +load_generic_config "cygmon" # It needs no multilib flags by default. process_multilib_options "" -set_board_info compiler "[find_gcc]"; -set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]"; -set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]"; +set_board_info compiler "[find_gcc]" +set_board_info cflags "[newlib_include_flags] [libgloss_include_flags]" +set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags] [board_info $board addl_link_flags]" # CygMON linker script. @@ -22,16 +22,16 @@ if {[string compare [board_info $board boardtype] "xaret"] == 0} { } # Standard remote protocol. -set_board_info gdb_protocol "remote"; +set_board_info gdb_protocol "remote" # We can't do input in GDB (yet! HA!). It *will* do output, hurrah. -set_board_info gdb,noinferiorio 1; +set_board_info gdb,noinferiorio 1 # Or pass arguments. -set_board_info gdb,noargs 1; -set_board_info noargs 1; +set_board_info gdb,noargs 1 +set_board_info noargs 1 # Or do signals. -set_board_info gdb,nosignals 1; +set_board_info gdb,nosignals 1 set_board_info shell_prompt "cygmon>" -set_board_info use_gdb_stub 1; +set_board_info use_gdb_stub 1 set_board_info use_cygmon 1 diff --git a/baseboards/xtensa-sim.exp b/baseboards/xtensa-sim.exp index 190ef61..1b3a91b 100644 --- a/baseboards/xtensa-sim.exp +++ b/baseboards/xtensa-sim.exp @@ -5,7 +5,7 @@ load_generic_config "sim" load_base_board_description "basic-sim" # Command to invoke the simulator set_board_info sim xt-run -setup_sim xtensa; +setup_sim xtensa # No multilib flags needed by default. process_multilib_options "" # The compiler used to build for this board. This has *nothing* to do @@ -15,7 +15,7 @@ set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]" set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]" # This board doesn't use a linker script. -set_board_info ldscript ""; +set_board_info ldscript "" # The simulator doesn't return exit statuses and we need to indicate this. set_board_info needs_status_wrapper 1 # No support for signals on this target. diff --git a/config/arc.exp b/config/arc.exp index e9c3862..33c948e 100644 --- a/config/arc.exp +++ b/config/arc.exp @@ -17,4 +17,4 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/arm-ice.exp b/config/arm-ice.exp index bd36fce..1affda1 100644 --- a/config/arm-ice.exp +++ b/config/arm-ice.exp @@ -17,4 +17,4 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/base-config.exp b/config/base-config.exp index 53f98c9..dba347a 100644 --- a/config/base-config.exp +++ b/config/base-config.exp @@ -23,26 +23,26 @@ # proc reboot_via_x10 { dest } { if [board_info $dest exists name] { - set dest [board_info $dest name]; + set dest [board_info $dest name] } if [board_info $dest exists x10] { - set x10 [board_info $dest x10]; + set x10 [board_info $dest x10] verbose "rebooting x10 unit $x10" 1 rsh_exec rtl "/usr/unsupported/bin/x10-hellcab unit $x10 off" sleep 2 rsh_exec rtl "/usr/unsupported/bin/x10-hellcab unit $x10 on" sleep 2 - return 1; + return 1 } - return 0; + return 0 } proc ${board}_reboot { args } { if { [llength $args] > 0} { - set dest [lindex $args 0]; + set dest [lindex $args 0] } else { - set dest target; + set dest target } - return [reboot_via_x10 $dest]; + return [reboot_via_x10 $dest] } diff --git a/config/base68k.exp b/config/base68k.exp index a9b322c..c76bd57 100644 --- a/config/base68k.exp +++ b/config/base68k.exp @@ -34,27 +34,27 @@ proc base68k_ld { dest prog } { return "untested" } if [is_remote host] { - set prog [remote_download host $prog]; + set prog [remote_download host $prog] if { $prog == "" } { - verbose -log "Unable to download $prog to host."; - return "untested"; + verbose -log "Unable to download $prog to host." + return "untested" } } if [board_info $dest exists objcopy] { - set OBJCOPY [board_info $dest objcopy]; + set OBJCOPY [board_info $dest objcopy] set exec_file "${prog}.srec" set objcopy_args "" if [board_info $dest exists use_vma_offset] { - set objcopy_args "--adjust-vma=[board_info $dest hex_startaddr]"; + set objcopy_args "--adjust-vma=[board_info $dest hex_startaddr]" } set status [remote_exec host "$OBJCOPY $objcopy_args -O srec $prog ${prog}.srec"] - set result [lindex $status 1]; + set result [lindex $status 1] regsub -all -- "\[\r\n\]*" $result "" result if { $result != "" || [lindex $status 0] != 0 } { warning "Got \"$result\" from $OBJCOPY" verbose -log "Couldn't convert to srecord for downloading" - remote_close $dest; + remote_close $dest return "untested" } else { verbose "Converted $prog to an srecord." 2 @@ -63,7 +63,7 @@ proc base68k_ld { dest prog } { set exec_file $prog } - set value 0; + set value 0 if ![board_info $dest exists fileid] { while { $value < 2 } { set rom68k_shell_id [remote_open $dest] @@ -72,15 +72,15 @@ proc base68k_ld { dest prog } { verbose -log "$prog not executed, couldn't connect to target." return "untested" } - incr value; + incr value } else { - break; + break } } # 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] { - remote_binary $dest; + remote_binary $dest } } @@ -88,17 +88,17 @@ proc base68k_ld { dest prog } { # can load it if [is_remote host] { global objdir - set exec_file [remote_upload host ${exec_file} "${objdir}/a.out"]; + set exec_file [remote_upload host ${exec_file} "${objdir}/a.out"] } - set got_p 0; + set got_p 0 for { set tries 0; } { (! $got_p) && $tries < 5 } { incr tries } { remote_send $dest "\r\n\r\n" remote_expect $dest 5 { -re "${shell_prompt}$" { verbose "Got prompt." set result 0 - set got_p 1; + set got_p 1 } timeout { warning "Never got prompt." @@ -107,7 +107,7 @@ proc base68k_ld { dest prog } { if { ! $got_p } { if $tries<=4 then { if { $tries == 3 } then { - remote_reboot $dest; + remote_reboot $dest } else { remote_send $dest "\r\n" } @@ -119,9 +119,9 @@ proc base68k_ld { dest prog } { # scrogged -- the remote_expect above will fail in a lot of # non-clean ways. if { ! $got_p } { - remote_close $dest; - remote_reboot $dest; - return "unresolved"; + remote_close $dest + remote_reboot $dest + return "unresolved" } else { # Flush out any remaining cruft. remote_expect $dest 2 { @@ -133,7 +133,7 @@ proc base68k_ld { dest prog } { if [board_info $dest exists download_command] { # Load the program. - remote_send $dest "\r\n"; + remote_send $dest "\r\n" # dbug has problems sending download command immediately after a # newline, so we wait for the prompt to come back first. remote_expect $dest 5 { @@ -150,29 +150,29 @@ proc base68k_ld { dest prog } { [board_info $dest download_response] { } timeout { perror "Download command never responded." - return "unresolved"; + return "unresolved" } } } } verbose "Writing records to target..." - set status [remote_transmit $dest $exec_file]; + set status [remote_transmit $dest $exec_file] if { $exec_file != $prog } { remote_file build delete $exec_file } if { $status != 0 } { - remote_close $dest; + remote_close $dest verbose -log "Transmission of $exec_file to the target failed." 3 return "unresolved" } verbose "Wrote records to target...waiting for prompt." remote_send $dest "\n" - set got_p 0; + set got_p 0 remote_expect $dest 50 { -re "$shell_prompt$" { verbose "Got prompt." - set got_p 1; + set got_p 1 } timeout { } } @@ -183,120 +183,120 @@ proc base68k_ld { dest prog } { -re ".+" { exp_continue } default { } } - return "pass"; + return "pass" } else { - remote_close $dest; - remote_reboot $dest; - return "unresolved"; + remote_close $dest + remote_reboot $dest + return "unresolved" } } proc base68k_spawn { dest prog args } { - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] - set result [remote_ld $dest $prog]; + set result [remote_ld $dest $prog] if { $result != "pass" } { - return [list $result ""]; + return [list $result ""] } if [board_info $dest exists startaddr] { - set go_command "[board_info $dest go_command] [board_info $dest startaddr]"; + set go_command "[board_info $dest go_command] [board_info $dest startaddr]" } else { - set go_command "[board_info $dest go_command]"; + set go_command "[board_info $dest go_command]" } - verbose "Sending $go_command, waiting for results."; - remote_send $dest "${go_command}\n"; - return { "pass" "" }; + verbose "Sending $go_command, waiting for results." + remote_send $dest "${go_command}\n" + return { "pass" "" } } proc base68k_wait { dest timeout } { - set shell_prompt [board_info $dest shell_prompt]; - set noappend 0; - set result -1; + set shell_prompt [board_info $dest shell_prompt] + set noappend 0 + set result -1 - set output ""; + set output "" remote_expect $dest $timeout { -re [board_info $dest go_response] { - append output $expect_out(buffer); - set noappend 1; - set result 0; - exp_continue -continue_timer; + append output $expect_out(buffer) + set noappend 1 + set result 0 + exp_continue -continue_timer } -re "$shell_prompt$" { - verbose "Got prompt."; - set result 0; + verbose "Got prompt." + set result 0 } -re "\[\r\n\]+" { if { ! $noappend } { - append output $expect_out(buffer); + append output $expect_out(buffer) if { [string length $output] < 512000 } { - exp_continue -continue_timer; + exp_continue -continue_timer } else { - set result -1; + set result -1 } } } timeout { - warning "Nothing ever came back."; - set result -1; + warning "Nothing ever came back." + set result -1 } } if [board_info $dest exists output_end] { - regsub "[board_info $dest output_end]" "$output" "\n" output; + 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] { - set go_command "[board_info $dest go_command] [board_info $dest startaddr]"; + set go_command "[board_info $dest go_command] [board_info $dest startaddr]" } else { - set go_command "[board_info $dest go_command]"; + set go_command "[board_info $dest go_command]" } - regsub "^.*$go_command\[\r\n\]*" "$output" "" output; - regsub "^.*$go_command\[\r\n\]*" "$output" "" output; + regsub "^.*$go_command\[\r\n\]*" "$output" "" output + regsub "^.*$go_command\[\r\n\]*" "$output" "" output # We always want to check for a status, even if there was a funky weird # failure above. - set status [check_for_board_status output]; + set status [check_for_board_status output] if { $result == 0 } { - set result $status; - verbose -log "exit status was $status"; + set result $status + verbose -log "exit status was $status" } # A negative value indicates that we should reboot. Otherwise, return # the exit status from the program if we got one (and we should have). - return [list $result "$output"]; + return [list $result "$output"] } proc base68k_load { dest prog args } { global base68k_retry - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] if { [llength $args] > 0 } { for { set x 0; } { $x < [llength $args] } { incr x ; } { if { [lindex $args $x] != "" } { - verbose -log "Cannot pass parameters or input file to this target"; - return [list "unsupported" ""]; + verbose -log "Cannot pass parameters or input file to this target" + return [list "unsupported" ""] } } } - set result [remote_spawn $dest $prog]; + set result [remote_spawn $dest $prog] if { [lindex $result 0] != "pass" } { - return $result; + return $result } # FIXME: The value 360 below should be a parameter. - set result [remote_wait $dest 360]; - set output [lindex $result 1]; - set status [lindex $result 0]; + set result [remote_wait $dest 360] + set output [lindex $result 1] + set status [lindex $result 0] verbose "output from board is $output" @@ -304,20 +304,20 @@ proc base68k_load { dest prog args } { send_log "\n" if { $status > 0 } { - return [list "fail" $output]; + return [list "fail" $output] } elseif { $status == 0 } { - return [list "pass" $output]; + return [list "pass" $output] } else { if [info exists base68k_retry] { - return [list "fail" $output]; + return [list "fail" $output] } - set base68k_retry 1; - remote_reboot $dest; - set status [eval base68k_load \{$dest\} \{$prog\} $args]; - unset base68k_retry; - return $status; + set base68k_retry 1 + remote_reboot $dest + set status [eval base68k_load \{$dest\} \{$prog\} $args] + unset base68k_retry + return $status } } -set_board_info protocol "base68k"; +set_board_info protocol "base68k" set_board_info send_initial_cr 1 diff --git a/config/bug.exp b/config/bug.exp index c175c80..f4f6b44 100644 --- a/config/bug.exp +++ b/config/bug.exp @@ -19,7 +19,7 @@ # This file was written by Bob Manson (manson@cygnus.com). -load_generic_config "base68k"; +load_generic_config "base68k" set_board_info shell_prompt "\[0-9\]+Bug>" set_board_info download_command "lo 0\r" diff --git a/config/cfdbug.exp b/config/cfdbug.exp index 7948146..d461576 100644 --- a/config/cfdbug.exp +++ b/config/cfdbug.exp @@ -19,7 +19,7 @@ # This file was written by Bob Manson (manson@cygnus.com). -load_generic_config "base68k"; +load_generic_config "base68k" set_board_info shell_prompt "dBUG> *" set_board_info download_command "dl\r\n" diff --git a/config/cygmon.exp b/config/cygmon.exp index faf8dd8..7fb7dd1 100644 --- a/config/cygmon.exp +++ b/config/cygmon.exp @@ -17,6 +17,6 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" -set_board_info send_initial_cr 1; +set_board_info send_initial_cr 1 diff --git a/config/d10v.exp b/config/d10v.exp index bd36fce..1affda1 100644 --- a/config/d10v.exp +++ b/config/d10v.exp @@ -17,4 +17,4 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/ddb-ether.exp b/config/ddb-ether.exp index 91e0af0..88c707e 100644 --- a/config/ddb-ether.exp +++ b/config/ddb-ether.exp @@ -21,166 +21,166 @@ # Reset the prompt to what GDB needs. proc ${board}_init { dest } { - global doing_ddb_init; + global doing_ddb_init if ![info exists doing_ddb_init] { - set doing_ddb_init 1; + set doing_ddb_init 1 - remote_close $dest; + remote_close $dest for { set x 0; } { $x < 3 } { incr x; } { - set shell_id [remote_open $dest]; + set shell_id [remote_open $dest] if { $shell_id == "" || $shell_id < 0 } { - remote_reboot $dest; + remote_reboot $dest } else { - break; + break } } - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] - remote_send $dest "\n"; + remote_send $dest "\n" remote_expect $dest 10 { -re ".*PMON> $" { - remote_send $dest "set prompt \"$shell_prompt\"\n"; - exp_continue; + remote_send $dest "set prompt \"$shell_prompt\"\n" + exp_continue } -re ".*${shell_prompt}$" { } } - remote_close $dest; - unset doing_ddb_init; + remote_close $dest + unset doing_ddb_init } else { - return; + return } } proc ddb_ether_load { dest prog args } { for { set x 0; } { $x < 3 } { incr x } { - set result [eval remote_spawn \{$dest\} \{$prog\} $args]; + set result [eval remote_spawn \{$dest\} \{$prog\} $args] if { $result < 0 } { - remote_reboot $dest; + remote_reboot $dest } else { - set result [remote_wait $dest 300]; - set status [lindex $result 0]; - set output [lindex $result 1]; + set result [remote_wait $dest 300] + set status [lindex $result 0] + set output [lindex $result 1] if { $status >= 0 } { if { $status > 0 } { - return [list "fail" $output]; + return [list "fail" $output] } else { - return [list "pass" $output]; + return [list "pass" $output] } } } } - return [list "fail" ""]; + return [list "fail" ""] } proc ddb_ether_ld { dest prog } { if ![board_info $dest exists tftpdir] { - perror "Must set_board_info tftpdir for [board_info $dest name]"; - return "fail"; + perror "Must set_board_info tftpdir for [board_info $dest name]" + return "fail" } if ![board_info $dest exists fileid] { - set spawn_id [remote_open $dest]; + set spawn_id [remote_open $dest] if { $spawn_id == "" || $spawn_id < 0 } { - return "retry"; + return "retry" } - remote_binary $dest; + remote_binary $dest } - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] - remote_send $dest "\n"; + remote_send $dest "\n" remote_expect $dest 10 { -re ".*${shell_prompt}$" { } default { - return "retry"; + return "retry" } } - set basename "a.out.[pid]"; - set file "[board_info $dest tftpdir]/$basename"; - set file [remote_download build $prog $file]; + set basename "a.out.[pid]" + set file "[board_info $dest tftpdir]/$basename" + set file [remote_download build $prog $file] if { $file == "" } { - perror "download to tftp area failed"; - return "fail"; + perror "download to tftp area failed" + return "fail" } - set state "pass"; + set state "pass" - remote_send $dest "boot /$basename\n"; - set tries 0; + remote_send $dest "boot /$basename\n" + set tries 0 remote_expect $dest 30 { -re "Loading.*Entry address is.*${shell_prompt}$" { } -re "invalid executable.*${shell_prompt}$" { - incr tries; + incr tries if { $tries < 3 } { - sleep 2; - remote_send $dest "boot /$basename\n"; - exp_continue; + sleep 2 + remote_send $dest "boot /$basename\n" + exp_continue } } -re ".*${shell_prompt}$" { - set state "fail"; + set state "fail" } default { - set state "fail"; + set state "fail" } } - remote_file build delete $file; + remote_file build delete $file if { $state == "fail" } { - return $state; + return $state } - return "pass"; + return "pass" } proc ddb_ether_spawn { dest prog args } { - set state [ddb_ether_ld $dest $prog]; + set state [ddb_ether_ld $dest $prog] if { $state != "pass" } { - return -1; + return -1 } - remote_send $dest "g\n"; + remote_send $dest "g\n" remote_expect $dest 5 { -re "g\[\r\n\]\[\r\n\]?" { } default { } } - return [board_info $dest fileid]; + return [board_info $dest fileid] } proc ddb_ether_wait { dest timeout } { - set output ""; - set shell_prompt [board_info $dest shell_prompt]; + set output "" + set shell_prompt [board_info $dest shell_prompt] remote_expect $dest $timeout { -re "^g\[\r\n\]\[\r\n\]?" { if { $output != "" } { - append output $expect_out(buffer); + append output $expect_out(buffer) } - exp_continue; + exp_continue } -re "(.*)$shell_prompt" { - append output $expect_out(1,string); - set status [check_for_board_status output]; + append output $expect_out(1,string) + set status [check_for_board_status output] if { $status > 0 } { - return [list $status $output]; + return [list $status $output] } else { if [regexp "Exception Cause=" $output] { - remote_reboot $dest; - return [list -1 $output]; + remote_reboot $dest + return [list -1 $output] } - return [list 0 $output]; + return [list 0 $output] } } -re "\[\r\n\]+" { - append output $expect_out(buffer); + append output $expect_out(buffer) if { [string length $output] < 512000 } { - exp_continue; + exp_continue } else { - return [list -1 ""]; + return [list -1 ""] } } default { - return [list -1 ""]; + return [list -1 ""] } } } diff --git a/config/ddb.exp b/config/ddb.exp index 2c1aa21..89ceb55 100644 --- a/config/ddb.exp +++ b/config/ddb.exp @@ -20,12 +20,12 @@ # This file was written by Bob Manson (manson@cygnus.com) # We use GDB to talk to a vr4300 board. -load_generic_config "base68k"; +load_generic_config "base68k" -set_board_info shell_prompt "NEC010> "; -set_board_info download_command "load tty0\n"; -set_board_info download_response "Downloading from"; -set_board_info go_command "g -e"; +set_board_info shell_prompt "NEC010> " +set_board_info download_command "load tty0\n" +set_board_info download_response "Downloading from" +set_board_info go_command "g -e" set_board_info startaddr "a0100000" set_board_info hex_startaddr "0xa0100000" set_board_info go_response "(^|\[\r\n\])(Exception Cause|\[0-9a-z\]+ \[0-9a-z\]+ break|\\*\\*\\*EXIT code )\[^\r\n\]*\[\r\n\]" @@ -33,51 +33,51 @@ 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; + global doing_ddb_init if [is_remote host] { - return; + return } if ![info exists doing_ddb_init] { - set doing_ddb_init 1; + set doing_ddb_init 1 for { set i 1; } { $i <= 3 } {incr i } { - remote_close $dest; + remote_close $dest for { set x 0; } { $x < 3 } { incr x; } { - set shell_id [remote_open $dest]; + set shell_id [remote_open $dest] if { $shell_id == "" || $shell_id < 0 } { - remote_reboot $dest; + remote_reboot $dest } else { - break; + break } } - set count 0; - remote_send $dest "\n"; + set count 0 + remote_send $dest "\n" remote_expect $dest 20 { -re ".*PMON> $" { - remote_send $dest "set prompt \"NEC010> \"\n"; - exp_continue; + remote_send $dest "set prompt \"NEC010> \"\n" + exp_continue } -re "NEC010> $" { - set i 10; + set i 10 } timeout { } -re "0x0" { - count++; + count++ if(count<5) { - exp_continue; + exp_continue } } } if { $i < 3 } { - remote_reboot $dest; + remote_reboot $dest } } - remote_close $dest; - unset doing_ddb_init; + remote_close $dest + unset doing_ddb_init } else { - return; + return } } @@ -86,7 +86,7 @@ set_board_info dont_wait_for_prompt 1 # If no output format is specified, use objcopy. if ![board_info $board exists output_format] { - set tempfil [lookfor_file $tool_root_dir binutils/objcopy]; + set tempfil [lookfor_file $tool_root_dir binutils/objcopy] if { $tempfil != "" } { set_board_info objcopy $tempfil } else { diff --git a/config/dos.exp b/config/dos.exp index 9158c2b..4a52113 100644 --- a/config/dos.exp +++ b/config/dos.exp @@ -26,97 +26,97 @@ proc dos_open { dest args } { global destbat_num if ![info exists destbat_num] { - set destbat_num [pid]; + set destbat_num [pid] } if { [board_info $dest conninfo] == "" } { - global board_info; - set name [board_info $dest name]; + global board_info + set name [board_info $dest name] - set board_info($name,conninfo) "b${destbat_num}.bat"; - incr destbat_num; + set board_info($name,conninfo) "b${destbat_num}.bat" + incr destbat_num } if [board_info $dest exists fileid] { - return [board_info $dest fileid]; + return [board_info $dest fileid] } verbose "doing a dos_open to $dest" - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] - set shell_id [remote_raw_open $dest]; + set shell_id [remote_raw_open $dest] if { $shell_id == "" || $shell_id < 0 } { - return -1; + return -1 } if [board_info $dest exists init_command] { - remote_send $dest "[board_info $dest init_command]\n"; + remote_send $dest "[board_info $dest init_command]\n" remote_expect $dest 10 { -re "$shell_prompt" { } default { perror "failed connection to DOS on $dest." - return -1; + return -1 } } } if [board_info $dest exists ftp_directory] { - set dir [board_info $dest ftp_directory]; - regsub -all "/" "$dir" "\\" dir; - remote_send $dest "cd $dir\n"; + set dir [board_info $dest ftp_directory] + regsub -all "/" "$dir" "\\" dir + remote_send $dest "cd $dir\n" remote_expect $dest 10 { -re "$shell_prompt" { } default { perror "failed connection to DOS on $dest." - return -1; + return -1 } } } 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; - remote_send $dest "${drive}\n"; + 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 + remote_send $dest "${drive}\n" remote_expect $dest 10 { -re "$shell_prompt" { } default { perror "failed connection to DOS on $dest." - return -1; + return -1 } } - remote_send $dest "cd $dos_dir\n"; + remote_send $dest "cd $dos_dir\n" remote_expect $dest 10 { -re "$shell_prompt" { } default { perror "failed connection to DOS on $dest." - return -1; + return -1 } } } global target_alias if [info exists target_alias] { - set talias $target_alias; + set talias $target_alias } else { set talias "foo-bar" } - global board_info; + global board_info if [board_info $dest exists name] { - set n [board_info $dest name]; + set n [board_info $dest name] } else { - set n $dest; + set n $dest } - set board_info($n,fileid) $shell_id; + set board_info($n,fileid) $shell_id if [board_info $dest exists init_script] { remote_exec $dest "[board_info $dest init_script] $talias" } verbose "Succeeded in connecting to DOS." - return $shell_id; + return $shell_id } # @@ -126,33 +126,33 @@ proc dos_open { dest args } { proc dos_close { dest args } { if [board_info $dest exists fileid] { if { [board_info $dest connect] == "telnet" } { - remote_send $dest "exit\n"; - sleep 2; + remote_send $dest "exit\n" + sleep 2 } - return [remote_raw_close $dest]; + return [remote_raw_close $dest] } } proc dos_prep_command { dest cmdline } { - global board_info; + global board_info - set name [board_info $dest name]; - set shell_id [remote_open "$dest"]; + set name [board_info $dest name] + set shell_id [remote_open "$dest"] - set localbat "/tmp/b[pid].bat"; - set remotebat [board_info $dest conninfo]; + set localbat "/tmp/b[pid].bat" + set remotebat [board_info $dest conninfo] verbose "opened" if { $shell_id != "" && $shell_id >= 0 } { - set fileid [open "$localbat" "w"]; - puts -nonewline $fileid "@echo off\r\n$cmdline\r\nif errorlevel 1 echo *** DOSEXIT code 1\r\nif not errorlevel 1 echo *** DOSEXIT code 0\r\n"; - close $fileid; - set result [remote_download $dest $localbat $remotebat]; + set fileid [open "$localbat" "w"] + puts -nonewline $fileid "@echo off\r\n$cmdline\r\nif errorlevel 1 echo *** DOSEXIT code 1\r\nif not errorlevel 1 echo *** DOSEXIT code 0\r\n" + close $fileid + set result [remote_download $dest $localbat $remotebat] } else { set result "" } - remote_file build delete $localbat; - return $result; + remote_file build delete $localbat + return $result } # @@ -166,19 +166,19 @@ proc dos_prep_command { dest cmdline } { proc dos_exec { dest program pargs inp outp } { set cmdline "$program $pargs" - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] if { $inp != "" } { - set inp [remote_download $dest $inp inpfile]; + set inp [remote_download $dest $inp inpfile] if { $inp != "" } { - set inp " < $inp"; + set inp " < $inp" } } if { $outp != "" } { - set outpf " > tempout"; + set outpf " > tempout" } else { - set outpf ""; + set outpf "" } verbose "cmdline is $cmdline$inp." 2 @@ -186,30 +186,30 @@ proc dos_exec { dest program pargs inp outp } { # Make a DOS batch file; we use @echo off so we don't have to see # the DOS command prompts and such. for { set i 0; } { $i < 2 } { incr i } { - set exit_status -1; + set exit_status -1 verbose "calling open" - set batfile [dos_prep_command $dest "$cmdline$inp$outpf"]; + set batfile [dos_prep_command $dest "$cmdline$inp$outpf"] if { $batfile != "" } { if { [dos_start_command $batfile $dest] == "" } { # FIXME: The 300 below should be a parameter. - set result [remote_wait $dest 300]; - set exit_status [lindex $result 0]; - set output [lindex $result 1]; + set result [remote_wait $dest 300] + set exit_status [lindex $result 0] + set output [lindex $result 1] } } if { $exit_status >= 0 } { if { $outp != "" } { - remote_upload $dest tempout $outp; - remote_file $dest delete tempout; + remote_upload $dest tempout $outp + remote_file $dest delete tempout } - return [list $exit_status $output]; + return [list $exit_status $output] } if { $exit_status != -2 } { - remote_close $dest; - remote_reboot $dest; + remote_close $dest + remote_reboot $dest } } - return [list -1 "program execution failed"]; + return [list -1 "program execution failed"] } # @@ -219,40 +219,40 @@ proc dos_exec { dest program pargs inp outp } { # proc dos_start_command { cmdline dest } { - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] set prefix "" - set ok 0; + set ok 0 for {set i 0;} {$i <= 2 && ! $ok} {incr i;} { - set shell_id [remote_open $dest]; + set shell_id [remote_open $dest] if { $shell_id != "" && $shell_id > 0 } { - remote_send $dest "echo k\r"; + remote_send $dest "echo k\r" remote_expect $dest 20 { -re "\\(gdb\\)" { - set shell_prompt "\\(gdb\\)"; + set shell_prompt "\\(gdb\\)" # gdb uses 'shell command'. - set prefix "shell "; - set ok 1; + set prefix "shell " + set ok 1 } -re "$shell_prompt" { - set ok 1; + set ok 1 } default { } } } if { ! $ok } { - remote_close $dest; - remote_reboot $dest; + remote_close $dest + remote_reboot $dest } } if { ! $ok } { return "unable to start command" } else { - remote_send $dest "${prefix}${cmdline}\n"; + remote_send $dest "${prefix}${cmdline}\n" remote_expect $dest 2 { -re "${cmdline}\[\r\n\]\[\r\n\]?" { } timeout { } } - return ""; + return "" } } @@ -285,47 +285,47 @@ proc dos_send { dest string } { proc dos_spawn { dest program args } { verbose "running $program on $dest" - set remotebat [dos_prep_command $dest $program]; + set remotebat [dos_prep_command $dest $program] for { set x 0; } { $x < 3 } { incr x } { if { [dos_start_command $remotebat $dest] == "" } { - return [board_info $dest fileid]; + return [board_info $dest fileid] } - remote_close $dest; - remote_reboot $dest; + remote_close $dest + remote_reboot $dest } - return -1; + return -1 } proc dos_wait { dest timeout } { - set output ""; - set shell_prompt [board_info $dest shell_prompt]; - set status 1; + set output "" + set shell_prompt [board_info $dest shell_prompt] + set status 1 - verbose "waiting in dos_wait"; + verbose "waiting in dos_wait" remote_expect $dest $timeout { -re "(.*)\[*\]\[*\]\[*\] DOSEXIT code (\[0-9\]+)\[\r\n\]\[\r\n\]?" { - verbose "got exit status"; - append output $expect_out(1,string); - set status $expect_out(2,string); - exp_continue; + verbose "got exit status" + append output $expect_out(1,string) + set status $expect_out(2,string) + exp_continue } -re "(.*)${shell_prompt}" { - append output $expect_out(1,string); - verbose "output from dos is:'$output'"; - return [list $status $output]; + append output $expect_out(1,string) + verbose "output from dos is:'$output'" + return [list $status $output] } -re "(.*)\\(gdb\\)" { - append output $expect_out(1,string); - return [list $status $output]; + append output $expect_out(1,string) + return [list $status $output] } -re "In.*cygwin.*except" { - remote_close $dest; - remote_reboot $dest; - return [list -2 $output]; + remote_close $dest + remote_reboot $dest + return [list -2 $output] } -re "\[\r\n\]+" { @@ -335,89 +335,89 @@ proc dos_wait { dest timeout } { # first time 'round. The other tricky bit is that # expect_out(buffer) will contain everything before and including # the matched pattern. - append output $expect_out(buffer); - exp_continue -continue_timer; + append output $expect_out(buffer) + exp_continue -continue_timer } timeout { - warning "timeout in dos_wait"; + warning "timeout in dos_wait" if { [dos_interrupt_job $dest] == "" } { - return [list 1 $output]; + return [list 1 $output] } } eof { - warning "got EOF from dos host."; + warning "got EOF from dos host." } } - remote_close $dest; + remote_close $dest - return [list -1 $output]; + return [list -1 $output] } proc dos_load { dest prog args } { - global dos_dll_loaded; - set progargs ""; - set inpfile ""; + global dos_dll_loaded + set progargs "" + set inpfile "" if { [llength $args] > 0 } { - set progargs [lindex $args 1]; + set progargs [lindex $args 1] } if { [llength $args] > 1 } { - set inpfile [lindex $args 1]; + set inpfile [lindex $args 1] } if ![info exists dos_dll_loaded] { if ![is_remote host] { - global target_alias; + global target_alias - set comp [get_multilibs]; + set comp [get_multilibs] if [file exists "${comp}/winsup/new-cygwin1.dll"] { - set dll "${comp}/winsup/new-cygwin1.dll"; - set dll_name "cygwin1.dll"; + set dll "${comp}/winsup/new-cygwin1.dll" + set dll_name "cygwin1.dll" } elseif [file exists "${comp}/winsup/new-cygwin.dll"] { - set dll "${comp}/winsup/new-cygwin.dll"; - set dll_name "cygwin.dll"; + set dll "${comp}/winsup/new-cygwin.dll" + set dll_name "cygwin.dll" } elseif [file exists ${comp}/lib/cygwin1.dll] { - set dll "${comp}/lib/cygwin1.dll"; - set dll_name "cygwin1.dll"; + set dll "${comp}/lib/cygwin1.dll" + set dll_name "cygwin1.dll" } elseif [file exists ${comp}/lib/cygwin.dll] { - set dll "${comp}/lib/cygwin.dll"; - set dll_name "cygwin.dll"; + set dll "${comp}/lib/cygwin.dll" + set dll_name "cygwin.dll" } else { error "couldn't find cygwin.dll:$comp" - return "fail"; + return "fail" } remote_download $dest $dll $dll_name } - set dos_dll_loaded 1; + set dos_dll_loaded 1 } - set remote_prog [remote_download $dest $prog "aout.exe"]; - set result [remote_exec $dest $remote_prog $progargs $inpfile]; - set status [lindex $result 0]; - set output [lindex $result 1]; - set status2 [check_for_board_status output]; + set remote_prog [remote_download $dest $prog "aout.exe"] + set result [remote_exec $dest $remote_prog $progargs $inpfile] + set status [lindex $result 0] + set output [lindex $result 1] + set status2 [check_for_board_status output] if { $status2 >= 0 } { - set status $status2; + set status $status2 } if { $status != 0 } { - set status "fail"; + set status "fail" } else { - set status "pass"; + set status "pass" } - return [list $status $output]; + return [list $status $output] } proc dos_file { dest op args } { switch $op { delete { foreach x $args { - remote_exec $dest "del" "$x"; + remote_exec $dest "del" "$x" } - return; + return } default { - return [eval standard_file \{$dest\} \{$op\} $args]; + return [eval standard_file \{$dest\} \{$op\} $args] } } } @@ -427,32 +427,32 @@ proc dos_file { dest op args } { # part is that we have to handle the "Terminate batch job" prompt. # proc dos_interrupt_job { host } { - set shell_prompt [board_info $host shell_prompt]; + set shell_prompt [board_info $host shell_prompt] - remote_send $host "\003"; + remote_send $host "\003" remote_expect $host 10 { -re "Terminate batch job.*Y/N\[)\]\[?\] *$" { - remote_send $host "n\n"; - exp_continue; + remote_send $host "n\n" + exp_continue } -re "$shell_prompt" { - return ""; + return "" } -re ">" { - remote_send $host "\n"; - exp_continue; + remote_send $host "\n" + exp_continue } } - return "fail"; + return "fail" } proc dos_copy_download { host localfile remotefile } { - remote_file build delete "[board_info $host local_dir]/$remotefile"; + remote_file build delete "[board_info $host local_dir]/$remotefile" if [remote_file build exists $localfile] { - set result [remote_download build $localfile "[board_info $host local_dir]/$remotefile"]; + set result [remote_download build $localfile "[board_info $host local_dir]/$remotefile"] if { $result != "" } { - remote_exec build "chmod" "a+rw $result"; - return $remotefile; + remote_exec build "chmod" "a+rw $result" + return $remotefile } } else { return "" @@ -460,25 +460,25 @@ proc dos_copy_download { host localfile remotefile } { } proc dos_copy_upload { host remotefile localfile } { - remote_file build delete $localfile; + remote_file build delete $localfile if [file exists "[board_info $host local_dir]/$remotefile"] { - set result [remote_download build "[board_info $host local_dir]/$remotefile" $localfile]; + set result [remote_download build "[board_info $host local_dir]/$remotefile" $localfile] } else { - set result ""; + set result "" } if { $result != "" } { - remote_exec build "chmod" "a+rw $result"; - return $result; + remote_exec build "chmod" "a+rw $result" + return $result } } proc dos_copy_file { dest op args } { if { $op == "delete" } { - set file "[board_info $dest local_dir]/[lindex $args 0]"; - remote_file build delete $file; + set file "[board_info $dest local_dir]/[lindex $args 0]" + remote_file build delete $file } } -set_board_info protocol "dos"; -set_board_info shell_prompt "(^|\[\r\n\])\[a-zA-Z\]:\[^\r\n\]*>\[ \t\]*$"; +set_board_info protocol "dos" +set_board_info shell_prompt "(^|\[\r\n\])\[a-zA-Z\]:\[^\r\n\]*>\[ \t\]*$" set_board_info needs_status_wrapper 1 diff --git a/config/dve.exp b/config/dve.exp index 35f8c3f..02a2643 100644 --- a/config/dve.exp +++ b/config/dve.exp @@ -19,4 +19,4 @@ # For Densan MIPS boards we use gdb to load and execute programs. -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/gdb-comm.exp b/config/gdb-comm.exp index 0255335..6c7d67e 100644 --- a/config/gdb-comm.exp +++ b/config/gdb-comm.exp @@ -37,7 +37,7 @@ set try_again 0 proc gdb_comm_delete_breakpoints {} { global gdb_prompt - remote_send host "delete breakpoints\n"; + remote_send host "delete breakpoints\n" remote_expect host 10 { -re "Delete all breakpoints.*y or n. $" { remote_send host "y\n" @@ -52,7 +52,7 @@ proc gdb_comm_delete_breakpoints {} { -re ".*$gdb_prompt $" { perror "breakpoints not deleted" ; return -1} timeout { perror "info breakpoints (timeout)" ; return -1} } - return 0; + return 0 } # @@ -70,7 +70,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] { - set arg [remote_download host $arg a.out]; + set arg [remote_download host $arg a.out] } remote_send host "file $arg\n" remote_expect host 60 { @@ -120,31 +120,31 @@ proc gdb_comm_file_cmd { arg } { return -1 } } - return 0; + return 0 } # Disconnect from the target and forget that we have an executable. Returns # -1 on failure, 0 on success. proc gdb_comm_go_idle { } { - global gdb_prompt; + global gdb_prompt if ![board_info host exists fileid] { - return -1; + return -1 } - remote_send host "target exec\n"; + remote_send host "target exec\n" remote_expect host 10 { -re "Kill it.*y or n.*$" { remote_send host "y\n" - exp_continue; + exp_continue } -re "No exec.* file now.*$gdb_prompt $" { - return 0; + return 0 } default { - remote_close host; - return -1; + remote_close host + return -1 } } } @@ -160,7 +160,7 @@ proc gdb_comm_start { dest } { if ![board_info $dest exists gdb_prompt] then { set gdb_prompt "\\(gdb\\)" } else { - set gdb_prompt [board_info $dest gdb_prompt]; + 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. @@ -171,20 +171,20 @@ proc gdb_comm_start { dest } { } } if [board_info host exists gdb_opts] { - set gdb_opts [board_info host gdb_opts]; + set gdb_opts [board_info host gdb_opts] } else { set gdb_opts "" } # Start up gdb (no startfiles, no windows) and wait for a prompt. - remote_spawn host "$GDB $gdb_opts -nw -nx"; + remote_spawn host "$GDB $gdb_opts -nw -nx" remote_expect host 60 { -re ".*$gdb_prompt $" { } } - remote_send host "set height 0\n"; + remote_send host "set height 0\n" remote_expect host 10 { -re ".*$gdb_prompt $" {} } - remote_send host "set width 0\n"; + remote_send host "set width 0\n" remote_expect host 10 { -re ".*$gdb_prompt $" {} } @@ -211,16 +211,16 @@ proc gdb_comm_add_breakpoint { function } { # proc quit_gdb { } { - global gdb_prompt; + global gdb_prompt - set spawn_id [board_info host fileid]; + set spawn_id [board_info host fileid] if { $spawn_id != "" && $spawn_id > -1 } { if { [remote_send host "quit\n"] == "" } { remote_expect host 10 { -re ".*y or n.*$" { - remote_send host "y\n"; - exp_continue; + remote_send host "y\n" + exp_continue } -re ".*\[*\]\[*\]\[*\].*EXIT code" { } default { } @@ -228,15 +228,15 @@ proc quit_gdb { } { } } if ![is_remote host] { - remote_close host; + remote_close host } } proc gdb_comm_leave { } { if [is_remote host] { - quit_gdb; + quit_gdb } else { - gdb_comm_go_idle; + gdb_comm_go_idle } } # @@ -255,50 +255,50 @@ proc gdb_comm_load { dest prog args } { for { set x 0; } { $x < [llength $args] } { incr x } { if { [lindex $args $x] != "" } { - return [list "unsupported" "no support for [lindex $argnames $x] on this target"]; + return [list "unsupported" "no support for [lindex $argnames $x] on this target"] } } # Make sure the file we're supposed to load really exists. if ![file exists $prog] then { perror "$prog does not exist." - return [list "untested" ""]; + return [list "untested" ""] } if { [is_remote host] || ![board_info host exists fileid] } { - gdb_comm_start $dest; + gdb_comm_start $dest } # Remove all breakpoints, then tell the debugger that we have # new exec file. if { [gdb_comm_delete_breakpoints] != 0 } { - gdb_comm_leave; - return [gdb_comm_reload $dest $prog $args]; + gdb_comm_leave + return [gdb_comm_reload $dest $prog $args] } if { [gdb_comm_file_cmd $prog] != 0 } { - gdb_comm_leave; - return [gdb_comm_reload $dest $prog $args]; + gdb_comm_leave + return [gdb_comm_reload $dest $prog $args] } if [board_info $dest exists gdb_sect_offset] { - set textoff [board_info $dest gdb_sect_offset]; - remote_send host "sect .text $textoff\n"; + set textoff [board_info $dest gdb_sect_offset] + remote_send host "sect .text $textoff\n" remote_expect host 10 { -re "(0x\[0-9a-z]+) - 0x\[0-9a-z\]+ is \\.data" { - set dataoff $expect_out(1,string); - exp_continue; + set dataoff $expect_out(1,string) + exp_continue } -re "(0x\[0-9a-z\]+) - 0x\[0-9a-z\]+ is \\.bss" { - set bssoff $expect_out(1,string); - exp_continue; + set bssoff $expect_out(1,string) + exp_continue } -re "$gdb_prompt" { } } - set dataoff [format 0x%x [expr $dataoff + $textoff]]; - set bssoff [format 0x%x [expr $bssoff + $textoff]]; - remote_send host "sect .data $dataoff\n"; + set dataoff [format 0x%x [expr $dataoff + $textoff]] + set bssoff [format 0x%x [expr $bssoff + $textoff]] + remote_send host "sect .data $dataoff\n" remote_expect host 10 { -re "$gdb_prompt" { } } - remote_send host "sect .bss $bssoff\n"; + remote_send host "sect .bss $bssoff\n" remote_expect host 10 { -re "$gdb_prompt" { } } @@ -310,18 +310,18 @@ proc gdb_comm_load { dest prog args } { # use printf to indicate pass/fail status. if { [gdb_comm_add_breakpoint _exit] != "" } { - gdb_comm_add_breakpoint exit; + gdb_comm_add_breakpoint exit } - gdb_comm_add_breakpoint abort; + gdb_comm_add_breakpoint abort - set protocol [board_info $dest gdb_protocol]; + set protocol [board_info $dest gdb_protocol] if [board_info $dest exists gdb_serial] { - set targetname [board_info $dest gdb_serial]; + set targetname [board_info $dest gdb_serial] } elseif [board_info $dest exists netport] { - set targetname [board_info $dest netport]; + set targetname [board_info $dest netport] } else { if [board_info $dest exists serial] { - set targetname [board_info $dest serial]; + set targetname [board_info $dest serial] } else { set targetname "" } @@ -331,20 +331,20 @@ proc gdb_comm_load { dest prog args } { remote_expect host 10 { -re ".*$gdb_prompt $" {} default { - warning "failed setting baud rate"; + warning "failed setting baud rate" } } } - remote_send host "target $protocol $targetname\n"; + remote_send host "target $protocol $targetname\n" remote_expect host 60 { -re "Couldn.t establish conn.*$gdb_prompt $" { warning "Unable to connect to $targetname with GDB." - quit_gdb; + quit_gdb return [gdb_comm_reload $dest $prog $args] } -re "Ending remote.*$gdb_prompt $" { warning "Unable to connect to $targetname with GDB." - quit_gdb; + quit_gdb return [gdb_comm_reload $dest $prog $args] } -re "Remote target $protocol connected to.*$gdb_prompt $" { } @@ -354,35 +354,35 @@ proc gdb_comm_load { dest prog args } { -re "Remote.*using $targetname.*$gdb_prompt $" { } -re "$gdb_prompt $" { warning "Unable to connect to $targetname with GDB." - quit_gdb; + quit_gdb return [gdb_comm_reload $dest $prog $args] } -re ".*RDI_open.*should reset target.*" { warning "RDI Open Failed" - quit_gdb; + quit_gdb return [gdb_comm_reload $dest $prog $args] } default { warning "Unable to connect to $targetname with GDB." - quit_gdb; + quit_gdb return [gdb_comm_reload $dest $prog $args] } } if [target_info exists gdb_init_command] { - remote_send host "[target_info gdb_init_command]\n"; + remote_send host "[target_info gdb_init_command]\n" remote_expect host 10 { -re ".*$gdb_prompt $" { } default { - gdb_comm_leave; - return [list "fail" ""]; + gdb_comm_leave + return [list "fail" ""] } } } # 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] { - remote_send host "load $prog [board_info $dest gdb_load_offset]\n"; + remote_send host "load $prog [board_info $dest gdb_load_offset]\n" } else { remote_send host "load\n" } @@ -391,13 +391,13 @@ proc gdb_comm_load { dest prog args } { -re "data.*text.*$gdb_prompt $" { } -re "$gdb_prompt $" { warning "Unable to send program to target board." - gdb_comm_leave; - return [gdb_comm_reload $dest $prog $args]; + gdb_comm_leave + return [gdb_comm_reload $dest $prog $args] } default { warning "Unable to send program to target board." - gdb_comm_leave; - return [gdb_comm_reload $dest $prog $args]; + gdb_comm_leave + return [gdb_comm_reload $dest $prog $args] } } @@ -407,29 +407,29 @@ proc gdb_comm_load { dest prog args } { # And a whole lot of other magic stuff too. if [board_info $dest exists gdb_run_command] { - remote_send host "[board_info $dest gdb_run_command]\n"; + 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] { - set testcase_timeout [board_info $dest testcase_timeout]; + set testcase_timeout [board_info $dest testcase_timeout] } else { - set testcase_timeout 300; + set testcase_timeout 300 } remote_expect host $testcase_timeout { -re "Line.*Jump anyway.*.y or n.*" { - remote_send host "y\n"; - exp_continue; + remote_send host "y\n" + exp_continue } -re "Continuing( at |\\.| with no signal\\.)\[^\r\n\]*\[\r\n\]" { - exp_continue; + exp_continue } -re ".*Start it from the beginning?.*y or n.*" { - remote_send host "n\n"; + remote_send host "n\n" remote_expect host 10 { -re ".*$gdb_prompt $" { - remote_send host "signal 0\n"; + remote_send host "signal 0\n" remote_expect host 10 { -re "signal 0\[\r\n\]+" { exp_continue; } -re "Continuing(\\.| with no signal\\.)\[\r\n\]" {} @@ -445,83 +445,83 @@ proc gdb_comm_load { dest prog args } { exp_continue } -re "(.*)Breakpoint.*exit.*=0.*$gdb_prompt $" { - append output $expect_out(1,string); - set result [check_for_board_status output]; - gdb_comm_leave; + append output $expect_out(1,string) + set result [check_for_board_status output] + gdb_comm_leave if { $result > 0 } { - return [list "fail" $output]; + return [list "fail" $output] } - return [list "pass" $output]; + return [list "pass" $output] } -re "(.*)Breakpoint.*exit.*=\[1-9\]\[0-9\]*.*$gdb_prompt $" { - append output $expect_out(1,string); - set result [check_for_board_status output]; - gdb_comm_leave; + append output $expect_out(1,string) + set result [check_for_board_status output] + gdb_comm_leave if { $result == 0 } { - return [list "pass" $output]; + return [list "pass" $output] } if [board_info $dest exists exit_statuses_bad] { - return [list "pass" $output]; + return [list "pass" $output] } - return [list "fail" $output]; + return [list "fail" $output] } -re "(.*)Breakpoint.*exit.*$gdb_prompt $" { - append output $expect_out(1,string); - set status [check_for_board_status output]; - gdb_comm_leave; + append output $expect_out(1,string) + set status [check_for_board_status output] + gdb_comm_leave if { $status > 0 } { - return [list "fail" $output]; + return [list "fail" $output] } - return [list "pass" $output]; + return [list "pass" $output] } -re "(.*)Breakpoint.*abort.*$gdb_prompt $" { - append output $expect_out(1,string); - check_for_board_status output; - gdb_comm_leave; - return [list "fail" $output]; + append output $expect_out(1,string) + check_for_board_status output + gdb_comm_leave + return [list "fail" $output] } -re "SIGTRAP.*$gdb_prompt $" { - return [gdb_comm_reload $dest $prog $args]; + return [gdb_comm_reload $dest $prog $args] } -re "(.*)Program (received |terminated ).*$gdb_prompt $" { - set output $expect_out(1,string); - check_for_board_status output; - gdb_comm_leave; - remote_reboot $dest; - return [list "fail" $output]; + set output $expect_out(1,string) + check_for_board_status output + gdb_comm_leave + remote_reboot $dest + return [list "fail" $output] } -re "(.*)Program exited with code \[0-9\]+.*$gdb_prompt $" { - set output $expect_out(1,string); - set status [check_for_board_status output]; - gdb_comm_leave; + set output $expect_out(1,string) + set status [check_for_board_status output] + gdb_comm_leave if { $status > 0 } { - return [list "fail" $output]; + return [list "fail" $output] } - return [list "pass" $output]; + return [list "pass" $output] } default { - gdb_comm_leave; + gdb_comm_leave if [board_info $dest exists unreliable] { if { [board_info $dest unreliable] > 0 } { - global board_info; - set name [board_info $dest name]; - incr board_info($name,unreliable) -1; - set result [gdb_comm_reload $dest $prog $args]; - incr board_info($name,unreliable); - return $result; + global board_info + set name [board_info $dest name] + incr board_info($name,unreliable) -1 + set result [gdb_comm_reload $dest $prog $args] + incr board_info($name,unreliable) + return $result } } - return [list "fail" ""]; + return [list "fail" ""] } } - gdb_comm_leave; - return [list "fail" ""]; + gdb_comm_leave + return [list "fail" ""] } # If we've tried less than 4 times to load PROG, reboot the target, restart GDB # and try again. Otherwise, return "untested". proc gdb_comm_reload { dest prog aargs } { - global try_again; + global try_again # how many times have we done this? set n_reloads [board_info $dest n_reloads] @@ -550,17 +550,17 @@ proc gdb_comm_reload { dest prog aargs } { } if { $try_again < 4 } { - global GDB; - remote_reboot $dest; - remote_close host; - incr try_again; + global GDB + remote_reboot $dest + remote_close host + incr try_again set result [eval remote_load \"$dest\" \"$prog\" $aargs] - set try_again 0; - return "$result"; + set try_again 0 + return "$result" } else { - set try_again 0; - return [list "untested" ""]; + set try_again 0 + return [list "untested" ""] } } -set_board_info protocol "gdb_comm"; +set_board_info protocol "gdb_comm" diff --git a/config/gdb_stub.exp b/config/gdb_stub.exp index a31fc87..746316c 100644 --- a/config/gdb_stub.exp +++ b/config/gdb_stub.exp @@ -36,61 +36,61 @@ proc gdb_stub_init { dest args } { } if [board_info $dest exists gdb_prompt] { - set gdb_prompt [board_info $dest gdb_prompt]; + set gdb_prompt [board_info $dest gdb_prompt] } else { set gdb_prompt "\\(gdb\\)" } - return 1; + return 1 } proc gdb_stub_restart { dest } { global gdb_prompt global GDB - gdb_stub_init $dest; + gdb_stub_init $dest for {set x 1;} { $x < 4 } {incr x} { - remote_close $dest; - sleep 2; - set command "$GDB -nw -nx"; + remote_close $dest + sleep 2 + set command "$GDB -nw -nx" if [host_info exists gdb_opts] { - append command " [host_info gdb_opts]"; + append command " [host_info gdb_opts]" } - set spawn_id [remote_spawn host $command]; + set spawn_id [remote_spawn host $command] remote_expect host 30 { -re "$gdb_prompt" { } } if { $spawn_id >= 0 } { if [board_info $dest exists baud] { - remote_send host "set remotebaud [board_info $dest baud]\n"; + remote_send host "set remotebaud [board_info $dest baud]\n" remote_expect host 5 { -re "$gdb_prompt" { } default { warning "Error setting baud rate." - return -1; + return -1 } } } - set value [gdb_stub_startup $dest]; + set value [gdb_stub_startup $dest] if { $value > 0 } { - break; + break } - verbose "got $value from gdb_stub_startup"; - remote_send host "quit\n"; + verbose "got $value from gdb_stub_startup" + remote_send host "quit\n" } - remote_reboot $dest; + remote_reboot $dest } if { ${x} < 4 } { - global board_info; - set name [board_info $dest name]; + global board_info + set name [board_info $dest name] - set board_info($name,gdb_is_running) 1; - return 1; + set board_info($name,gdb_is_running) 1 + return 1 } else { - return 0; + return 0 } } @@ -98,33 +98,33 @@ proc gdb_stub_remote_check { dest } { global gdb_prompt if [board_info $dest exists gdb_serial] { - set serial [board_info $dest gdb_serial]; + set serial [board_info $dest gdb_serial] } elseif [board_info $dest exists serial] { - set serial [board_info $dest serial]; + set serial [board_info $dest serial] } else { - set serial [board_info $dest netport]; + set serial [board_info $dest netport] } - remote_send host "target remote $serial\n"; + remote_send host "target remote $serial\n" remote_expect host 10 { -re "Couldn't establish connection.*$gdb_prompt" { - return 0; + return 0 } -re "Remote debugging.*$gdb_prompt" { verbose "stub is already running" - return 1; + return 1 } -re "$gdb_prompt" { - return 0; + return 0 } timeout { - remote_send host "\003"; + remote_send host "\003" remote_expect host 10 { -re "$gdb_prompt" { } } - return 0; + return 0 } default { - return 0; + return 0 } } } @@ -133,50 +133,50 @@ proc gdb_stub_startup { dest } { global gdb_prompt global GDB - set is_running_stub 0; + set is_running_stub 0 if [gdb_stub_remote_check $dest] { - set is_running_stub 1; + set is_running_stub 1 } if [board_info $dest exists serial] { - set serial [board_info $dest serial]; + set serial [board_info $dest serial] } else { - set serial [board_info $dest netport]; + set serial [board_info $dest netport] } if { ! $is_running_stub } { - set command "target [board_info $dest gdb_protocol] $serial\n"; - remote_send host $command; + set command "target [board_info $dest gdb_protocol] $serial\n" + remote_send host $command remote_expect host 5 { -re "already.*y or n." { - remote_send host "y\n"; - exp_continue; + remote_send host "y\n" + exp_continue } -re "appears to be alive.*$gdb_prompt" { } -re "Remote target.*connected to.*$gdb_prompt" { } default { - return -1; + return -1 } } } if { $is_running_stub == 0 } { global libdir - verbose "building loader"; - set loader "loader"; + verbose "building loader" + set loader "loader" 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]"]; + 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]"]; + set result [target_compile "${libdir}/stub-loader.c" $loader executable "ldscript=[board_info $dest gdb_stub_ldscript]"] } - verbose "result is $result"; + verbose "result is $result" if [is_remote host] { - set loader [remote_download host $loader]; + set loader [remote_download host $loader] } } - remote_send host "file $loader\n"; + remote_send host "file $loader\n" remote_expect host 20 { -re "A program is being debug.*Kill it.*y or n. $" { remote_send host "y\n" @@ -189,27 +189,27 @@ proc gdb_stub_startup { dest } { -re "Reading symbols from.*done..*$gdb_prompt $" {} -re "$gdb_prompt $" { warning "GDB couldn't find loader" } timeout { - warning "(timeout) read symbol file" ; + warning "(timeout) read symbol file" return -1 } } if [board_info $dest exists serial] { - set serial [board_info $dest serial]; + set serial [board_info $dest serial] } else { - set serial [board_info $dest netport]; + set serial [board_info $dest netport] } - remote_send host "target [board_info $dest gdb_protocol] $serial\n"; + remote_send host "target [board_info $dest gdb_protocol] $serial\n" remote_expect host 60 { -re "appears to be alive.*$gdb_prompt" { } -re "Remote target.*connected to.*$gdb_prompt" { } -re "$gdb_prompt" { - warning "Error reconnecting to stub."; - return -1; + warning "Error reconnecting to stub." + return -1 } default { - warning "Error reconnecting to stub."; - return -1; + warning "Error reconnecting to stub." + return -1 } } @@ -218,23 +218,23 @@ proc gdb_stub_startup { dest } { 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"; + remote_send host "load $loader\n" } verbose "Loading $loader into $GDB" 2 global verbose - set no_run_command 0; + set no_run_command 0 # FIXME: The value 1200 below should be a parameter. remote_expect host 1200 { -re "Transfer rate:.*Switching to remote protocol.*Remote debugging" { - set no_run_command 1; - remote_send host ""; - sleep 2; - remote_send host ""; - sleep 1; + set no_run_command 1 + remote_send host "" + sleep 2 + remote_send host "" + sleep 1 } -re "Loading.*Starting.*at.*$gdb_prompt $" { verbose "Loaded $loader into $GDB" 1 - set no_run_command 1; + set no_run_command 1 } -re "Loading.*$gdb_prompt $" { verbose "Loaded $loader into $GDB" 1 @@ -252,7 +252,7 @@ proc gdb_stub_startup { dest } { } if { ! $no_run_command } { - remote_send host "run\n"; + remote_send host "run\n" remote_expect host 60 { -re "A program is being debug.*Kill it.*y or n. $" { remote_send host "y\n" @@ -263,19 +263,19 @@ proc gdb_stub_startup { dest } { exp_continue } -re "Starting program:.*loader.*$" { - verbose "Starting loader succeeded" + verbose "Starting loader succeeded" } timeout { - warning "(timeout) starting the loader" ; + warning "(timeout) starting the loader" return -1 } default { - warning "error starting the loader"; + warning "error starting the loader" } } - sleep 2; + sleep 2 remote_send host "" - sleep 1; + sleep 1 remote_send host "" verbose "Sent ^C^C" remote_expect host 30 { @@ -284,21 +284,21 @@ proc gdb_stub_startup { dest } { exp_continue } -re "$gdb_prompt $" { - verbose "Running loader succeeded" + verbose "Running loader succeeded" } timeout { - warning "(timeout) interrupting the loader" ; + warning "(timeout) interrupting the loader" return -1 } default { - warning "error interrupting the loader"; + warning "error interrupting the loader" } } } - remote_send host "quit\n"; - return [gdb_stub_restart $dest]; + remote_send host "quit\n" + return [gdb_stub_restart $dest] } - return 1; + return 1 } # @@ -323,7 +323,7 @@ proc gdb_stub_delete_breakpoints {} { -re "$gdb_prompt $" { warning "breakpoints not deleted" ; return -1} timeout { warning "info breakpoints (timeout)" ; return -1} } - return 0; + return 0 } proc gdb_stub_go_idle { dest } { @@ -345,68 +345,68 @@ proc gdb_stub_add_breakpoint { function args } { } proc gdb_stub_start { dest } { - global gdb_prompt; + global gdb_prompt - set exit_brnum [gdb_stub_add_breakpoint _exit]; + set exit_brnum [gdb_stub_add_breakpoint _exit] if { $exit_brnum == "undef" || [board_info $dest exists always_break_exit] } { - set exit_brnum [gdb_stub_add_breakpoint exit]; + set exit_brnum [gdb_stub_add_breakpoint exit] } - set abort_brnum [gdb_stub_add_breakpoint abort]; + set abort_brnum [gdb_stub_add_breakpoint abort] upvar #0 gdb_stub_info I set I($dest,exit_brnum) $exit_brnum set I($dest,abort_brnum) $abort_brnum - remote_send host "set \$fp=0\n"; + remote_send host "set \$fp=0\n" remote_expect host 10 { -re "$gdb_prompt" { } } # This is needed for the SparcLite. Whee. if [board_info $dest exists gdb,start_symbol] { - set start_comm "jump *[board_info $dest gdb,start_symbol]\n"; + set start_comm "jump *[board_info $dest gdb,start_symbol]\n" } else { - set start_comm "jump *start\n"; + set start_comm "jump *start\n" } - remote_send host "break copyloop\n"; + remote_send host "break copyloop\n" remote_expect host 10 { -re "Breakpoint.*$gdb_prompt $" { - set start_comm "continue\n"; + set start_comm "continue\n" } -re "Function.*not defined.*$gdb_prompt $" { } default { } } - remote_send host $start_comm; + remote_send host $start_comm remote_expect host 10 { -re "y or n. $" { remote_send host "y\n" - exp_continue; + exp_continue } -re "Breakpoint.*in copyloop.*$gdb_prompt $" { - remote_send host "jump relocd\n"; - exp_continue; + remote_send host "jump relocd\n" + exp_continue } -re "Continuing at.*\[\r\n\]" { } default { - return { "fail" "" }; + return { "fail" "" } } } - return { "pass" "" }; + return { "pass" "" } } proc gdb_stub_spawn { dest prog args } { for { set x 0; } { $x < 3 } { incr x } { if { [remote_ld $dest $prog] != 1 } { - return [list "fail" "remote_ld failed"]; + return [list "fail" "remote_ld failed"] } - set result [gdb_stub_start $dest]; + set result [gdb_stub_start $dest] if { [lindex $result 0] != "pass" } { - remote_reboot target; + remote_reboot target } else { return 666; # does anyone use this value? } } - return -1; + return -1 } proc gdb_stub_wait { dest timeout } { @@ -420,55 +420,55 @@ proc gdb_stub_wait { dest timeout } { remote_expect host $timeout { -re "Breakpoint.*exit.*=0.*$gdb_prompt $" { gdb_stub_go_idle $dest - return [list 0 ""]; + return [list 0 ""] } -re "Breakpoint.*exit.*=\[1-9\]\[0-9\]*.*$gdb_prompt $" { gdb_stub_go_idle $dest - return [list 0 ""]; + return [list 0 ""] } -re "Breakpoint.*exit.*$gdb_prompt $" { gdb_stub_go_idle $dest - return [list 0 ""]; + return [list 0 ""] } -re "Breakpoint.*abort.*$gdb_prompt $" { gdb_stub_go_idle $dest - return [list 1 ""]; + return [list 1 ""] } -re " EXIT code 0.*$gdb_prompt $" { - gdb_stub_go_idle $dest; - return [list 0 ""]; + gdb_stub_go_idle $dest + return [list 0 ""] } -re " EXIT code \[1-9]\[0-9]*.*$gdb_prompt $" { - gdb_stub_go_idle $dest; - return [list 0 ""]; + gdb_stub_go_idle $dest + return [list 0 ""] } -re " EXIT code 4242.*$gdb_prompt $" { - gdb_stub_go_idle $dest; - return [list 1 ""]; + gdb_stub_go_idle $dest + return [list 1 ""] } -re "Program received.*$gdb_prompt $" { gdb_stub_go_idle $dest - return [list 1 ""]; + return [list 1 ""] } -re "Program exited.*$gdb_prompt $" { gdb_stub_go_idle $dest - return [list 1 ""]; + return [list 1 ""] } -re "Breakpoint $exit_brnum.*$gdb_prompt $" { - gdb_stub_go_idle $dest; - return [list 0 ""]; + gdb_stub_go_idle $dest + return [list 0 ""] } -re "Breakpoint $abort_brnum.*$gdb_prompt $" { - gdb_stub_go_idle $dest; - return [list 1 ""]; + gdb_stub_go_idle $dest + return [list 1 ""] } default { - remote_close $dest; - remote_reboot $dest; - return [list -1 ""]; + remote_close $dest + remote_reboot $dest + return [list -1 ""] } } - return [list -1 ""]; + return [list -1 ""] } proc gdb_stub_load { dest prog args } { @@ -477,43 +477,43 @@ proc gdb_stub_load { dest prog args } { for { set x 0; } { $x < [llength $args] } { incr x } { if { [lindex $args $x] != "" } { - return [list "unsupported" "no support for [lindex $argnames $x] on this target"]; + return [list "unsupported" "no support for [lindex $argnames $x] on this target"] } } - set result [remote_spawn $dest $prog]; + set result [remote_spawn $dest $prog] if { $result < 0 } { - return [list "fail" "remote_spawn failed"]; + return [list "fail" "remote_spawn failed"] } # FIXME: The value 120 should be a parameter. - set result [remote_wait $dest 120]; - set status [lindex $result 0]; - set output [lindex $result 1]; + set result [remote_wait $dest 120] + set status [lindex $result 0] + set output [lindex $result 1] if { $status == 0 } { - return [list "pass" $output]; + return [list "pass" $output] } else if { $status > 0 } { - return [list "fail" $output]; + return [list "fail" $output] } else { - global gdb_stub_retry; + global gdb_stub_retry if ![info exists gdb_stub_retry] { - set gdb_stub_retry 1; + set gdb_stub_retry 1 - set result [eval gdb_stub_load \{$dest\} \{$prog\} $args]; - unset gdb_stub_retry; - return $result; + set result [eval gdb_stub_load \{$dest\} \{$prog\} $args] + unset gdb_stub_retry + return $result } else { - return [list "fail" $output]; + return [list "fail" $output] } } } # -# gdb_stub_ld -- load PROG into the board; +# gdb_stub_ld -- load PROG into the board # Returns a 0 if there was an error, # 1 if it loaded successfully. # @@ -523,7 +523,7 @@ proc gdb_stub_ld { dest prog } { if ![board_info $dest exists gdb_is_running] { if ![gdb_stub_restart $dest] { - return 0; + return 0 } } @@ -544,11 +544,11 @@ proc gdb_stub_ld { dest prog } { -re "$gdb_prompt $" { # Hmmm...is retrying going to help? I kinda doubt it. warning "GDB couldn't read file" - return [gdb_stub_retry_ld "$dest" "$prog"]; + return [gdb_stub_retry_ld "$dest" "$prog"] } timeout { - warning "(timeout) read symbol file"; - return [gdb_stub_retry_ld "$dest" "$prog"]; + warning "(timeout) read symbol file" + return [gdb_stub_retry_ld "$dest" "$prog"] } } @@ -556,17 +556,17 @@ proc gdb_stub_ld { dest prog } { gdb_stub_delete_breakpoints if [board_info $dest exists gdb_serial] { - set serial [board_info $dest gdb_serial]; + set serial [board_info $dest gdb_serial] } elseif [board_info $dest exists serial] { - set serial [board_info $dest serial]; + set serial [board_info $dest serial] } else { - set serial [board_info $dest netport]; + set serial [board_info $dest netport] } remote_send host "target remote $serial\n" remote_expect host 60 { -re "Kill it?.*y or n.*" { - remote_send host "y\n"; + remote_send host "y\n" exp_continue } -re "$gdb_prompt $" { @@ -579,13 +579,13 @@ proc gdb_stub_ld { dest prog } { } if [board_info $dest exists gdb_load_offset] { - set offset "[board_info $dest gdb_load_offset]"; + set offset "[board_info $dest gdb_load_offset]" } else { - set offset ""; + set offset "" } remote_send host "load $prog $offset\n" verbose "Loading $prog into $GDB" 2 - global verbose; + global verbose remote_expect host 1200 { -re "Loading.*$gdb_prompt $" { verbose "Loaded $prog into $GDB" 1 @@ -609,30 +609,30 @@ proc gdb_stub_ld { dest prog } { # proc gdb_stub_retry_ld { dest prog } { - global gdb_stub_retry_ld; + global gdb_stub_retry_ld - remote_reboot $dest; + remote_reboot $dest if [info exists gdb_stub_retry_ld] { - unset gdb_stub_retry_ld; - return 0; + unset gdb_stub_retry_ld + return 0 } else { - set gdb_stub_retry_ld 1; + set gdb_stub_retry_ld 1 } - gdb_stub_restart $dest; - set status [gdb_stub_ld $dest $prog]; + gdb_stub_restart $dest + set status [gdb_stub_ld $dest $prog] if [info exists gdb_stub_retry_ld] { - unset gdb_stub_retry_ld; + unset gdb_stub_retry_ld } - return $status; + return $status } proc gdb_stub_close { dest } { global board_info - set name [board_info $dest name]; + set name [board_info $dest name] if [info exists board_info($name,gdb_is_running)] { - unset board_info($name,gdb_is_running); + unset board_info($name,gdb_is_running) } - return [remote_close host]; + return [remote_close host] } set_board_info protocol "gdb_stub" diff --git a/config/h8300.exp b/config/h8300.exp index bd36fce..1affda1 100644 --- a/config/h8300.exp +++ b/config/h8300.exp @@ -17,4 +17,4 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/i386-bozo.exp b/config/i386-bozo.exp index f25ac72..4e28116 100644 --- a/config/i386-bozo.exp +++ b/config/i386-bozo.exp @@ -17,30 +17,30 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" proc ${board}_init { args } { - set linux_box [target_info linux_box]; - set bozo_server [target_info bozo_server]; - remote_spawn $linux_box "$bozo_server unknown"; + set linux_box [target_info linux_box] + set bozo_server [target_info bozo_server] + remote_spawn $linux_box "$bozo_server unknown" remote_expect $linux_box 60 { -re "port is (\[0-9\]+)" { - set_currtarget_info netport "${linux_box}:$expect_out(1,string)"; + set_currtarget_info netport "${linux_box}:$expect_out(1,string)" } } } proc ${board}_close { board } { - set linux_box [board_info $board linux_box]; + set linux_box [board_info $board linux_box] if [board_info $linux_box exists fileid] { - remote_send $linux_box "\003"; - remote_close $linux_box; + remote_send $linux_box "\003" + remote_close $linux_box } - standard_close $board; + standard_close $board } proc ${board}_reboot { board args } { - remote_close $board; - unset_currtarget_info netport; - return 1; + remote_close $board + unset_currtarget_info netport + return 1 } diff --git a/config/i960.exp b/config/i960.exp index e6f8bd3..1c722d6 100644 --- a/config/i960.exp +++ b/config/i960.exp @@ -23,22 +23,22 @@ # getting a valid prompt. # proc ${board}_init { dest } { - global i960_try_count; + global i960_try_count - set prompt [board_info $dest shell_prompt]; - set done 0; + set prompt [board_info $dest shell_prompt] + set done 0 if ![info exists i960_try_count] { - set i960_try_count 1; + set i960_try_count 1 } - remote_close $dest; + remote_close $dest if { [remote_open $dest] != "" } { for { set tries 0; } { $tries < 7 && ! $done } { incr tries } { - remote_send $dest "\n"; + remote_send $dest "\n" remote_expect $dest 1 { -re "${prompt}" { - set done 1; + set done 1 } -re ".+" { exp_continue } timeout { } @@ -46,18 +46,18 @@ proc ${board}_init { dest } { } } - remote_close $dest; + remote_close $dest if { ! $done } { if { $i960_try_count == 3 } { - perror "Couldn't connect to board."; + perror "Couldn't connect to board." } else { - incr i960_try_count; - remote_close $dest; - remote_reboot $dest; + incr i960_try_count + remote_close $dest + remote_reboot $dest } } if [info exists i960_try_count] { - unset i960_try_count; + unset i960_try_count } } @@ -66,156 +66,156 @@ proc i960_ld { dest prog } { perror "$prog does not exist." return "untested" } - set shell_prompt [board_info $dest shell_prompt]; - set strip [board_info $dest strip]; - set rprog [remote_download host $prog a.out]; + set shell_prompt [board_info $dest shell_prompt] + set strip [board_info $dest strip] + set rprog [remote_download host $prog a.out] if { $strip != "" } { - remote_exec host $strip $rprog; + remote_exec host $strip $rprog } - remote_upload host $rprog a.out; + remote_upload host $rprog a.out - set id [remote_open $dest]; + set id [remote_open $dest] if { $id < 0 } { - return -1; + return -1 } - remote_binary $dest; - remote_send $dest "\n"; + remote_binary $dest + remote_send $dest "\n" remote_expect $dest 5 { -re $shell_prompt { } } - remote_send $dest "do\n"; + remote_send $dest "do\n" remote_expect $dest 5 { -re "Downloading" { } } # Nasty. if { [board_info $dest connect] == "telnet" } { - global board_info; + global board_info - remote_close $dest; - set hp [split [board_info $dest netport] ":"]; - set host [lindex $hp 0]; - set port [lindex $hp 1]; - set status -1; + remote_close $dest + set hp [split [board_info $dest netport] ":"] + set host [lindex $hp 0] + set port [lindex $hp 1] + set status -1 while { $status != 0 } { - set status [catch "socket $host $port" id2]; + set status [catch "socket $host $port" id2] if { $status != 0 } { - sleep 5; + sleep 5 } } } else { - set id2 [exp_open -leaveopen -i $id]; + set id2 [exp_open -leaveopen -i $id] } if [catch "exec sx -bX a.out <@$id2 >@$id2 2>/dev/null" error] { perror "exec sx failed: $error" } if { [board_info $dest connect] == "telnet" } { - close $id2; - sleep 2; - remote_open $dest; - remote_binary $dest; + close $id2 + sleep 2 + remote_open $dest + remote_binary $dest } - set result 1; - remote_send $dest "\n"; + set result 1 + remote_send $dest "\n" remote_expect $dest 1 { -re "$shell_prompt" { - set result 0; - exp_continue; + set result 0 + exp_continue } timeout { } } - return $result; + return $result } proc i960_spawn { dest prog args } { - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] for { set tries 0 ; } { $tries < 3 } { incr tries } { - set result [remote_ld $dest $prog]; + set result [remote_ld $dest $prog] if { $result == 0 } { - set comm "go [board_info $dest start_addr]"; - remote_send $dest "$comm\n"; + set comm "go [board_info $dest start_addr]" + remote_send $dest "$comm\n" remote_expect $dest 10 { -re "$comm\[\r\n\]\[\r\n\]?" { } default { } } - return [board_info $dest fileid]; + return [board_info $dest fileid] } else { - remote_reboot $dest; + remote_reboot $dest } } - return -1; + return -1 } proc i960_wait { dest timeout } { - set output ""; - set shell_prompt [board_info $dest shell_prompt]; + set output "" + set shell_prompt [board_info $dest shell_prompt] remote_expect $dest $timeout { -re " fault at \[0-9a-h\]+, subtype \[0-9a-h\]+" { - set status -1; - exp_continue; + set status -1 + exp_continue } -re "(.*)(\[\r\n\]|^)Program Exit: (\[0-9\]+)\[\r\n\]" { - append output $expect_out(1,string); - set status $expect_out(3,string); - exp_continue; + append output $expect_out(1,string) + set status $expect_out(3,string) + exp_continue } -re "(.*)$shell_prompt" { - append output $expect_out(1,string); - set bstatus [check_for_board_status output]; + append output $expect_out(1,string) + set bstatus [check_for_board_status output] if { $bstatus >= 0 } { - set status $bstatus; + set status $bstatus } } -re "\[\r\n\]+" { # Sometimes the board goes wacky in the head, and we have # to shoot it. - append output $expect_out(buffer); + append output $expect_out(buffer) if { [string length $output] < 512000 } { - exp_continue; + exp_continue } else { - set status -1; + set status -1 } } default { - set status -1; + set status -1 } } - return [list $status $output]; + return [list $status $output] } proc i960_load { dest prog args } { for { set x 0; } { $x < 3 } { incr x; } { - set id [eval remote_spawn \{$dest\} \{$prog\} $args]; + set id [eval remote_spawn \{$dest\} \{$prog\} $args] if { $id < 0 } { - return [list "fail" ""]; + return [list "fail" ""] } - set result [remote_wait $dest 120]; - set status [lindex $result 0]; - set output [lindex $result 1]; + set result [remote_wait $dest 120] + set status [lindex $result 0] + set output [lindex $result 1] if { $status == 0 } { - return [list "pass" $output]; + return [list "pass" $output] } else { - global i960_retry; + global i960_retry if { [board_info $dest exists unreliable] && ![info exists i960_retry] } { - set i960_retry 1; - remote_reboot $dest; - set result [eval i960_load \{$dest\} \{$prog\} $args]; - unset i960_retry; - return $result; + set i960_retry 1 + remote_reboot $dest + set result [eval i960_load \{$dest\} \{$prog\} $args] + unset i960_retry + return $result } else { if { $status < 0 } { - remote_reboot $dest; + remote_reboot $dest } - return [list "fail" $output]; + return [list "fail" $output] } } } } -set_board_info shell_prompt "=>"; -set_board_info send_initial_cr 1; +set_board_info shell_prompt "=>" +set_board_info send_initial_cr 1 # We take care of getting a prompt in ${board}_init. -set_board_info dont_wait_for_prompt 1; +set_board_info dont_wait_for_prompt 1 diff --git a/config/m32r-stub.exp b/config/m32r-stub.exp index d5bbeb1..fa43509 100644 --- a/config/m32r-stub.exp +++ b/config/m32r-stub.exp @@ -17,4 +17,4 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb_stub"; +load_generic_config "gdb_stub" diff --git a/config/m32r.exp b/config/m32r.exp index bd36fce..1affda1 100644 --- a/config/m32r.exp +++ b/config/m32r.exp @@ -17,4 +17,4 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/m68hc11.exp b/config/m68hc11.exp index 6c1fa65..fa8097c 100644 --- a/config/m68hc11.exp +++ b/config/m68hc11.exp @@ -17,4 +17,4 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/m68k-emc.exp b/config/m68k-emc.exp index 6b13dc1..d6db29b 100644 --- a/config/m68k-emc.exp +++ b/config/m68k-emc.exp @@ -18,34 +18,34 @@ # bug-dejagnu@gnu.org proc ${board}_init { dest } { - global doing_emc_init; + global doing_emc_init if [info exists doing_emc_init] { - return; + return } - set doing_emc_init 1; - remote_close $dest; - set dos_host [board_info $dest dos_host]; - remote_reboot $dos_host; - unset doing_emc_init; + set doing_emc_init 1 + remote_close $dest + set dos_host [board_info $dest dos_host] + remote_reboot $dos_host + unset doing_emc_init } proc m68k_emc_board_connect { dest } { - global board_info; - set tname [board_info $dest name]; + global board_info + set tname [board_info $dest name] - set board_info($tname,m68k_connected) 1; - set dos_host [board_info $dest dos_host]; + set board_info($tname,m68k_connected) 1 + set dos_host [board_info $dest dos_host] for { set x 0; } { $x < 3 } { incr x; } { - set shell_id [remote_open $dos_host]; + set shell_id [remote_open $dos_host] if { $shell_id == "" || $shell_id < 0 } { - remote_reboot $dos_host; + remote_reboot $dos_host } else { - break; + break } } - remote_send $dos_host "c:\\symetrix.bat\n"; + remote_send $dos_host "c:\\symetrix.bat\n" remote_expect $dos_host 300 { -re "SymmComm.*Installed.*\033.2J.*\033.2J" { } default { @@ -57,13 +57,13 @@ proc m68k_emc_board_connect { dest } { -re ".+" { exp_continue; } } # Get past first menu. - remote_send $dos_host "\n"; + remote_send $dos_host "\n" remote_expect $dos_host 10 { -re "\033.07;02H" { } default { } } # We don't want a log file. - remote_send $dos_host "\n"; + remote_send $dos_host "\n" remote_expect $dos_host 10 { -re "\033.02;24H" { } default { } diff --git a/config/mips-idt.exp b/config/mips-idt.exp index f5427e9..76c7ca2 100644 --- a/config/mips-idt.exp +++ b/config/mips-idt.exp @@ -19,6 +19,6 @@ # For MIPS/IDT we use gdb to load and execute programs. -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" -set_board_info gdb_init_command "set syn-garbage-limit 0"; +set_board_info gdb_init_command "set syn-garbage-limit 0" diff --git a/config/mn10200-eval.exp b/config/mn10200-eval.exp index 54bb269..0f7a051 100644 --- a/config/mn10200-eval.exp +++ b/config/mn10200-eval.exp @@ -19,4 +19,4 @@ # For MN10200 evaluation boards we use gdb to load and execute programs. -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/mn10300-eval.exp b/config/mn10300-eval.exp index 1e3e42c..3405287 100644 --- a/config/mn10300-eval.exp +++ b/config/mn10300-eval.exp @@ -19,4 +19,4 @@ # For MN10300 evaluation boards we use gdb to load and execute programs. -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/netware.exp b/config/netware.exp index 5658de2..af670b1 100644 --- a/config/netware.exp +++ b/config/netware.exp @@ -37,11 +37,11 @@ proc ${board}_init { args } { } set shell_prompt "Password:" - set shell_id [remote_open target]; + set shell_id [remote_open target] if [target_info exists passwd] { - set passwd [target_info passwd]; + set passwd [target_info passwd] } else { - set passwd ""; + set passwd "" } if $shell_id<0 then { warning "Couldn't connect to target" @@ -95,9 +95,9 @@ proc ${board}_load { dest prog args } { global errorCode if [board_info $dest exists fileid] { - set shell_id [board_info $dest fileid]; + set shell_id [board_info $dest fileid] } else { - set shell_id -1; + set shell_id -1 } set output "" @@ -210,5 +210,5 @@ proc ${board}_load { dest prog args } { # proc ${board}_exit {} { - remote_close target; + remote_close target } diff --git a/config/powerpc-bug.exp b/config/powerpc-bug.exp index bd36fce..1affda1 100644 --- a/config/powerpc-bug.exp +++ b/config/powerpc-bug.exp @@ -17,4 +17,4 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/proelf.exp b/config/proelf.exp index e816a49..5c34681 100644 --- a/config/proelf.exp +++ b/config/proelf.exp @@ -17,9 +17,9 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "base68k"; +load_generic_config "base68k" set_board_info shell_prompt "#" -set_board_info download_command "r 0\n"; +set_board_info download_command "r 0\n" set_board_info go_command "g" set_board_info startaddr "40000" diff --git a/config/rom68k.exp b/config/rom68k.exp index f8a8143..9e9d0ca 100644 --- a/config/rom68k.exp +++ b/config/rom68k.exp @@ -20,11 +20,11 @@ # This file was written by Bob Manson (manson@cygnus.com) # based on earlier work by J.T. Conklin (jtc@cygnus.com) -load_generic_config "base68k"; +load_generic_config "base68k" set_board_info shell_prompt "ROM68K :-> " -set_board_info download_command "DC\n"; -set_board_info download_response "Waiting for S-records from host... "; +set_board_info download_command "DC\n" +set_board_info download_response "Waiting for S-records from host... " set_board_info go_command "GO" set_board_info startaddr "10000" set_board_info hex_startaddr "0x10000" diff --git a/config/sh.exp b/config/sh.exp index bd36fce..1affda1 100644 --- a/config/sh.exp +++ b/config/sh.exp @@ -17,4 +17,4 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb-comm"; +load_generic_config "gdb-comm" diff --git a/config/sid.exp b/config/sid.exp index 0805b40..fceaf0d 100644 --- a/config/sid.exp +++ b/config/sid.exp @@ -42,7 +42,7 @@ proc set_host_info { entry value } { set machine host if [info exists target_info($machine,name)] { - set machine $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 2441a7c..3471f27 100644 --- a/config/sim.exp +++ b/config/sim.exp @@ -28,7 +28,7 @@ proc sim_spawn { dest cmdline args } { perror "no simulator defined for [board_info $dest name]" exit 1 } else { - set sim [board_info $dest sim]; + set sim [board_info $dest sim] } if [board_info $dest exists sim,options] { @@ -40,7 +40,7 @@ proc sim_spawn { dest cmdline args } { if ![is_remote host] { if { [which $sim] == 0 } { verbose -log "Simulator $sim missing." 3 - return -1; + return -1 } } @@ -49,15 +49,15 @@ proc sim_spawn { dest cmdline args } { # we're assuming the program is the first word in the command. # FIXME: "prog < infile" won't work until we download infile. set prog [lindex $cmdline 0] - set prog [remote_download host $prog a.out]; + set prog [remote_download host $prog a.out] set cmdline [lreplace $cmdline 0 0 $prog] } - return [eval remote_spawn host \{ $sim $simflags $cmdline \} $args]; + return [eval remote_spawn host \{ $sim $simflags $cmdline \} $args] } proc sim_wait { dest timeout } { - return [remote_wait host $timeout]; + return [remote_wait host $timeout] } proc sim_load { dest prog args } { @@ -71,16 +71,16 @@ proc sim_load { dest prog args } { 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" ""]; + return [list "untested" ""] } if [board_info $dest exists sim_time_limit] { - set sim_time_limit [board_info $dest sim_time_limit]; + set sim_time_limit [board_info $dest sim_time_limit] } else { set sim_time_limit 240 } - set output ""; + set output "" if { [board_info target sim,protocol] == "sid" } { set cmd "-e \"set cpu-loader file [list $prog]\"" @@ -94,21 +94,21 @@ proc sim_load { dest prog args } { # this isn't as nice as limiting the amount of CPU time, it # will have to do. if { $inpfile != "" } { - set res [remote_spawn target "${cmd} < $inpfile" "readonly"]; + set res [remote_spawn target "${cmd} < $inpfile" "readonly"] } else { - set res [remote_spawn target "${cmd}"]; + set res [remote_spawn target "${cmd}"] } if { $res <= 0 } { - return [list "fail" "remote_spawn failed"]; + return [list "fail" "remote_spawn failed"] } - set state [remote_wait target $sim_time_limit]; - set status [lindex $state 0]; - set output [lindex $state 1]; - verbose "Output is $output"; + set state [remote_wait target $sim_time_limit] + set status [lindex $state 0] + set output [lindex $state 1] + verbose "Output is $output" - set status2 [check_for_board_status output]; + set status2 [check_for_board_status output] if { $status2 >= 0 } { set status $status2 } @@ -122,10 +122,10 @@ proc sim_load { dest prog args } { } else { set result "fail" } - return [list $result $output]; + return [list $result $output] } -set_board_info protocol "sim"; +set_board_info protocol "sim" # By default, assume the simulator is slow. This causes some tests # to either be simplified or skipped completely. diff --git a/config/slite.exp b/config/slite.exp index 081666b..392e347 100644 --- a/config/slite.exp +++ b/config/slite.exp @@ -17,4 +17,4 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@gnu.org -load_generic_config "gdb_stub"; +load_generic_config "gdb_stub" diff --git a/config/sparclet.exp b/config/sparclet.exp index 9d478ce..9f13e68 100644 --- a/config/sparclet.exp +++ b/config/sparclet.exp @@ -19,8 +19,8 @@ # This file was written by Michael Snyder . -load_generic_config "gdb_stub"; +load_generic_config "gdb_stub" # This is the old GDB prompt for the toolchain. # Uncomment for old tests -#set_board_info gdb_prompt "\\(gdbslet\\)"; +#set_board_info gdb_prompt "\\(gdbslet\\)" diff --git a/config/tic80.exp b/config/tic80.exp index 817fa64..feeb5f2 100644 --- a/config/tic80.exp +++ b/config/tic80.exp @@ -26,75 +26,75 @@ # proc tic80_load { dest prog args } { - set dos_box [board_info $dest dos_host]; + set dos_box [board_info $dest dos_host] - remote_spawn $dos_box [board_info $dest io_program]; + remote_spawn $dos_box [board_info $dest io_program] - set status [remote_ld $dest $prog]; + set status [remote_ld $dest $prog] if { $status != "pass" } { - return $status; + return $status } - set result [remote_wait $dos_box 300]; - set output [lindex $result 1]; + set result [remote_wait $dos_box 300] + set output [lindex $result 1] if { [lindex $result 0] < 0 } { if [board_info $dos_box exists fileid] { - dos_interrupt_job $dos_box; + dos_interrupt_job $dos_box } else { - remote_close $dos_box; + remote_close $dos_box } } - set status "fail"; - regsub "(\\*\\*\\* EXIT code \[0-9\]+\[\r\n]+).*$" "$output" "\\1" output; - verbose "board out is $output"; - set bstatus [check_for_board_status output]; + set status "fail" + regsub "(\\*\\*\\* EXIT code \[0-9\]+\[\r\n]+).*$" "$output" "\\1" output + verbose "board out is $output" + set bstatus [check_for_board_status output] if { [lindex $result 0] >= 0 } { if { $bstatus == 0 } { - set status "pass"; + set status "pass" } } - remote_file build delete "a.fix"; - return [list $status $output]; + remote_file build delete "a.fix" + return [list $status $output] } proc tic80_ld { dest prog } { - set dos_box [board_info $dest dos_host]; - set dopush 0; + set dos_box [board_info $dest dos_host] + set dopush 0 if { [remote_swap_conn $dos_box] == "fail" } { if { [remote_push_conn $dos_box] == "fail" } { - set dopush 1; + set dopush 1 } - remote_open $dos_box; + remote_open $dos_box } - set prog [remote_download $dos_box $prog "a.fix"]; + set prog [remote_download $dos_box $prog "a.fix"] - remote_spawn $dos_box "[board_info $dest start_program] $prog"; + remote_spawn $dos_box "[board_info $dest start_program] $prog" remote_expect $dos_box 10 { -re "file\[(\]s\[)\] copied" {} } - sleep 3; - dos_interrupt_job $dos_box; + sleep 3 + dos_interrupt_job $dos_box if { $dopush } { - remote_push_conn $dos_box; + remote_push_conn $dos_box } else { - remote_swap_conn $dos_box; + remote_swap_conn $dos_box } - return "pass"; + return "pass" } # # Close the connection to the DOS box. # proc tic80_close { host } { - set dos_box [board_info $host dos_host]; + set dos_box [board_info $host dos_host] - return [remote_close $dos_box]; + return [remote_close $dos_box] } -set_board_info protocol "tic80"; -set_board_info gdb,use_standard_load 1; -set_board_info gdb,no_push_conn 1; -set_board_info gdb,do_reload_on_run 1; +set_board_info protocol "tic80" +set_board_info gdb,use_standard_load 1 +set_board_info gdb,no_push_conn 1 +set_board_info gdb,do_reload_on_run 1 set_board_info gdb,use_breakpoint_for_stub 1 diff --git a/config/udi.exp b/config/udi.exp index 4719d45..c7a7f07 100644 --- a/config/udi.exp +++ b/config/udi.exp @@ -30,18 +30,18 @@ # proc udi_load { dest prog args } { - set shell_prompt [board_info $dest shell_prompt]; - set output ""; + set shell_prompt [board_info $dest shell_prompt] + set output "" if ![file exists $prog] then { perror "$prog does not exist." verbose -log "$prog does not exist." 3 - return [list "untested" ""]; + return [list "untested" ""] } # Load the program. if ![board_info $dest exists fileid] then { - remote_open $dest; + remote_open $dest if ![board_info $dest exists fileid] then { verbose -log "$prog not executed, couldn't connect to $dest." 3 return "untested" @@ -50,50 +50,50 @@ proc udi_load { dest prog args } { if { [remote_ld $dest $prog] == "" } { verbose -log "$prog not executed, load failed." 3 - return [list "unresolved" ""]; + return [list "unresolved" ""] } # Execute it. set result -1 - set output ""; - set noappend 0; + set output "" + set noappend 0 verbose "Executing $prog." 2 remote_send $dest "g\n" # FIXME: The value 300 below should be a parameter. remote_expect $dest 300 { -re "(.*)Process exited with 0x0\[^\r\n\]*\[\r\n\]" { - append output $expect_out(1,string); + append output $expect_out(1,string) verbose "$prog executed successfully" 2 - set noappend 1; - set result 0; - exp_continue; + set noappend 1 + set result 0 + exp_continue } -re "(.*)Halt instruction encountered" { - append output $expect_out(1,string); + append output $expect_out(1,string) verbose "$prog got a HALT instruction" 2 - set result 1; - set noappend 1; - exp_continue; + set result 1 + set noappend 1 + exp_continue } -re "(^|\[\r\n\])$shell_prompt" { if { $result == -1 } { - exp_continue; + exp_continue } } -re "(^|\[\r\n\]+)g\[\r\n\]+" { - exp_continue; + exp_continue } -re "\[\r\n\]+" { if { ! $noappend } { - append output $expect_out(buffer); + append output $expect_out(buffer) if { [string length $output] < 512000 } { - exp_continue; + exp_continue } else { - set result 1; + set result 1 } } else { - exp_continue; + exp_continue } } timeout { @@ -104,12 +104,12 @@ proc udi_load { dest prog args } { # See what happened. switch -- $result { 0 { - set status [check_for_board_status output]; + set status [check_for_board_status output] if { $status < 0 } { blammo } if { $status > 0 } { - set result "fail"; + set result "fail" } else { set result "pass" } @@ -125,7 +125,7 @@ proc udi_load { dest prog args } { # Get nastier. We want to leave the system in a state # ready to run the next testcase. remote_send $dest "q\n" - remote_close $dest; + remote_close $dest set udi_shell_id [remote_open $dest] if { $udi_shell_id < 0 } { perror "Couldn't reset $dest." @@ -142,7 +142,7 @@ proc udi_load { dest prog args } { set result "unresolved" } } - return [list $result $output]; + return [list $result $output] } # @@ -150,9 +150,9 @@ proc udi_load { dest prog args } { # proc udi_exit {} { - remote_close target; + remote_close target } -set_board_info protocol "udi"; -set_board_info connect "mondfe"; -set_board_info shell_prompt "mondfe>"; +set_board_info protocol "udi" +set_board_info connect "mondfe" +set_board_info shell_prompt "mondfe>" diff --git a/config/unix.exp b/config/unix.exp index 971ed2a..c8263d7 100644 --- a/config/unix.exp +++ b/config/unix.exp @@ -39,13 +39,13 @@ proc unix_load { dest prog args } { set orig_ld_library_path "" if { [llength $args] > 0 } { - set parg [lindex $args 0]; + set parg [lindex $args 0] } else { set parg "" } if { [llength $args] > 1 } { - set inp [lindex $args 1]; + set inp [lindex $args 1] } else { set inp "" } @@ -61,7 +61,7 @@ proc unix_load { dest prog args } { if { "$inp" != "" } { set command "$prog $parg < $inp" } else { - set command "$prog $parg"; + set command "$prog $parg" } if ![info exists ld_library_path] { @@ -73,14 +73,14 @@ proc unix_load { dest prog args } { setenv SHLIB_PATH "$ld_library_path:$orig_ld_library_path" verbose -log "Setting LD_LIBRARY_PATH to $ld_library_path:$orig_ld_library_path" 2 - set id [remote_spawn $dest "$command" "readonly"]; + set id [remote_spawn $dest "$command" "readonly"] if { $id < 0 } { set output "remote_spawn failed" - set status -1; + set status -1 } else { - set status [remote_wait $dest 300]; - set output [lindex $status 1]; - set status [lindex $status 0]; + set status [remote_wait $dest 300] + set output [lindex $status 1] + set status [lindex $status 0] } # Unset them so we don't potentially get hosed when we try to run a # non-testcase executable. (Setting LD_LIBRARY_PATH is the wrong @@ -92,10 +92,10 @@ proc unix_load { dest prog args } { } } else { set remotefile "/tmp/[file tail $prog].[pid]" - set remotefile [remote_download $dest $prog $remotefile]; + set remotefile [remote_download $dest $prog $remotefile] if { $remotefile == "" } { verbose -log "Download of $prog to [board_info $dest name] failed." 3 - return [list "unresolved" ""]; + return [list "unresolved" ""] } if [board_info $dest exists remote_link] { if [[board_info $dest remote_link] $remotefile] { @@ -111,11 +111,11 @@ proc unix_load { dest prog args } { if { [lindex $status 0] != 0 } { remote_file $dest delete ${remotefile}.o $remotefile verbose -log "chmod +x of $prog on $dest failed." 3 - return [list "unresolved" ""]; + return [list "unresolved" ""] } } set status [remote_exec $dest "$remotefile" $parg $inp] - remote_file $dest delete $remotefile.o $remotefile; + remote_file $dest delete $remotefile.o $remotefile if { [lindex $status 0] < 0 } { verbose -log "Couldn't execute $prog, [lindex $status 1]" 3 return [list "unresolved" ""] @@ -132,11 +132,11 @@ proc unix_load { dest prog args } { verbose -- "$output" 2 } if { $status == 0 } { - set result "pass"; + set result "pass" } else { - set result "fail"; + set result "fail" } - return [list $result $output]; + return [list $result $output] } -set_board_info protocol "unix"; +set_board_info protocol "unix" diff --git a/config/vr4100.exp b/config/vr4100.exp index 00b96eb..9a9bb0c 100644 --- a/config/vr4100.exp +++ b/config/vr4100.exp @@ -18,4 +18,4 @@ # bug-dejagnu@gnu.org # We're using a ddb monitor. -load_generic_config "ddb"; +load_generic_config "ddb" diff --git a/config/vr4300.exp b/config/vr4300.exp index 00b96eb..9a9bb0c 100644 --- a/config/vr4300.exp +++ b/config/vr4300.exp @@ -18,4 +18,4 @@ # bug-dejagnu@gnu.org # We're using a ddb monitor. -load_generic_config "ddb"; +load_generic_config "ddb" diff --git a/config/vr5000.exp b/config/vr5000.exp index f95d597..b5338e3 100644 --- a/config/vr5000.exp +++ b/config/vr5000.exp @@ -18,4 +18,4 @@ # bug-dejagnu@gnu.org # We're using a ddb monitor, but we want to use the ethernet to load files. -load_generic_config "ddb-ether"; +load_generic_config "ddb-ether" diff --git a/config/vrtx.exp b/config/vrtx.exp index 95288b6..298a8e1 100644 --- a/config/vrtx.exp +++ b/config/vrtx.exp @@ -33,7 +33,7 @@ load_lib remote.exp # proc vrtx_load { dest prog args } { - remote_open $dest; + remote_open $dest switch -- [remote_download $dest $prog] { 0 { return "pass" } diff --git a/config/vxworks.exp b/config/vxworks.exp index 81af297..e47d5d8 100644 --- a/config/vxworks.exp +++ b/config/vxworks.exp @@ -25,90 +25,90 @@ # proc ${board}_init { dest } { # This is not the right way to determine the required OS... - global target_os; - set shell_prompt [board_info $dest shell_prompt]; - set do_reboot 0; + global target_os + set shell_prompt [board_info $dest shell_prompt] + set do_reboot 0 - set desired_kernel [board_info $dest "kernel,$target_os"]; + set desired_kernel [board_info $dest "kernel,$target_os"] if { $desired_kernel == "" } { - vxworks_final_init $dest; + vxworks_final_init $dest # Nothing to see here, nothing to do. Move along. - return; + return } - remote_raw_open $dest raw; - remote_send $dest "\n"; + remote_raw_open $dest raw + remote_send $dest "\n" remote_expect $dest 5 { -re "$shell_prompt" { - set do_reboot 1; + set do_reboot 1 } -re "Press any key to stop auto-boot" { - remote_send $dest "\n"; - exp_continue; + remote_send $dest "\n" + exp_continue } -re "VxWorks Boot" { - set boot_mon 0; - set boot_mon_prompt "VxWorks Boot"; + set boot_mon 0 + set boot_mon_prompt "VxWorks Boot" } -re "\[0-9\]\[\r\n\]+ *\[0-9\]\[\r\n\]" { - remote_send $dest "\n"; - exp_continue; + remote_send $dest "\n" + exp_continue } timeout { - set do_reboot 1; + set do_reboot 1 } } if { $do_reboot } { - remote_close $dest; - remote_reboot $dest; - return; + remote_close $dest + remote_reboot $dest + return } - remote_binary $dest; - remote_send $dest "\n\n"; + remote_binary $dest + remote_send $dest "\n\n" remote_expect $dest 3 { timeout {} -re ".+" { exp_continue; } } - remote_send $dest "p\n"; + remote_send $dest "p\n" remote_expect $dest 20 { -re "file name\[ \t\]+: (\[^ \r\n\]+)\[ \r\n\]+" { - set curr_file $expect_out(1,string); - exp_continue; + set curr_file $expect_out(1,string) + exp_continue } -re "$boot_mon_prompt" { } } if ![info exists curr_file] { - remote_close $dest; - remote_reboot $dest; - return; + remote_close $dest + remote_reboot $dest + return } if { $curr_file != $desired_kernel } { - verbose "$curr_file != '$desired_kernel'"; + verbose "$curr_file != '$desired_kernel'" # Oh boy. - remote_send $dest "c\n"; + remote_send $dest "c\n" remote_expect $dest 20 { -re "file name\[ \t\]+:.*$" { - remote_send $dest "$desired_kernel\n"; - exp_continue; + remote_send $dest "$desired_kernel\n" + exp_continue } -re "\[a-z() \t\]+:.*$" { - remote_send $dest "\n"; - exp_continue; + remote_send $dest "\n" + exp_continue } -re "$boot_mon_prompt" {} } } - remote_send $dest "@\n"; + remote_send $dest "@\n" remote_expect $dest 30 { -re "(^|\[\r\n\])$shell_prompt" {} -re ".+" { - exp_continue; + exp_continue } } - vxworks_final_init $dest; - remote_close $dest; + vxworks_final_init $dest + remote_close $dest } proc vxworks_final_init { dest } { @@ -116,7 +116,7 @@ proc vxworks_final_init { dest } { if { [target_compile [board_info $dest preload_obj] foo.out object [board_info $dest preload_obj_flags]] == "" } { vxworks_ld $dest foo.out } - remote_file build delete foo.out; + remote_file build delete foo.out } } # @@ -124,102 +124,102 @@ proc vxworks_final_init { dest } { # proc vxworks_exec { dest program pargs inp outp } { - global decimal hex; + global decimal hex - set shell_id [vxworks_open $dest]; + set shell_id [vxworks_open $dest] if { $shell_id < 0 } { - return [list -1 "open failure"]; + return [list -1 "open failure"] } if { $inp != "" } { - set inp [remote_download $dest $inp]; - set suffix " < $inp"; + set inp [remote_download $dest $inp] + set suffix " < $inp" } else { set suffix "" } - set shell_prompt [board_info $dest shell_prompt]; - remote_send $dest "${program} ${pargs}$suffix\n"; + set shell_prompt [board_info $dest shell_prompt] + remote_send $dest "${program} ${pargs}$suffix\n" # FIXME: The value 300 below should probably be a parameter passed in. remote_expect $dest 300 { -re "\\\[VxWorks Boot\\\]:" { - remote_send $dest "@\n"; - sleep 20; - exp_continue; + remote_send $dest "@\n" + sleep 20 + exp_continue } -re "(.*)value = (-*$decimal) = $hex\[^\r\n\]*\[\r\n\]+$shell_prompt" { - set result [list $expect_out(2,string) $expect_out(1,string)]; + set result [list $expect_out(2,string) $expect_out(1,string)] } -re "undefined symbol: .*$shell_prompt" { - set result [list 1 "unknown command"]; + set result [list 1 "unknown command"] } -re "syntax error.*$shell_prompt" { - set result [list -1 "syntax error in command"]; + set result [list -1 "syntax error in command"] } default { - set result [list -1 "unable to execute command"]; + set result [list -1 "unable to execute command"] } } if { $suffix != "" } { - remote_file $dest delete $inp; + remote_file $dest delete $inp } - return $result; + return $result } proc vxworks_download { dest localfile remotefile } { if [board_info $dest exists vxworks_homedir] { - set rfile "[board_info $dest vxworks_homedir]/$remotefile"; - remote_download build $localfile $rfile; - return $rfile; + set rfile "[board_info $dest vxworks_homedir]/$remotefile" + remote_download build $localfile $rfile + return $rfile } - return [remote_raw_download $dest $localfile $remotefile]; + return [remote_raw_download $dest $localfile $remotefile] } proc vxworks_file { dest op args } { - set file [lindex $args 0]; + set file [lindex $args 0] if [board_info $dest exists vxworks_homedir] { - set dir "[board_info $dest vxworks_homedir]"; + set dir "[board_info $dest vxworks_homedir]" switch $op { exists { - set file "${dir}/[file tail $file]"; - return [file exists $file]; + set file "${dir}/[file tail $file]" + return [file exists $file] } delete { foreach x $args { - set x "${dir}/[file tail $x]"; + set x "${dir}/[file tail $x]" if { [file exists $x] && [file isfile $x] } { - exec rm -f $x; + exec rm -f $x } } - return; + return } } } - return [eval remote_raw_file \"$dest\" \"$op\" $args]; + return [eval remote_raw_file \"$dest\" \"$op\" $args] } proc vxworks_send { dest string } { # Convert LFs to CRs, 'cause that is what VxWorks wants to see. - regsub -all "\n" $string "\r" string; + regsub -all "\n" $string "\r" string verbose "Sending '$string' to $dest" 2 - return [remote_raw_send $dest "$string"]; + return [remote_raw_send $dest "$string"] } proc vxworks_open { dest args } { if [board_info $dest exists fileid] { - return [board_info $dest fileid]; + return [board_info $dest fileid] } set shell_prompt [board_info $dest shell_prompt] - set shell_id [remote_raw_open $dest]; + set shell_id [remote_raw_open $dest] if { $shell_id == "" || $shell_id < 0 } { - return -1; + return -1 } if [board_info $dest exists logname] { - set logname [board_info $dest logname]; + set logname [board_info $dest logname] if [board_info $dest exists password] { remote_send $dest "iam \"$logname\",\"[board_info $dest passwd]\"\r" } else { @@ -235,26 +235,26 @@ proc vxworks_open { dest args } { # or `warning' should be used here. There are *lots* of other # cases like this. perror "Couldn't set default user." - return -1; + return -1 } } } - set dir ""; + set dir "" if [board_info $dest exists ftp_directory] { - set dir [board_info $dest ftp_directory]; + set dir [board_info $dest ftp_directory] } if [board_info $dest exists vxworks_homedir] { - set dir [board_info $dest vxworks_homedir]; + set dir [board_info $dest vxworks_homedir] } if { $dir != "" } { - set status [remote_exec $dest "cd" "\"$dir\""]; + set status [remote_exec $dest "cd" "\"$dir\""] if [lindex $status 0] { - perror "Error in cd to $dir--[lindex $status 1]"; - return 1; + perror "Error in cd to $dir--[lindex $status 1]" + return 1 } } - return $shell_id; + return $shell_id } # # Load a file into vxworks @@ -269,31 +269,31 @@ proc vxworks_ld { dest prog } { global board_info if { $prog == "" } { - return 1; + return 1 } - set shell_id [remote_open $dest]; + set shell_id [remote_open $dest] if { $shell_id < 0 } { - return -1; + return -1 } - set prog [remote_download $dest $prog]; + set prog [remote_download $dest $prog] - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] # We always want to exit the program via the code at the end. # If the load fails we want `expect_out' stored in the log and this # saves duplicating that code. for { set x 0 ; } { $x < 3 } {incr x; } { - remote_send $dest "\n"; + remote_send $dest "\n" remote_expect $dest 30 { -re ".*$shell_prompt $" { set x 20; } -re "\\\[VxWorks Boot\\\]:" { - remote_send $dest "@\n"; - sleep 20; - exp_continue; + remote_send $dest "@\n" + sleep 20 + exp_continue } timeout { return -1; } } @@ -305,7 +305,7 @@ proc vxworks_ld { dest prog } { while { $result == -7 && $tries < $maxtries } { verbose "Loading $prog into vxworks." - remote_send $dest "ld < $prog\n"; + remote_send $dest "ld < $prog\n" incr tries remote_expect $dest 300 { -re "USER.*command not understood" { @@ -330,7 +330,7 @@ proc vxworks_ld { dest prog } { } -re "value = (-*${decimal}) = ${hex}.*$shell_prompt $" { verbose "Loaded $prog into vxworks." - set board_info([board_info $dest name],vx_module) $expect_out(1,string); + set board_info([board_info $dest name],vx_module) $expect_out(1,string) set result 0 } -re "(.*)$shell_prompt $" { @@ -347,7 +347,7 @@ proc vxworks_ld { dest prog } { send_log "$expect_out(buffer)" } - remote_file $dest delete $prog; + remote_file $dest delete $prog return $result } @@ -360,25 +360,25 @@ proc vxworks_ld { dest prog } { # -1 - unresolved, may be fixed by rebooting # proc vxworks_run { dest function pargs inp outp } { - global hex decimal; + global hex decimal - set shell_prompt [board_info $dest shell_prompt]; - set output ""; + set shell_prompt [board_info $dest shell_prompt] + set output "" # There isn't a command to wait for a thread to finish, so we have to keep # polling. Instead, we expect the status wrapper to return an exit # status. - set status [remote_exec $dest "sp" "$function $pargs" $inp $outp]; + set status [remote_exec $dest "sp" "$function $pargs" $inp $outp] - set tid [lindex $status 0]; + set tid [lindex $status 0] # Bad task id, reboot and try again. if { $tid == -1 || $tid == 0 } { - return -1; + return -1 } - set result 1; + set result 1 # FIXME: The value 300 below should be a parameter. remote_expect $dest 300 { -re "task ${hex} - aborted.*$shell_prompt $" { @@ -388,51 +388,51 @@ proc vxworks_run { dest function pargs inp outp } { } -re "\[\r\n\]syntax error\[\r\n\]" { verbose "weirdness after task started" - set result -1; + set result -1 } -re "(.*)\\*\\*\\* EXIT code ($decimal)\[\r\n\]" { - set output "$expect_out(1,string)"; - set exit_code "$expect_out(2,string)"; + set output "$expect_out(1,string)" + set exit_code "$expect_out(2,string)" if { ($exit_code + 0) != 0 } { - set result 1; + set result 1 } else { - set result 0; + set result 0 } } -re "Operation Fault.*fault type:" { - set result 1; + set result 1 } -re "Bus Error" { # This is here to try to cope with apparently flaky h/w. # This is potentially an error in the testcase, but we don't # really know, do we? warning "Bus Error." - set result 1; - set output "Bus Error"; - remote_reboot $dest; + set result 1 + set output "Bus Error" + remote_reboot $dest } timeout { # Infinite loop? probably. - remote_exec $dest "td" "$tid"; - set result 1; + remote_exec $dest "td" "$tid" + set result 1 } } - return [list $result $output]; + return [list $result $output] } # # Unload the last executable that we loaded, so we can free up its memory. # proc vxworks_unld { dest } { - global board_info; + global board_info 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]"; + remote_exec $dest "unld" "[board_info $dest vx_module]" } - unset board_info([board_info $dest name],vx_module); + unset board_info([board_info $dest name],vx_module) } } @@ -441,55 +441,55 @@ proc vxworks_unld { dest } { # "work" or we give up. # proc vxworks_load {dest prog args} { - set result ""; - set output ""; + set result "" + set output "" if { [llength $args] > 0 } { - set pargs "[lindex $args 0]"; + set pargs "[lindex $args 0]" } else { set pargs "" } if { [llength $args] > 1 } { - set inp "[lindex $args 1]"; + set inp "[lindex $args 1]" } else { set inp "" } if { [llength $args] > 2 } { - set outp "[lindex $args 2]"; + set outp "[lindex $args 2]" } else { set outp "" } for { set x 0; } { $x < 3 } { incr x } { - set status [vxworks_ld $dest $prog]; + set status [vxworks_ld $dest $prog] if { $status >= 0 } { if { $status > 0 } { - set result "fail"; + set result "fail" } else { - set out [vxworks_run $dest __wrap_main $pargs $inp $outp]; - set status [lindex $out 0]; - set output [lindex $out 1]; + set out [vxworks_run $dest __wrap_main $pargs $inp $outp] + set status [lindex $out 0] + set output [lindex $out 1] # Get rid of the carriage returns, because they confuse # callers that try to parse the result. regsub -all "\r" $output "" output if { $status != 0 } { if { $status > 0 } { - set result "fail"; + set result "fail" } } else { - set result "pass"; + set result "pass" } } } if { $result != "" } { - vxworks_unld $dest; - return [list $result $output]; + vxworks_unld $dest + return [list $result $output] } - remote_reboot $dest; + remote_reboot $dest } - return [list "fail" ""]; + return [list "fail" ""] } set_board_info protocol "vxworks" @@ -507,5 +507,5 @@ set_board_info wrap_compile_flags "-DNO_UNISTD_H" set_board_info gdb_prompt "\[(\]vxgdb\[)\]" -set_board_info is_vxworks 1; -set_board_info gdb,nosignals 1; +set_board_info is_vxworks 1 +set_board_info gdb,nosignals 1 diff --git a/lib/debugger.exp b/lib/debugger.exp index b9fc27f..6e41552 100644 --- a/lib/debugger.exp +++ b/lib/debugger.exp @@ -193,7 +193,7 @@ proc print { var } { } proc quit { } { - log_and_exit; + log_and_exit } proc bt { } { diff --git a/lib/dejagnu.exp b/lib/dejagnu.exp index 680716e..5cf6f20 100755 --- a/lib/dejagnu.exp +++ b/lib/dejagnu.exp @@ -76,21 +76,21 @@ proc host_compile {compline} { # execute the compiler verbose "Compiling for the host using: $CC $INCLUDES $LIBS $compline" 2 - set status [catch "exec $CC $INCLUDES $LIBS $compline" comp_output]; + set status [catch "exec $CC $INCLUDES $LIBS $compline" comp_output] verbose "Compiler returned $comp_output" 2 # prune common warnings and other stuff we can safely ignore - set comp_output [prune_warnings $comp_output]; + set comp_output [prune_warnings $comp_output] # Trim multiple CR/LF pairs out to keep things consistant - regsub "^\[\r\n\]+" $comp_output "" comp_output; + regsub "^\[\r\n\]+" $comp_output "" comp_output # if we got a compiler error, log it if { [lindex $status 0] != 0 } { - verbose -log "compiler exited with status [lindex $status 0]"; + verbose -log "compiler exited with status [lindex $status 0]" } if { [lindex $status 1] != "" } { - verbose -log "output is:\n[lindex $status 1]" 2; + verbose -log "output is:\n[lindex $status 1]" 2 } # return the filtered output diff --git a/lib/dg.exp b/lib/dg.exp index 3bcc514..7d9bea5 100644 --- a/lib/dg.exp +++ b/lib/dg.exp @@ -719,10 +719,10 @@ proc dg-test { args } { # No intention is made (at this point) to preserve upward compatibility # (though at some point we'll have to). - set results [${tool}-dg-test $prog [lindex ${dg-do-what} 0] "$tool_flags ${dg-extra-tool-flags}"]; + set results [${tool}-dg-test $prog [lindex ${dg-do-what} 0] "$tool_flags ${dg-extra-tool-flags}"] - set comp_output [lindex $results 0]; - set output_file [lindex $results 1]; + set comp_output [lindex $results 0] + set output_file [lindex $results 1] #send_user "\nold_dejagnu.exp: comp_output1 = :$comp_output:\n\n" #send_user "\nold_dejagnu.exp: message = :$message:\n\n" @@ -836,8 +836,8 @@ proc dg-test { args } { } else { set status -1 set result [${tool}_load $output_file] - set status [lindex $result 0]; - set output [lindex $result 1]; + set status [lindex $result 0] + set output [lindex $result 1] #send_user "After exec, status: $status\n" if { [lindex ${dg-do-what} 2] == "F" } { setup_xfail "*-*-*" diff --git a/lib/framework.exp b/lib/framework.exp index e4fe609..ced1283 100644 --- a/lib/framework.exp +++ b/lib/framework.exp @@ -135,35 +135,35 @@ proc isbuild { pattern } { # Is $board remote? Return a non-zero value if so. # proc is_remote { board } { - global host_board; - global target_list; + global host_board + global target_list - verbose "calling is_remote $board" 3; + verbose "calling is_remote $board" 3 # Remove any target variant specifications from the name. - set board [lindex [split $board "/"] 0]; + set board [lindex [split $board "/"] 0] # Map the host or build back into their short form. if { [board_info build name] == $board } { - set board "build"; + set board "build" } elseif { [board_info host name] == $board } { - set board "host"; + set board "host" } # We're on the "build". The check for the empty string is just for # paranoia's sake--we shouldn't ever get one. "unix" is a magic # string that should really go away someday. if { $board == "build" || $board == "unix" || $board == "" } { - verbose "board is $board, not remote" 3; - return 0; + verbose "board is $board, not remote" 3 + return 0 } if { $board == "host" } { if { [info exists host_board] && $host_board != "" } { - verbose "board is $board, is remote" 3; - return 1; + verbose "board is $board, is remote" 3 + return 1 } else { - verbose "board is $board, host is local" 3; - return 0; + verbose "board is $board, host is local" 3 + return 0 } } @@ -173,16 +173,16 @@ proc is_remote { board } { if [info exists current_target_name] { # This shouldn't happen, but we'll be paranoid anyway. if { $current_target_name != "target" } { - return [is_remote $current_target_name]; + return [is_remote $current_target_name] } } - return 0; + return 0 } if [board_info $board exists isremote] { - verbose "board is $board, isremote is [board_info $board isremote]" 3; - return [board_info $board isremote]; + verbose "board is $board, isremote is [board_info $board isremote]" 3 + return [board_info $board isremote] } - return 1; + return 1 } # # If this is a canadian (3 way) cross. This means the tools are @@ -285,8 +285,8 @@ proc unknown { args } { send_error "The info on the error is:\n$errorInfo\n" } - set exit_status 1; - log_and_exit; + set exit_status 1 + log_and_exit } # @@ -307,7 +307,7 @@ proc clone_output { message } { puts $sum_file "$message" } - regsub "^\[ \t\]*(\[^ \t\]+).*$" "$message" "\\1" firstword; + regsub "^\[ \t\]*(\[^ \t\]+).*$" "$message" "\\1" firstword case "$firstword" in { {"PASS:" "XFAIL:" "KFAIL:" "UNRESOLVED:" "UNSUPPORTED:" "UNTESTED:"} { if $all_flag { @@ -332,20 +332,20 @@ proc clone_output { message } { # Reset a few counters. # proc reset_vars {} { - global test_names test_counts; - global warncnt errcnt; + global test_names test_counts + global warncnt errcnt # other miscellaneous variables global prms_id global bug_id # reset them all - set prms_id 0; - set bug_id 0; - set warncnt 0; - set errcnt 0; + set prms_id 0 + set bug_id 0 + set warncnt 0 + set errcnt 0 foreach x $test_names { - set test_counts($x,count) 0; + set test_counts($x,count) 0 } # Variables local to this file. @@ -355,10 +355,10 @@ proc reset_vars {} { } proc log_and_exit {} { - global exit_status; - global tool mail_logs outdir mailing_list; + global exit_status + global tool mail_logs outdir mailing_list - log_summary total; + log_summary total # extract version number if {[info procs ${tool}_version] != ""} { if {[catch "${tool}_version" output]} { @@ -396,13 +396,13 @@ proc log_summary { args } { global outdir global mailing_list global current_target_name - global test_counts; - global testcnt; + global test_counts + global testcnt if { [llength $args] == 0 } { - set which "count"; + set which "count" } else { - set which [lindex $args 0]; + set which [lindex $args 0] } if { [llength $args] == 0 } { @@ -417,12 +417,12 @@ proc log_summary { args } { # so it's not clear how often this will be used. if [info exists testcnt] { if { $testcnt > 0 } { - set totlcnt 0; + set totlcnt 0 # total all the testcases reported foreach x { FAIL PASS XFAIL KFAIL XPASS KPASS UNTESTED UNRESOLVED UNSUPPORTED } { - incr totlcnt test_counts($x,$which); + incr totlcnt test_counts($x,$which) } - set testcnt test_counts(total,$which); + set testcnt test_counts(total,$which) if { $testcnt>$totlcnt || $testcnt<$totlcnt } { if { $testcnt > $totlcnt } { @@ -444,9 +444,9 @@ proc log_summary { args } { } } foreach x { PASS FAIL XPASS XFAIL KPASS KFAIL UNRESOLVED UNTESTED UNSUPPORTED } { - set val $test_counts($x,$which); + set val $test_counts($x,$which) if { $val > 0 } { - set mess "# of $test_counts($x,name)"; + set mess "# of $test_counts($x,name)" if { $xml } { xml_output " " xml_output " $x" @@ -455,9 +455,9 @@ proc log_summary { args } { xml_output " " } if { [string length $mess] < 24 } { - append mess "\t"; + append mess "\t" } - clone_output "$mess\t$val"; + clone_output "$mess\t$val" } } } @@ -698,12 +698,12 @@ proc record_test { type message args } { global pf_prefix if { [llength $args] > 0 } { - set count [lindex $args 0]; + set count [lindex $args 0] } else { - set count 1; + set count 1 } if [info exists pf_prefix] { - set message [concat $pf_prefix " " $message]; + set message [concat $pf_prefix " " $message] } # If we have too many warnings or errors, @@ -715,7 +715,7 @@ proc record_test { type message args } { set type UNRESOLVED } - incr_count $type; + incr_count $type if { $xml } { global errorInfo @@ -1033,7 +1033,7 @@ proc unsupported { message } { # Set up the values in the test_counts array (name and initial totals). # proc init_testcounts { } { - global test_counts test_names; + global test_counts test_names set test_counts(TOTAL,name) "testcases run" set test_counts(PASS,name) "expected passes" set test_counts(FAIL,name) "unexpected failures" @@ -1046,16 +1046,16 @@ proc init_testcounts { } { set test_counts(UNSUPPORTED,name) "unsupported tests" set test_counts(UNRESOLVED,name) "unresolved testcases" set test_counts(UNTESTED,name) "untested testcases" - set j ""; + set j "" foreach i [lsort [array names test_counts]] { - regsub ",.*$" "$i" "" i; + regsub ",.*$" "$i" "" i if { $i == $j } { - continue; + continue } - set test_counts($i,total) 0; - lappend test_names $i; - set j $i; + set test_counts($i,total) 0 + lappend test_names $i + set j $i } } @@ -1064,16 +1064,16 @@ proc init_testcounts { } { # is optional (defaults to 1). # proc incr_count { name args } { - global test_counts; + global test_counts if { [llength $args] == 0 } { - set count 1; + set count 1 } else { - set count [lindex $args 0]; + set count [lindex $args 0] } if [info exists test_counts($name,count)] { - incr test_counts($name,count) $count; - incr test_counts($name,total) $count; + incr test_counts($name,count) $count + incr test_counts($name,total) $count } else { perror "$name doesn't exist in incr_count" } diff --git a/lib/ftp.exp b/lib/ftp.exp index c9f5629..9259a67 100644 --- a/lib/ftp.exp +++ b/lib/ftp.exp @@ -29,57 +29,57 @@ proc ftp_open { host } { global board_info if [board_info $host exists name] { - set host [board_info $host name]; + set host [board_info $host name] } if [board_info $host exists ftp_fileid] { - return [board_info $host ftp_fileid]; + return [board_info $host ftp_fileid] } if [board_info $host exists hostname] { - set remotehost [board_info $host hostname]; + set remotehost [board_info $host hostname] } else { - set remotehost $host; + set remotehost $host } # LoseQVT tends to get stuck sometimes; we'll loop around a few million # times when it gets a "connection refused". - set spawn_id -1; - set count 3; + set spawn_id -1 + set count 3 while { $spawn_id < 0 && $count >= 0 } { - spawn ftp -n $remotehost; + spawn ftp -n $remotehost expect { -i $spawn_id -re ".*220.*$prompt" { } -i $spawn_id -re ".*Connection refused.*$prompt" { - sleep 2; - send "open $remotehost\n"; + sleep 2 + send "open $remotehost\n" exp_continue } -i $spawn_id default { - close -i $spawn_id; - wait -i $spawn_id; - set spawn_id -1; + close -i $spawn_id + wait -i $spawn_id + set spawn_id -1 } } - incr count -1; + incr count -1 } if { $spawn_id < 0 } { - return -1; + return -1 } - set board_info($host,ftp_fileid) $spawn_id; + set board_info($host,ftp_fileid) $spawn_id if [board_info $host exists ftp_username] { if [board_info $host exists ftp_password] { - set command "user [board_info $host ftp_username] [board_info $host ftp_password]\n"; + set command "user [board_info $host ftp_username] [board_info $host ftp_password]\n" } else { - set command "user [board_info $host ftp_username]\n"; + set command "user [board_info $host ftp_username]\n" } send "$command" expect { -i $spawn_id -re ".*230.*$prompt" { } -i $spawn_id default { - close -i $spawn_id; - wait -i $spawn_id; - return -1; + close -i $spawn_id + wait -i $spawn_id + return -1 } } } @@ -88,37 +88,37 @@ proc ftp_open { host } { expect { -i $spawn_id -re "200.*$prompt" { } -i $spawn_id timeout { - close -i $spawn_id; - wait -i $spawn_id; + close -i $spawn_id + wait -i $spawn_id return -1 } } if [board_info $host exists ftp_directory] { - send "cd [board_info $host ftp_directory]\n"; + send "cd [board_info $host ftp_directory]\n" expect { -i $spawn_id -re "250.*$prompt" { } -i $spawn_id default { - close -i $spawn_id; - wait -i $spawn_id; - return -1; + close -i $spawn_id + wait -i $spawn_id + return -1 } } } if [board_info $host exists ftp_no_passive] { - send "passive\n"; + send "passive\n" expect { -i $spawn_id -re "Passive mode off.*$prompt" { } -i $spawn_id -re "Passive mode on.*$prompt" { - send "passive\n"; - exp_continue; + send "passive\n" + exp_continue } -i $spawn_id -re ".*$prompt" { } } } - set board_info($host,ftp_fileid) $spawn_id; - return $spawn_id; + set board_info($host,ftp_fileid) $spawn_id + return $spawn_id } # @@ -129,39 +129,39 @@ proc ftp_upload { host remotefile localfile } { verbose "ftping $remotefile from $host to $localfile" set timeout 15 - set spawn_id [ftp_open $host]; + set spawn_id [ftp_open $host] if { $spawn_id < 0 } { - return ""; + return "" } - set loop 1; + set loop 1 while { $loop } { - send -i $spawn_id "get $remotefile $localfile\n"; + send -i $spawn_id "get $remotefile $localfile\n" expect { -i $spawn_id -re ".*Too many open files.*$prompt" { - ftp_close $host; + ftp_close $host } -i $spawn_id -re ".*No such file or directory.*$prompt" { - set loop 0; - set remotefile ""; + set loop 0 + set remotefile "" } -i $spawn_id -re "(^|\[\r\n\])226.*$prompt" { set loop 0; } -i $spawn_id -re "(^|\[\r\n\])\[0-9\]\[0-9\]\[0-9\].*$prompt" { - set loop 0; - set remotefile ""; + set loop 0 + set remotefile "" } -i $spawn_id default { - ftp_close $host; + ftp_close $host } } if { $loop } { - set spawn_id [ftp_open $host]; + set spawn_id [ftp_open $host] if { $spawn_id < 0 } { - return ""; + return "" } } } - return $localfile; + return $localfile } # @@ -173,53 +173,53 @@ proc ftp_download { host localfile remotefile } { verbose "putting $localfile $remotefile" if [board_info $host exists hostname] { - set remotehost [board_info $host hostname]; + set remotehost [board_info $host hostname] } else { - set remotehost $host; + set remotehost $host } - set spawn_id [ftp_open $host]; + set spawn_id [ftp_open $host] if { $spawn_id < 0 } { - return ""; + return "" } - set loop 1; + set loop 1 while { $loop } { send -i $spawn_id "put $localfile $remotefile\n" expect { -i $spawn_id -re ".*Too many open files.*$prompt" { - ftp_close $host; + ftp_close $host } -i $spawn_id -re ".*No such file or directory.*$prompt" { - set loop 0; - set remotefile ""; + set loop 0 + set remotefile "" } -re "(^|\[\r\n\])150.*connection for (.*) \[(\]\[0-9.,\]+\\)\[\r\n\]" { - set remotefile $expect_out(2,string); - exp_continue; + set remotefile $expect_out(2,string) + exp_continue } -i $spawn_id -re "(^|\[\r\n\])226.*$prompt" { - set loop 0; + set loop 0 } -i $spawn_id -re "Timeout.*$prompt" { - ftp_close $host; + ftp_close $host } -i $spawn_id -re "(^|\[\r\n\])\[0-9\]\[0-9\]\[0-9\].*$prompt" { - set loop 0; - set remotefile ""; + set loop 0 + set remotefile "" } -i $spawn_id default { - ftp_close $host; + ftp_close $host } } if { $loop } { - set spawn_id [ftp_open $host]; + set spawn_id [ftp_open $host] if { $spawn_id < 0 } { - return ""; + return "" } } } - return $remotefile; + return $remotefile } # @@ -229,18 +229,18 @@ proc ftp_close { host } { global board_info if [board_info $host exists name] { - set host [board_info $host name]; + set host [board_info $host name] } if ![board_info $host exists ftp_fileid] { - return ""; + return "" } - set spawn_id [board_info $host ftp_fileid]; - unset board_info($host,ftp_fileid); + set spawn_id [board_info $host ftp_fileid] + unset board_info($host,ftp_fileid) send -i $spawn_id "quit\n" close -i $spawn_id - wait -i $spawn_id; - return ""; + wait -i $spawn_id + return "" } diff --git a/lib/kermit.exp b/lib/kermit.exp index cd4e9d9..0d46bb8 100644 --- a/lib/kermit.exp +++ b/lib/kermit.exp @@ -29,17 +29,17 @@ proc kermit_open { dest args } { global board_info if [board_info $dest exists name] { - set dest [board_info $dest name]; + set dest [board_info $dest name] } if [board_info ${dest} exists serial] { - set port [board_info ${dest} serial]; + set port [board_info ${dest} serial] set device "-l [board_info ${dest} serial]" if [board_info ${dest} exists baud] { append device " -b [board_info ${dest} baud]" } } else { - set port [board_info ${dest} netport]; - set device "-j [board_info ${dest} netport]"; + set port [board_info ${dest} netport] + set device "-j [board_info ${dest} netport]" } set tries 0 @@ -91,7 +91,7 @@ proc kermit_open { dest args } { if { $result < 0 } { perror "Couldn't connect after $tries tries." if [info exists board_info($dest,fileid)] { - unset board_info($dest,fileid); + unset board_info($dest,fileid) } return -1 } else { @@ -110,43 +110,43 @@ proc kermit_open { dest args } { # proc kermit_command { dest args } { if [board_info $dest exists name] { - set dest [board_info $dest name]; + set dest [board_info $dest name] } - set shell_id [board_info $dest fileid]; + set shell_id [board_info $dest fileid] # Sometimes we have to send multiple ^\c sequences. Don't know # why. - set timeout 2; + set timeout 2 for { set i 1; } {$i<=5} {incr i} { - send -i $shell_id "c"; + send -i $shell_id "c" expect { -i $shell_id -re ".*Back at.*ermit.*>.*$" { set i 10;} -i $shell_id timeout { if { $i > 2 } { - warning "Unable to get prompt from kermit."; + warning "Unable to get prompt from kermit." } } } } foreach command $args { set timeout 120 - send -i $shell_id "${command}\r"; + send -i $shell_id "${command}\r" expect { -i $shell_id -re ".*ermit.*>.*$" { } -i $shell_id timeout { - perror "Response failed from kermit."; - return -1; + perror "Response failed from kermit." + return -1 } } } - send -i $shell_id "c\r"; + send -i $shell_id "c\r" expect { -i $shell_id -re ".*other options.\[\r\n\]+" { } -i $shell_id timeout { - perror "Unable to resume kermit connection."; - return -1; + perror "Unable to resume kermit connection." + return -1 } } - return 0; + return 0 } @@ -155,14 +155,14 @@ proc kermit_command { dest args } { # proc kermit_send { dest string args } { if [board_info $dest exists transmit_pause] { - set f [open "/tmp/fff" "w"]; - puts -nonewline $f "$string"; - close $f; - set result [remote_transmit $dest /tmp/fff]; - remote_file build delete "/tmp/fff"; - return "$result"; + set f [open "/tmp/fff" "w"] + puts -nonewline $f "$string" + close $f + set result [remote_transmit $dest /tmp/fff] + remote_file build delete "/tmp/fff" + return "$result" } else { - return [standard_send $dest $string]; + return [standard_send $dest $string] } } @@ -172,9 +172,9 @@ proc kermit_send { dest string args } { # proc kermit_transmit { dest file args } { if [board_info $dest exists transmit_pause] { - kermit_command $dest "transmit $file"; - return ""; + kermit_command $dest "transmit $file" + return "" } else { - return [standard_transmit $dest $file]; + return [standard_transmit $dest $file] } } diff --git a/lib/libgloss.exp b/lib/libgloss.exp index ebb9ed4..b075638 100644 --- a/lib/libgloss.exp +++ b/lib/libgloss.exp @@ -120,7 +120,7 @@ proc newlib_link_flags { args } { return "" } - set ld_script_path [lookfor_file ${tool_root_dir} "ld/ldscripts"]; + set ld_script_path [lookfor_file ${tool_root_dir} "ld/ldscripts"] if { $ld_script_path != "" } { set result "-L[file dirname $ld_script_path]" } else { @@ -176,21 +176,21 @@ proc libio_include_flags { args } { set gccpath "[get_multilibs]" if { $gccpath == "" } { - set gccpath "$tool_root_dir"; + set gccpath "$tool_root_dir" } - set libio_bin_dir [lookfor_file ${gccpath} libio/_G_config.h]; + set libio_bin_dir [lookfor_file ${gccpath} libio/_G_config.h] # linux doesn't build _G_config.h and the test above fails, so # we search for iostream.list too. if { $libio_bin_dir == "" } { - set libio_bin_dir [lookfor_file ${gccpath} libio/iostream.list]; + set libio_bin_dir [lookfor_file ${gccpath} libio/iostream.list] } set libio_src_dir [lookfor_file ${srcdir} libio/Makefile.in] if { $libio_bin_dir != "" && $libio_src_dir != "" } { set libio_src_dir [file dirname ${libio_src_dir}] - set libio_bin_dir [file dirname ${libio_bin_dir}]; + set libio_bin_dir [file dirname ${libio_bin_dir}] return " -isystem ${libio_src_dir} -isystem ${libio_bin_dir}" } else { return "" @@ -252,7 +252,7 @@ proc g++_link_flags { args } { global srcdir global ld_library_path - set gccpath [get_multilibs]; + set gccpath [get_multilibs] set libio_dir "" set flags "" set ld_library_path "." @@ -280,25 +280,25 @@ proc g++_link_flags { args } { append flags "-L${gccpath}/librx " } } else { - global tool_root_dir; + global tool_root_dir - set libgpp [lookfor_file ${tool_root_dir} libg++]; + set libgpp [lookfor_file ${tool_root_dir} libg++] if { $libgpp != "" } { - append flags "-L${libgpp} "; + append flags "-L${libgpp} " append ld_library_path ":${libgpp}" } - set libstdcpp [lookfor_file ${tool_root_dir} libstdc++]; + set libstdcpp [lookfor_file ${tool_root_dir} libstdc++] if { $libstdcpp != "" } { - append flags "-L${libstdcpp} "; + append flags "-L${libstdcpp} " append ld_library_path ":${libstdcpp}" } - set libiberty [lookfor_file ${tool_root_dir} libiberty]; + set libiberty [lookfor_file ${tool_root_dir} libiberty] if { $libiberty != "" } { - append flags "-L${libiberty} "; + append flags "-L${libiberty} " } - set librx [lookfor_file ${tool_root_dir} librx]; + set librx [lookfor_file ${tool_root_dir} librx] if { $librx != "" } { - append flags "-L${librx} "; + append flags "-L${librx} " } } return "$flags" @@ -341,7 +341,7 @@ proc libstdc++_link_flags { args } { global srcdir global ld_library_path - set gccpath [get_multilibs]; + set gccpath [get_multilibs] set libio_dir "" set flags "" @@ -357,20 +357,20 @@ proc libstdc++_link_flags { args } { append flags "-L${gccpath}/librx " } } else { - global tool_root_dir; + global tool_root_dir - set libstdcpp [lookfor_file ${tool_root_dir} libstdc++]; + set libstdcpp [lookfor_file ${tool_root_dir} libstdc++] if { $libstdcpp != "" } { - append flags "-L${libstdcpp} "; + append flags "-L${libstdcpp} " append ld_library_path ":${libstdcpp}" } - set libiberty [lookfor_file ${tool_root_dir} libiberty]; + set libiberty [lookfor_file ${tool_root_dir} libiberty] if { $libiberty != "" } { - append flags "-L${libiberty} "; + append flags "-L${libiberty} " } - set librx [lookfor_file ${tool_root_dir} librx]; + set librx [lookfor_file ${tool_root_dir} librx] if { $librx != "" } { - append flags "-L${librx} "; + append flags "-L${librx} " } } return "$flags" @@ -394,34 +394,34 @@ proc get_multilibs { args } { } if [info exists board] { - set target_board $board; + set target_board $board } else { - set target_board [target_info name]; + set target_board [target_info name] } if { [llength $args] == 0 } { if [board_info $target_board exists multitop] { - return "[board_info $target_board multitop]"; + return "[board_info $target_board multitop]" } set board_info($target_board,multitop) "" } if { [board_info $target_board exists compiler] } { - set compiler [board_info $target_board compiler]; + set compiler [board_info $target_board compiler] } else { - set compiler [find_gcc]; + set compiler [find_gcc] } if { $compiler == "" } { - return ""; + return "" } foreach x "$compiler" { if [regexp "^-B" "$x"] { - regsub "^-B" "$x" "" comp_base_dir; - set comp_base_dir [file dirname $comp_base_dir]; - break; + regsub "^-B" "$x" "" comp_base_dir + set comp_base_dir [file dirname $comp_base_dir] + break } } @@ -430,21 +430,21 @@ proc get_multilibs { args } { verbose "compiler is $compiler" if { [which $compiler] == 0 } { - return ""; + return "" } if { [llength $args] > 0 } { - set mopts [lindex $args 0]; + set mopts [lindex $args 0] } else { if { [board_info $target_board exists multilib_flags] } { - set mopts [board_info $target_board multilib_flags]; + set mopts [board_info $target_board multilib_flags] } else { set mopts "" } } set default_multilib [exec $compiler --print-multi-lib] - set default_multilib [lindex $default_multilib 0]; + set default_multilib [lindex $default_multilib 0] set extra [string trimleft $default_multilib ".;@@"] # extract the options and their directory names as know by gcc @@ -485,7 +485,7 @@ proc get_multilibs { args } { } if ![info exists comp_base_dir] { - set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname [exec $compiler --print-prog-name=cc1]]]]]]; + set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname [exec $compiler --print-prog-name=cc1]]]]]] } # search for the top level multilib directory @@ -495,21 +495,21 @@ proc get_multilibs { args } { if { $multitop == "" } { set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]" if { $multitop != "" } { - set multitop [file dirname [file dirname $multitop]]; + set multitop [file dirname [file dirname $multitop]] } else { return "" } } } - set gccpath [eval exec "$compiler" --print-multi-directory $mopts]; - set gccpath [lindex $gccpath 0]; + set gccpath [eval exec "$compiler" --print-multi-directory $mopts] + set gccpath [lindex $gccpath 0] if { $gccpath != "" } { - verbose "GCC path is $gccpath"; + verbose "GCC path is $gccpath" if { [llength $args] == 0 } { set board_info($target_board,multitop) "$multitop/$gccpath" } - return "$multitop/$gccpath"; + return "$multitop/$gccpath" } # extract the MULTILIB_MATCHES from dumpspecs @@ -553,10 +553,10 @@ proc get_multilibs { args } { # compare the lists of gcc options with the list of support multilibs verbose "Supported multilibs are: $multilibs" 3 - set best 0; + set best 0 foreach i "$multilibs" { set hits 0 - set opts [lindex $i 1]; + set opts [lindex $i 1] if { [llength $opts] <= [llength $moptions] } { foreach j "$moptions" { # see if all the -m options match any of the multilibs @@ -569,12 +569,12 @@ proc get_multilibs { args } { if { $hits > $best } { verbose "[lindex $i 0] is better, using as gcc path" 2 set gccpath "[lindex $i 0]" - set best $hits; + set best $hits } } } if ![info exists multitop] { - return ""; + return "" } verbose "gccpath is $gccpath" 3 @@ -595,105 +595,105 @@ proc get_multilibs { args } { } proc find_binutils_prog { name } { - global tool_root_dir; + global tool_root_dir if ![is_remote host] { - set file [lookfor_file $tool_root_dir $name]; + set file [lookfor_file $tool_root_dir $name] if { $file == "" } { - set file [lookfor_file $tool_root_dir ${name}-new]; + set file [lookfor_file $tool_root_dir ${name}-new] } if { $file == "" } { - set file [lookfor_file $tool_root_dir binutils/$name]; + set file [lookfor_file $tool_root_dir binutils/$name] } if { $file == "" } { - set file [lookfor_file $tool_root_dir binutils/${name}-new]; + set file [lookfor_file $tool_root_dir binutils/${name}-new] } if { $file != "" } { - set NAME "$file"; + set NAME "$file" } else { - set NAME [transform $name]; + set NAME [transform $name] } } else { set NAME [transform $name] } - return $NAME; + return $NAME } proc find_gcc {} { global tool_root_dir if ![is_remote host] { - set file [lookfor_file $tool_root_dir xgcc]; + set file [lookfor_file $tool_root_dir xgcc] if { $file == "" } { - set file [lookfor_file $tool_root_dir gcc/xgcc]; + set file [lookfor_file $tool_root_dir gcc/xgcc] } if { $file != "" } { - set CC "$file -B[file dirname $file]/"; + set CC "$file -B[file dirname $file]/" } else { - set CC [transform gcc]; + set CC [transform gcc] } } else { set CC [transform gcc] } - return $CC; + return $CC } proc find_gcj {} { global tool_root_dir if ![is_remote host] { - set file [lookfor_file $tool_root_dir gcj]; + set file [lookfor_file $tool_root_dir gcj] if { $file == "" } { - set file [lookfor_file $tool_root_dir gcc/gcj]; + set file [lookfor_file $tool_root_dir gcc/gcj] } if { $file != "" } { - set CC "$file -B[file dirname $file]/"; + set CC "$file -B[file dirname $file]/" } else { - set CC [transform gcj]; + set CC [transform gcj] } } else { set CC [transform gcj] } - return $CC; + return $CC } proc find_g++ {} { global tool_root_dir if ![is_remote host] { - set file [lookfor_file $tool_root_dir g++]; + set file [lookfor_file $tool_root_dir g++] if { $file == "" } { - set file [lookfor_file $tool_root_dir gcc/g++]; + set file [lookfor_file $tool_root_dir gcc/g++] } if { $file != "" } { - set CC "$file -B[file dirname $file]/"; + set CC "$file -B[file dirname $file]/" } else { - set CC [transform g++]; + set CC [transform g++] } } else { set CC [transform g++] } - return $CC; + return $CC } proc find_g77 {} { global tool_root_dir if ![is_remote host] { - set file [lookfor_file $tool_root_dir g77]; + set file [lookfor_file $tool_root_dir g77] if { $file == "" } { - set file [lookfor_file $tool_root_dir gcc/g77]; + set file [lookfor_file $tool_root_dir gcc/g77] } if { $file != "" } { - set CC "$file -B[file dirname $file]/"; + set CC "$file -B[file dirname $file]/" } else { - set CC [transform g77]; + set CC [transform g77] } } else { set CC [transform g77] } - return $CC; + return $CC } proc find_nm {} { @@ -707,77 +707,77 @@ proc find_nm {} { } } if { $NM == ""} { - set NM [transform nm]; + set NM [transform nm] } - return $NM; + return $NM } proc process_multilib_options { args } { - global board; - global board_variant_list; - global is_gdb_remote; + global board + global board_variant_list + global is_gdb_remote - set is_gdb_remote 0; + set is_gdb_remote 0 if [board_info $board exists multilib_flags] { - return; + return } - eval add_multilib_option $args; + eval add_multilib_option $args - set multilib_flags ""; + set multilib_flags "" foreach x $board_variant_list { - regsub -all "^\[ \t\]*" "$x" "" x; - regsub -all "\[ \t\]*$" "$x" "" x; + regsub -all "^\[ \t\]*" "$x" "" x + regsub -all "\[ \t\]*$" "$x" "" x if { $x == "" } { - continue; + continue } case $x in { { aout } { - set_board_info obj_format "a.out"; + set_board_info obj_format "a.out" } { elf } { - set_board_info obj_format "elf"; + set_board_info obj_format "elf" } { pe } { - set_board_info obj_format "pe"; + set_board_info obj_format "pe" } { ecoff } { - set_board_info obj_format "ecoff"; + set_board_info obj_format "ecoff" } { stabs } { - set_board_info debug_flags "-gstabs"; + set_board_info debug_flags "-gstabs" } { dwarf2 } { - set_board_info debug_flags "-gdwarf2"; + set_board_info debug_flags "-gdwarf2" } { gdb:*=* } { - regsub "^gdb:\[^=\]*=(.*)$" "$x" "\\1" value; - regsub "^gdb:(\[^=\]*)=.*$" "$x" "\\1" variable; - set_board_info $variable "$value"; + regsub "^gdb:\[^=\]*=(.*)$" "$x" "\\1" value + regsub "^gdb:(\[^=\]*)=.*$" "$x" "\\1" variable + set_board_info $variable "$value" } { gdb*remote } { - set is_gdb_remote 1; + set is_gdb_remote 1 } { little*endian el EL } { - append multilib_flags " -EL"; + append multilib_flags " -EL" } { big*endian eb EB } { - append multilib_flags " -EB"; + append multilib_flags " -EB" } { "soft*float" } { append multilib_flags " -msoft-float" } { "-*" } { - append multilib_flags " $x"; + append multilib_flags " $x" } default { - append multilib_flags " -m$x"; + append multilib_flags " -m$x" } } } - set_board_info multilib_flags $multilib_flags; + set_board_info multilib_flags $multilib_flags } proc add_multilib_option { args } { @@ -786,7 +786,7 @@ proc add_multilib_option { args } { if ![info exists board_variant_list] { set board_variant_list "" } - set board_variant_list [concat $args $board_variant_list]; + set board_variant_list [concat $args $board_variant_list] } proc find_gas { } { @@ -795,15 +795,15 @@ proc find_gas { } { set AS "" if ![is_remote host] { - set AS [lookfor_file $tool_root_dir as-new]; + set AS [lookfor_file $tool_root_dir as-new] if { $AS == "" } { - set AS [lookfor_file $tool_root_dir gas/as-new]; + set AS [lookfor_file $tool_root_dir gas/as-new] } } if { $AS == "" } { - set AS [transform as]; + set AS [transform as] } - return $AS; + return $AS } proc find_ld { } { @@ -812,15 +812,15 @@ proc find_ld { } { set LD "" if ![is_remote host] { - set LD [lookfor_file $tool_root_dir ld-new]; + set LD [lookfor_file $tool_root_dir ld-new] if { $LD == "" } { - set LD [lookfor_file $tool_root_dir ld/ld-new]; + set LD [lookfor_file $tool_root_dir ld/ld-new] } } if { $LD == "" } { - set LD [transform ld]; + set LD [transform ld] } - return $LD; + return $LD } proc build_wrapper { gluefile } { @@ -828,28 +828,28 @@ proc build_wrapper { gluefile } { global tool if [target_info exists wrap_m68k_aout] { - set flags "additional_flags=-DWRAP_M68K_AOUT"; - set result ""; + set flags "additional_flags=-DWRAP_M68K_AOUT" + set result "" } elseif [target_info exists uses_underscores] { - set flags "additional_flags=-DUNDERSCORES"; - set result "-Wl,-wrap,_exit -Wl,-wrap,__exit -Wl,-wrap,_main -Wl,-wrap,_abort"; + set flags "additional_flags=-DUNDERSCORES" + set result "-Wl,-wrap,_exit -Wl,-wrap,__exit -Wl,-wrap,_main -Wl,-wrap,_abort" } else { - set flags ""; + set flags "" if [target_info exists is_vxworks] { - set flags "additional_flags=-DVXWORKS"; - set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort"; - set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort"; + set flags "additional_flags=-DVXWORKS" + set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort" + set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort" } else { - set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort"; + set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort" } } if [target_info exists wrap_compile_flags] { - lappend flags "additional_flags=[target_info wrap_compile_flags]"; + lappend flags "additional_flags=[target_info wrap_compile_flags]" } if { [target_compile ${libdir}/testglue.c ${gluefile} object $flags] == "" } { - set gluefile [remote_download host ${gluefile} ${tool}_tg.o]; - return [list $gluefile $result]; + set gluefile [remote_download host ${gluefile} ${tool}_tg.o] + return [list $gluefile $result] } else { return "" } diff --git a/lib/mondfe.exp b/lib/mondfe.exp index add4597..82486fe 100644 --- a/lib/mondfe.exp +++ b/lib/mondfe.exp @@ -35,24 +35,24 @@ proc mondfe_open { hostname } { set shell_prompt [board_info $hostname shell_prompt] if ![board_info $hostname exists mondfe,name] { perror "Must set board_info(${hostname},mondfe,name)" - return -1; + return -1 } if [board_info $hostname exists mondfe] { - set mondfe [board_info $hostname mondfe]; + set mondfe [board_info $hostname mondfe] } else { set mondfe "mondfe" } - set remote_host [board_info $hostname mondfe,name]; + set remote_host [board_info $hostname mondfe,name] if [board_info $hostname exists mondfe_host] { - set rh [board_info $hostname mondfe_host]; + set rh [board_info $hostname mondfe_host] } else { verbose "Attempting to connect to $hostname via mondfe." - set rh "host"; + set rh "host" } - set shell_id [remote_spawn $rh "$mondfe -D -TIP $remote_host"]; + set shell_id [remote_spawn $rh "$mondfe -D -TIP $remote_host"] remote_expect $rh 60 { "$shell_prompt" { @@ -63,16 +63,16 @@ proc mondfe_open { hostname } { warning "Socket file already exists." incr retries if { $retries <= 2 } { - exp_continue; + exp_continue } } -indices -re ".*(UDIERROR\[^\r\n\]*)\[\r\n\]" { warning "$expect_out(1,string)" - exp_continue; + exp_continue } -indices -re ".*(DFEERROR\[^\r\n\]*)\[\r\n\]" { warning "$expect_out(1,string)" - exp_continue; + exp_continue } timeout { warning "Timed out trying to connect." @@ -80,18 +80,18 @@ proc mondfe_open { hostname } { incr retries if { $retries <= 2 } { remote_send $rh "\n" - exp_continue; + exp_continue } } } if { $result < 0 } { perror "Couldn't connect after $retries retries." - remote_close $rh; + remote_close $rh return -1 } else { - set board_info($hostname,fileid) $shell_id; - return $shell_id; + set board_info($hostname,fileid) $shell_id + return $shell_id } } @@ -112,10 +112,10 @@ proc mondfe_ld { dest_machine file } { set shell_prompt [board_info $dest_machine shell_prompt] if [board_info $dest_machine exists mondfe_host] { - set remote_host [board_info $dest_machine mondfe_host]; + set remote_host [board_info $dest_machine mondfe_host] set file [remote_download $remote_host $file montest] } else { - set remote_host "host"; + set remote_host "host" } verbose "Downloading $file." 2 @@ -124,26 +124,26 @@ proc mondfe_ld { dest_machine file } { remote_send $remote_host "y $file\n" remote_expect $remote_host 60 { "y $file" { - exp_continue; + exp_continue } -re "loading $file\[\r\n\]+" { - exp_continue; + exp_continue } -re "Load(ing|ed) *TEXT section from\[^\r\n\]*\[\r\n\]+" { verbose -n "." 2 - exp_continue; + exp_continue } -re "Load(ing|ed) *LIT section from\[^\r\n\]*\[\r\n\]+" { verbose -n "." 2 - exp_continue; + exp_continue } -re "Load(ing|ed) *DATA section from\[^\r\n\]*\[\r\n\]+" { verbose -n "." 2 - exp_continue; + exp_continue } -re "Clear(ing|ed) *BSS section from\[^\r\n\]*\[\r\n\]+" { verbose -n "." 2 - exp_continue; + exp_continue } -re "(^|\[\r\n\]+)$shell_prompt$" { verbose "Downloaded $file successfully." 2 @@ -158,7 +158,7 @@ proc mondfe_ld { dest_machine file } { } -re "Ignoring COMMENT section \($decimal bytes\)\[^\r\n\]*\[\r\n\]+" { verbose "Ignoring COMMENT section" 2 - exp_continue; + exp_continue } timeout { perror "Timed out trying to download $file." @@ -184,13 +184,13 @@ proc mondfe_close { hostname } { global board_info if [board_info $hostname exists mondfe_host] { - set remote_host [board_info $hostname mondfe_host]; + set remote_host [board_info $hostname mondfe_host] } else { - set remote_host "host"; + set remote_host "host" } if ![board_info $hostname exists fileid] { - return 0; + return 0 } if [board_info $remote_host exists fileid] { @@ -204,10 +204,10 @@ proc mondfe_close { hostname } { } } - remote_close $remote_host; + remote_close $remote_host } - unset board_info($hostname,fileid); + unset board_info($hostname,fileid) - return 0; + return 0 } diff --git a/lib/remote.exp b/lib/remote.exp index 7a1db84..6c11554 100644 --- a/lib/remote.exp +++ b/lib/remote.exp @@ -50,14 +50,14 @@ proc remote_open { args } { # Shudder... if { $reboot && $type == "target" } { - reboot_target; + reboot_target } - return [call_remote "" open $type]; + return [call_remote "" open $type] } proc remote_raw_open { args } { - return [eval call_remote raw open $args]; + return [eval call_remote raw open $args] } # Run the specified COMMANDLINE on the local machine, redirecting input @@ -75,7 +75,7 @@ proc remote_raw_open { args } { # the kill command will be invoked. # proc local_exec { commandline inp outp timeout } { - # TCL's exec is a pile of crap. It does two very inappropriate things; + # TCL's exec is a pile of crap. It does two very inappropriate things # firstly, it has no business returning an error if the program being # executed happens to write to stderr. Secondly, it appends its own # error messages to the output of the command if the process exits with @@ -92,84 +92,84 @@ proc local_exec { commandline inp outp timeout } { # no way to timeout programs that hang. *sigh* # if { "$inp" == "" && "$outp" == "" } { - set id -1; - set result [catch "eval spawn \{${commandline}\}" pid]; + set id -1 + set result [catch "eval spawn \{${commandline}\}" pid] if { $result == 0 } { - set result2 0; + set result2 0 } else { - set pid 0; - set result2 5; + set pid 0 + set result2 5 } } else { # Can you say "uuuuuugly"? I knew you could! # All in the name of non-infinite hangs. if { $inp != "" } { - set inp "< $inp"; - set mode "r"; + set inp "< $inp" + set mode "r" } else { - set mode "w"; + set mode "w" } - set use_tee 0; + set use_tee 0 # We add |& cat so that TCL exec doesn't freak out if the # program writes to stderr. if { $outp == "" } { set outp "|& cat" } else { - set outpf "$outp"; + set outpf "$outp" set outp "> $outp" if { $inp != "" } { - set use_tee 1; + set use_tee 1 } } # Why do we use tee? Because open can't redirect both input and output. if { $use_tee } { - set result [catch {open "| ${commandline} $inp |& tee $outpf" RDONLY} id] ; + set result [catch {open "| ${commandline} $inp |& tee $outpf" RDONLY} id] } else { - set result [catch {open "| ${commandline} $inp $outp" $mode} id] ; + set result [catch {open "| ${commandline} $inp $outp" $mode} id] } if { $result != 0 } { global errorInfo - return [list -1 "open of $commandline $inp $outp failed: $errorInfo"]; + return [list -1 "open of $commandline $inp $outp failed: $errorInfo"] } - set pid [pid $id]; - set result [catch "spawn -leaveopen $id" result2]; + set pid [pid $id] + set result [catch "spawn -leaveopen $id" result2] } # Prepend "-" to each pid, to generate the "process group IDs" needed by # kill. - set pgid "-[join $pid { -}]"; - verbose "pid is $pid $pgid"; + set pgid "-[join $pid { -}]" + verbose "pid is $pid $pgid" if { $result != 0 || $result2 != 0 } { # This shouldn't happen. - global errorInfo; + global errorInfo if [info exists errorInfo] { - set foo $errorInfo; + set foo $errorInfo } else { - set foo ""; + set foo "" } - verbose "spawn -open $id failed, $result $result2, $foo"; - catch "close $id"; - return [list -1 "spawn failed"]; + verbose "spawn -open $id failed, $result $result2, $foo" + catch "close $id" + return [list -1 "spawn failed"] } - set got_eof 0; - set output ""; + set got_eof 0 + set output "" # Wait for either $timeout seconds to elapse, or for the program to # exit. expect { -i $spawn_id -timeout $timeout -re ".+" { - append output $expect_out(buffer); + append output $expect_out(buffer) if { [string length $output] < 512000 } { - exp_continue -continue_timer; + exp_continue -continue_timer } } timeout { - warning "program timed out."; + warning "program timed out." } eof { - set got_eof 1; + set got_eof 1 } } @@ -178,51 +178,51 @@ proc local_exec { commandline inp outp timeout } { # However, TCL has no kill primitive, so we have to execute an external # command in order to execute the execution. (English. Gotta love it.) if { ! $got_eof } { - verbose "killing $pid $pgid"; + verbose "killing $pid $pgid" # This is very, very nasty. SH, instead of EXPECT, is used to # run this in the background since, on older CYGWINs, a # strange file I/O error occures. - exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill -15 $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &"; + exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill -15 $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &" } # This will hang if the kill doesn't work. Nothin' to do, and it's not ok. - catch "close -i $spawn_id"; - set r2 [catch "wait -i $spawn_id" wres]; + catch "close -i $spawn_id" + set r2 [catch "wait -i $spawn_id" wres] if { $id > 0 } { - set r2 [catch "close $id" res]; + set r2 [catch "close $id" res] } else { - verbose "waitres is $wres" 2; + verbose "waitres is $wres" 2 if { $r2 == 0 } { - set r2 [lindex $wres 3]; + set r2 [lindex $wres 3] if { [llength $wres] > 4 } { if { [lindex $wres 4] == "CHILDKILLED" } { - set r2 1; + set r2 1 } } if { $r2 != 0 } { - set res "$wres"; + set res "$wres" } else { - set res ""; + set res "" } } else { - set res "wait failed"; + set res "wait failed" } } if { $r2 != 0 || $res != "" || ! $got_eof } { - verbose "close result is $res"; - set status 1; + verbose "close result is $res" + set status 1 } else { - set status 0; + set status 0 } - verbose "output is $output"; + verbose "output is $output" if { $outp == "" } { - return [list $status $output]; + return [list $status $output] } else { - return [list $status ""]; + return [list $status ""] } } # -# Execute the supplied program on HOSTNAME. There are four optional arguments; +# Execute the supplied program on HOSTNAME. There are four optional arguments # the first is a set of arguments to pass to PROGRAM, the second is an # input file to feed to stdin of PROGRAM, the third is the name of an # output file where the output from PROGRAM should be written, and @@ -236,42 +236,42 @@ proc local_exec { commandline inp outp timeout } { # proc remote_exec { hostname program args } { if { [llength $args] > 0 } { - set pargs [lindex $args 0]; + set pargs [lindex $args 0] } else { set pargs "" } if { [llength $args] > 1 } { - set inp "[lindex $args 1]"; + set inp "[lindex $args 1]" } else { set inp "" } if { [llength $args] > 2 } { - set outp "[lindex $args 2]"; + set outp "[lindex $args 2]" } else { set outp "" } # 300 is probably a lame default. if { [llength $args] > 3 } { - set timeout "[lindex $args 3]"; + set timeout "[lindex $args 3]" } else { set timeout 300 } - verbose -log "Executing on $hostname: $program $pargs $inp $outp (timeout = $timeout)" 2; + verbose -log "Executing on $hostname: $program $pargs $inp $outp (timeout = $timeout)" 2 # Run it locally if appropriate. if { ![is_remote $hostname] } { - return [local_exec "$program $pargs" $inp $outp $timeout]; + return [local_exec "$program $pargs" $inp $outp $timeout] } else { - return [call_remote "" exec $hostname $program $pargs $inp $outp]; + return [call_remote "" exec $hostname $program $pargs $inp $outp] } } proc standard_exec { hostname args } { - return [eval rsh_exec \"$hostname\" $args]; + return [eval rsh_exec \"$hostname\" $args] } # @@ -282,57 +282,57 @@ proc standard_exec { hostname args } { proc remote_close { host } { while { 1 } { - set result [call_remote "" close "$host"]; + set result [call_remote "" close "$host"] if { [remote_pop_conn $host] != "pass" } { - break; + break } } - return $result; + return $result } proc remote_raw_close { host } { - return [call_remote raw close "$host"]; + return [call_remote raw close "$host"] } proc standard_close { host } { global board_info if [board_info ${host} exists fileid] { - set shell_id [board_info ${host} fileid]; - set pid -1; + set shell_id [board_info ${host} fileid] + set pid -1 verbose "Closing the remote shell $shell_id" 2 if [board_info ${host} exists fileid_origid] { - set oid [board_info ${host} fileid_origid]; - set pid [pid $oid]; - unset board_info(${host},fileid_origid); + set oid [board_info ${host} fileid_origid] + set pid [pid $oid] + unset board_info(${host},fileid_origid) } else { - set result [catch "exp_pid -i $shell_id" pid]; + set result [catch "exp_pid -i $shell_id" pid] if { $result != 0 || $pid <= 0 } { - set result [catch "pid $shell_id" pid]; + set result [catch "pid $shell_id" pid] if { $result != 0 } { - set pid -1; + set pid -1 } } } if { $pid > 0 } { - verbose "doing kill, pid is $pid"; + verbose "doing kill, pid is $pid" # This is very, very nasty. SH, instead of EXPECT, is used # to run this in the background since, on older CYGWINs, a # strange file I/O error occures. - set pgid "-[join $pid { -}]"; - exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &"; + set pgid "-[join $pid { -}]" + exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &" } - verbose "pid is $pid"; - catch "close -i $shell_id"; + verbose "pid is $pid" + catch "close -i $shell_id" if [info exists oid] { - catch "close $oid"; + catch "close $oid" } - catch "wait -i $shell_id"; - unset board_info(${host},fileid); - verbose "Shell closed."; + catch "wait -i $shell_id" + unset board_info(${host},fileid) + verbose "Shell closed." } - return 0; + return 0 } # @@ -340,32 +340,32 @@ proc standard_close { host } { # characters. # proc remote_binary { host } { - return [call_remote "" binary "$host"]; + return [call_remote "" binary "$host"] } proc remote_raw_binary { host } { - return [call_remote raw binary "$host"]; + return [call_remote raw binary "$host"] } proc remote_reboot { host } { - clone_output "\nRebooting ${host}\n"; + clone_output "\nRebooting ${host}\n" # FIXME: don't close the host connection, or all the remote # procedures will fail. - # remote_close $host; - set status [call_remote "" reboot "$host"]; + # remote_close $host + set status [call_remote "" reboot "$host"] if [board_info $host exists name] { - set host [board_info $host name]; + set host [board_info $host name] } if { [info proc ${host}_init] != "" } { - ${host}_init $host; + ${host}_init $host } - return $status; + return $status } proc standard_reboot { host } { - return ""; + return "" } # # Download file FILE to DEST. If the optional DESTFILE is specified, @@ -376,16 +376,16 @@ proc standard_reboot { host } { proc remote_download { dest file args } { if { [llength $args] > 0 } { - set destfile [lindex $args 0]; + set destfile [lindex $args 0] } else { - set destfile [file tail $file]; + set destfile [file tail $file] } if { ![is_remote $dest] } { if { $destfile == "" || $destfile == $file } { - return $file; + return $file } else { - set result [catch "exec cp -p $file $destfile" output]; + set result [catch "exec cp -p $file $destfile" output] if [regexp "same file|are identical" $output] { set result 0 set output "" @@ -396,14 +396,14 @@ proc remote_download { dest file args } { } if { $result != 0 || $output != "" } { perror "remote_download to $dest of $file to $destfile: $output" - return ""; + return "" } else { - return $destfile; + return $destfile } } } - return [call_remote "" download $dest $file $destfile]; + return [call_remote "" download $dest $file $destfile] } # @@ -416,23 +416,23 @@ proc standard_download {dest file destfile} { if [board_info $dest exists nfsdir] { set destdir [board_info $dest nfsdir] if [board_info $dest exists nfsroot_server] { - set dest [board_info $dest nfsroot_server]; + set dest [board_info $dest nfsroot_server] } else { - set dest ""; + set dest "" } - set destfile "$destdir/$destfile"; + set destfile "$destdir/$destfile" } if { "$dest" != "" } { - set result [rsh_download $dest $file $destfile]; + set result [rsh_download $dest $file $destfile] if { $result == $destfile } { - return $orig_destfile; + return $orig_destfile } else { - return $result; + return $result } } - set result [catch "exec cp -p $file $destfile" output]; + set result [catch "exec cp -p $file $destfile" output] if [regexp "same file|are identical" $output] { set result 0 set output "" @@ -443,28 +443,28 @@ proc standard_download {dest file destfile} { } if { $result != 0 || $output != "" } { perror "remote_download to $dest of $file to $destfile: $output" - return ""; + return "" } else { - return $orig_destfile; + return $orig_destfile } } proc remote_upload {dest srcfile args} { if { [llength $args] > 0 } { - set destfile [lindex $args 0]; + set destfile [lindex $args 0] } else { - set destfile [file tail $srcfile]; + set destfile [file tail $srcfile] } if { ![is_remote $dest] } { if { $destfile == "" || $srcfile == $destfile } { - return $srcfile; + return $srcfile } - set result [catch "exec cp -p $srcfile $destfile" output]; - return $destfile; + set result [catch "exec cp -p $srcfile $destfile" output] + return $destfile } - return [call_remote "" upload $dest $srcfile $destfile]; + return [call_remote "" upload $dest $srcfile $destfile] } proc standard_upload { dest srcfile destfile } { @@ -473,18 +473,18 @@ proc standard_upload { dest srcfile destfile } { if [board_info $dest exists nfsdir] { set destdir [board_info $dest nfsdir] if [board_info $dest exists nfsroot_server] { - set dest [board_info $dest nfsroot_server]; + set dest [board_info $dest nfsroot_server] } else { - set dest ""; + set dest "" } - set srcfile "$destdir/$srcfile"; + set srcfile "$destdir/$srcfile" } if { "$dest" != "" } { - return [rsh_upload $dest $srcfile $destfile]; + return [rsh_upload $dest $srcfile $destfile] } - set result [catch "exec cp -p $srcfile $destfile" output]; + set result [catch "exec cp -p $srcfile $destfile" output] if [regexp "same file|are identical" $output] { set result 0 set output "" @@ -495,12 +495,12 @@ proc standard_upload { dest srcfile destfile } { } if { $result != 0 || $output != "" } { perror "remote_upload to $dest of $file to $destfile: $output" - return ""; + return "" } else { - return $destfile; + return $destfile } - return [rsh_upload $dest $srcfile $destfile]; + return [rsh_upload $dest $srcfile $destfile] } # @@ -511,26 +511,26 @@ proc standard_upload { dest srcfile destfile } { proc call_remote { type proc dest args } { if [board_info $dest exists name] { - set dest [board_info $dest name]; + set dest [board_info $dest name] } if { $dest != "host" && $dest != "build" && $dest != "target" } { if { ![board_info $dest exists name] } { - global board; + global board if [info exists board] { blooie } - load_board_description $dest; + load_board_description $dest } } set high_prot "" if { $type != "raw" } { if [board_info $dest exists protocol] { - set high_prot "${dest} [board_info $dest protocol]"; + set high_prot "${dest} [board_info $dest protocol]" } else { - set high_prot "${dest} [board_info $dest generic_name]"; + set high_prot "${dest} [board_info $dest generic_name]" } } @@ -541,31 +541,31 @@ proc call_remote { type proc dest args } { if { $try != "" } { if { [info proc "${try}_${proc}"] != "" } { verbose "call_remote calling ${try}_${proc}" 3 - set result [eval ${try}_${proc} \"$dest\" $args]; - break; + set result [eval ${try}_${proc} \"$dest\" $args] + break } } } set ft "[board_info $dest file_transfer]" if { [info proc "${ft}_${proc}"] != "" } { verbose "calling ${ft}_${proc} $dest $args" 3 - set result2 [eval ${ft}_${proc} \"$dest\" $args]; + set result2 [eval ${ft}_${proc} \"$dest\" $args] } if ![info exists result] { if [info exists result2] { - set result $result2; + set result $result2 } else { - set result ""; + set result "" } } - return $result; + return $result } foreach try "${high_prot} [board_info $dest file_transfer] [board_info $dest connect] telnet standard" { verbose "looking for ${try}_${proc}" 4 if { $try != "" } { if { [info proc "${try}_${proc}"] != "" } { verbose "call_remote calling ${try}_${proc}" 3 - return [eval ${try}_${proc} \"$dest\" $args]; + return [eval ${try}_${proc} \"$dest\" $args] } } } @@ -573,18 +573,18 @@ proc call_remote { type proc dest args } { return "" } error "No procedure for '$proc' in call_remote" - return -1; + return -1 } # # Send FILE through the existing session established to DEST. # proc remote_transmit { dest file } { - return [call_remote "" transmit "$dest" "$file"]; + return [call_remote "" transmit "$dest" "$file"] } proc remote_raw_transmit { dest file } { - return [call_remote raw transmit "$dest" "$file"]; + return [call_remote raw transmit "$dest" "$file"] } # @@ -593,17 +593,17 @@ proc remote_raw_transmit { dest file } { # proc standard_transmit {dest file} { if [board_info ${dest} exists name] { - set dest [board_info ${dest} name]; + set dest [board_info ${dest} name] } if [board_info ${dest} exists baud] { - set baud [board_info ${dest} baud]; + set baud [board_info ${dest} baud] } else { - set baud 9600; + set baud 9600 } - set shell_id [board_info ${dest} fileid]; + set shell_id [board_info ${dest} fileid] set lines 0 - set chars 0; + set chars 0 set fd [open $file r] while { [gets $fd cur_line] >= 0 } { set errmess "" @@ -615,7 +615,7 @@ proc standard_transmit {dest file} { } set chars [expr $chars + ([string length $cur_line] * 10)] if { $chars > $baud } { - sleep 1; + sleep 1 set chars 0 } verbose "." 3 @@ -628,43 +628,43 @@ proc standard_transmit {dest file} { } proc remote_send { dest string } { - return [call_remote "" send "$dest" "$string"]; + return [call_remote "" send "$dest" "$string"] } proc remote_raw_send { dest string } { - return [call_remote raw send "$dest" "$string"]; + return [call_remote raw send "$dest" "$string"] } proc standard_send { dest string } { if ![board_info $dest exists fileid] { perror "no fileid for $dest" - return "no fileid for $dest"; + return "no fileid for $dest" } else { set shell_id [board_info $dest fileid] verbose "shell_id in standard_send is $shell_id" 3 verbose "send -i [board_info $dest fileid] -- {$string}" 3 if [catch "send -i [board_info $dest fileid] -- {$string}" errorInfo] { - return "$errorInfo"; + return "$errorInfo" } else { - return ""; + return "" } } } proc file_on_host { op file args } { - return [eval remote_file host \"$op\" \"$file\" $args]; + return [eval remote_file host \"$op\" \"$file\" $args] } proc file_on_build { op file args } { - return [eval remote_file build \"$op\" \"$file\" $args]; + return [eval remote_file build \"$op\" \"$file\" $args] } proc remote_file { dest args } { - return [eval call_remote \"\" file \"$dest\" $args]; + return [eval call_remote \"\" file \"$dest\" $args] } proc remote_raw_file { dest args } { - return [eval call_remote raw file \"$dest\" $args]; + return [eval call_remote raw file \"$dest\" $args] } # @@ -672,68 +672,68 @@ proc remote_raw_file { dest args } { # proc standard_file { dest op args } { - set file [lindex $args 0]; - verbose "dest in proc standard_file is $dest" 3; + set file [lindex $args 0] + verbose "dest in proc standard_file is $dest" 3 if { ![is_remote $dest] } { switch $op { cmp { - set otherfile [lindex $args 1]; + set otherfile [lindex $args 1] if { [file exists $file] && [file exists $otherfile] && [file size $file] == [file size $otherfile] } { - set r [remote_exec build cmp "$file $otherfile"]; + set r [remote_exec build cmp "$file $otherfile"] if { [lindex $r 0] == 0 } { - return 0; + return 0 } } - return 1; + return 1 } tail { - return [file tail $file]; + return [file tail $file] } dirname { if { [file pathtype $file] == "relative" } { - set file [remote_file $dest absolute $file]; + set file [remote_file $dest absolute $file] } - set result [file dirname $file]; + set result [file dirname $file] if { $result == "" } { - return "/"; + return "/" } - return $result; + return $result } join { - return [file join [lindex $args 0] [lindex $args 1]]; + return [file join [lindex $args 0] [lindex $args 1]] } absolute { - return [unix_clean_filename $dest $file]; + return [unix_clean_filename $dest $file] } exists { - return [file exists $file]; + return [file exists $file] } delete { foreach x $args { if { [file exists $x] && [file isfile $x] } { - exec rm -f $x; + exec rm -f $x } } - return; + return } } } switch $op { exists { # mmmm, quotes. - set status [remote_exec $dest "sh -c 'exit `\[ -f $file \]`'"]; - return [lindex $status 0]; + set status [remote_exec $dest "sh -c 'exit `\[ -f $file \]`'"] + return [lindex $status 0] } delete { set file "" # Allow multiple files to be deleted at once. foreach x $args { - append file " $x"; + append file " $x" } verbose "remote_file deleting $file" - set status [remote_exec $dest "rm -f $file"]; - return [lindex $status 0]; + set status [remote_exec $dest "rm -f $file"] + return [lindex $status 0] } } } @@ -744,23 +744,23 @@ proc standard_file { dest op args } { # proc unix_clean_filename { dest file } { if { [file pathtype $file] == "relative" } { - set file [remote_file $dest join [pwd] $file]; + set file [remote_file $dest join [pwd] $file] } - set result ""; + set result "" foreach x [split $file "/"] { if { $x == "." || $x == "" } { - continue; + continue } if { $x == ".." } { - set rlen [expr [llength $result] - 2]; + set rlen [expr [llength $result] - 2] if { $rlen >= 0 } { - set result [lrange $result 0 $rlen]; + set result [lrange $result 0 $rlen] } else { set result "" } - continue; + continue } - lappend result $x; + lappend result $x } return "/[join $result /]" } @@ -782,68 +782,68 @@ proc remote_spawn { dest commandline args } { if ![is_remote $dest] { if [info exists board_info($dest,fileid)] { - unset board_info($dest,fileid); + unset board_info($dest,fileid) } - verbose "remote_spawn is local" 3; + verbose "remote_spawn is local" 3 if [board_info $dest exists name] { - set dest [board_info $dest name]; + set dest [board_info $dest name] } verbose "spawning command $commandline" if { [llength $args] > 0 } { if { [lindex $args 0] == "readonly" } { - set result [catch { open "| ${commandline} |& cat" "r" } id]; + set result [catch { open "| ${commandline} |& cat" "r" } id] if { $result != 0 } { - return -1; + return -1 } } else { - set result [catch {open "| ${commandline}" "w"} id] ; + set result [catch {open "| ${commandline}" "w"} id] if { $result != 0 } { - return -1; + return -1 } } - set result [catch "spawn -leaveopen $id" result2]; + set result [catch "spawn -leaveopen $id" result2] if { $result == 0 && $result2 == 0} { verbose "setting board_info($dest,fileid) to $spawn_id" 3 - set board_info($dest,fileid) $spawn_id; - set board_info($dest,fileid_origid) $id; - return $spawn_id; + set board_info($dest,fileid) $spawn_id + set board_info($dest,fileid_origid) $id + return $spawn_id } else { # This shouldn't happen. - global errorInfo; + global errorInfo if [info exists errorInfo] { - set foo $errorInfo; + set foo $errorInfo } else { - set foo ""; + set foo "" } - verbose "spawn -open $id failed, $result $result2, $foo"; - catch "close $id"; - return -1; + verbose "spawn -open $id failed, $result $result2, $foo" + catch "close $id" + return -1 } } else { - set result [catch "spawn $commandline" pid]; + set result [catch "spawn $commandline" pid] if { $result == 0 } { verbose "setting board_info($dest,fileid) to $spawn_id" 3 - set board_info($dest,fileid) $spawn_id; - return $spawn_id; + set board_info($dest,fileid) $spawn_id + return $spawn_id } else { - verbose -log "spawn of $commandline failed"; - return -1; + verbose -log "spawn of $commandline failed" + return -1 } } } # Seems to me there should be a cleaner way to do this. if { "$args" == "" } { - return [call_remote "" spawn "$dest" "$commandline"]; + return [call_remote "" spawn "$dest" "$commandline"] } else { - return [call_remote "" spawn "$dest" "$commandline" $args]; + return [call_remote "" spawn "$dest" "$commandline" $args] } } proc remote_raw_spawn { dest commandline } { - return [call_remote raw spawn "$dest" "$commandline"]; + return [call_remote raw spawn "$dest" "$commandline"] } # @@ -859,7 +859,7 @@ proc standard_spawn { dest commandline } { set RSH rsh } } else { - set RSH [board_info $dest rsh_prog]; + set RSH [board_info $dest rsh_prog] } if ![board_info $dest exists username] { @@ -869,14 +869,14 @@ proc standard_spawn { dest commandline } { } if [board_info $dest exists hostname] { - set remote [board_info $dest hostname]; + set remote [board_info $dest hostname] } else { - set remote $dest; + set remote $dest } - spawn $RSH $rsh_useropts $remote $commandline; - set board_info($dest,fileid) $spawn_id; - return $spawn_id; + spawn $RSH $rsh_useropts $remote $commandline + set board_info($dest,fileid) $spawn_id + return $spawn_id } # @@ -889,70 +889,70 @@ proc standard_spawn { dest commandline } { proc remote_load { dest prog args } { global tool - set dname [board_info $dest name]; - set cache "[getenv REMOTELOAD_CACHE]/$tool/$dname/[file tail $prog]"; - set empty [is_remote $dest]; + set dname [board_info $dest name] + set cache "[getenv REMOTELOAD_CACHE]/$tool/$dname/[file tail $prog]" + set empty [is_remote $dest] if { [board_info $dest exists is_simulator] || [getenv REMOTELOAD_CACHE] == "" } { - set empty 0; + set empty 0 } else { for { set x 0; } {$x < [llength $args] } {incr x} { if { [lindex $args $x] != "" } { - set empty 0; - break; + set empty 0 + break } } } if $empty { - global sum_program; + global sum_program if [info exists sum_program] { if ![target_info exists objcopy] { - set_currtarget_info objcopy [find_binutils_prog objcopy]; + set_currtarget_info objcopy [find_binutils_prog objcopy] } if [is_remote host] { - set dprog [remote_download host $prog "a.out"]; + set dprog [remote_download host $prog "a.out"] } else { - set dprog $prog; + set dprog $prog } - set status [remote_exec host "[target_info objcopy]" "-O srec $dprog ${dprog}.sum"]; + set status [remote_exec host "[target_info objcopy]" "-O srec $dprog ${dprog}.sum"] if [is_remote host] { - remote_file upload ${dprog}.sum ${prog}.sum; + remote_file upload ${dprog}.sum ${prog}.sum } if { [lindex $status 0] == 0 } { - set sumout [remote_exec build "$sum_program" "${prog}.sum"]; - set sum [lindex $sumout 1]; - regsub "\[\r\n \t\]+$" "$sum" "" sum; + set sumout [remote_exec build "$sum_program" "${prog}.sum"] + set sum [lindex $sumout 1] + regsub "\[\r\n \t\]+$" "$sum" "" sum } else { - set sumout [remote_exec build "$sum_program" "${prog}"]; - set sum [lindex $sumout 1]; - regsub "\[\r\n \t\]+$" "$sum" "" sum; + set sumout [remote_exec build "$sum_program" "${prog}"] + set sum [lindex $sumout 1] + regsub "\[\r\n \t\]+$" "$sum" "" sum } - remote_file build delete ${prog}.sum; + remote_file build delete ${prog}.sum } if [file exists $cache] { - set same 0; + set same 0 if [info exists sum_program] { - set id [open $cache "r"]; - set oldsum [read $id]; - close $id; + set id [open $cache "r"] + set oldsum [read $id] + close $id if { $oldsum == $sum } { - set same 1; + set same 1 } } else { if { [remote_file build cmp $prog $cache] == 0 } { - set same 1; + set same 1 } } if { $same } { - set fd [open "${cache}.res" "r"]; - gets $fd l1; - set result [list $l1 [read $fd]]; - close $fd; + set fd [open "${cache}.res" "r"] + gets $fd l1 + set result [list $l1 [read $fd]] + close $fd } } } if ![info exists result] { - set result [eval call_remote \"\" load \"$dname\" \"$prog\" $args]; + set result [eval call_remote \"\" load \"$dname\" \"$prog\" $args] # Not quite happy about the "pass" condition, but it makes sense if # you think about it for a while-- *why* did the test not pass? if { $empty && [lindex $result 0] == "pass" } { @@ -963,25 +963,25 @@ proc remote_load { dest prog args } { } if [file exists $dir] { if [info exists sum_program] { - set id [open $cache "w"]; - puts -nonewline $id "$sum"; - close $id; + set id [open $cache "w"] + puts -nonewline $id "$sum" + close $id } else { - remote_exec build cp "$prog $cache"; + remote_exec build cp "$prog $cache" } - set id [open "${cache}.res" "w"]; - puts $id [lindex $result 0]; - puts -nonewline $id [lindex $result 1]; - close $id; + set id [open "${cache}.res" "w"] + puts $id [lindex $result 0] + puts -nonewline $id [lindex $result 1] + close $id } } } } - return $result; + return $result } proc remote_raw_load { dest prog args } { - return [eval call_remote raw load \"$dest\" \"$prog\" $args ]; + return [eval call_remote raw load \"$dest\" \"$prog\" $args ] } # @@ -991,13 +991,13 @@ proc remote_raw_load { dest prog args } { proc standard_load { dest prog args } { if { [llength $args] > 0 } { - set pargs [lindex $args 0]; + set pargs [lindex $args 0] } else { set pargs "" } if { [llength $args] > 1 } { - set inp "[lindex $args 1]"; + set inp "[lindex $args 1]" } else { set inp "" } @@ -1011,7 +1011,7 @@ proc standard_load { dest prog args } { if [is_remote $dest] { set remotefile "/tmp/[file tail $prog].[pid]" - set remotefile [remote_download $dest $prog $remotefile]; + set remotefile [remote_download $dest $prog $remotefile] if { $remotefile == "" } { verbose -log "Download of $prog to [board_info $dest name] failed." 3 return "unresolved" @@ -1023,10 +1023,10 @@ proc standard_load { dest prog args } { return "unresolved" } } - set status [remote_exec $dest $remotefile $pargs $inp]; - remote_file $dest delete $remotefile; + set status [remote_exec $dest $remotefile $pargs $inp] + remote_file $dest delete $remotefile } else { - set status [remote_exec $dest $prog $pargs $inp]; + set status [remote_exec $dest $prog $pargs $inp] } if { [lindex $status 0] < 0 } { verbose -log "Couldn't execute $prog, [lindex $status 1]" 3 @@ -1040,9 +1040,9 @@ proc standard_load { dest prog args } { verbose -log -- "$output" 2 } if { $status == 0 } { - return [list "pass" $output]; + return [list "pass" $output] } else { - return [list "fail" $output]; + return [list "fail" $output] } } @@ -1050,11 +1050,11 @@ proc standard_load { dest prog args } { # Loads PROG into DEST. # proc remote_ld { dest prog } { - return [eval call_remote \"\" ld \"$dest\" \"$prog\"]; + return [eval call_remote \"\" ld \"$dest\" \"$prog\"] } proc remote_raw_ld { dest prog } { - return [eval call_remote raw ld \"$dest\" \"$prog\"]; + return [eval call_remote raw ld \"$dest\" \"$prog\"] } # Wait up to TIMEOUT seconds for the last spawned command on DEST to @@ -1063,62 +1063,62 @@ proc remote_raw_ld { dest prog } { # produced by the command. proc remote_wait { dest timeout } { - return [eval call_remote \"\" wait \"$dest\" $timeout]; + return [eval call_remote \"\" wait \"$dest\" $timeout] } proc remote_raw_wait { dest timeout } { - return [eval call_remote raw wait \"$dest\" $timeout]; + return [eval call_remote raw wait \"$dest\" $timeout] } # The standard wait procedure, used for commands spawned on the local # machine. proc standard_wait { dest timeout } { - set output ""; - set status -1; + set output "" + set status -1 if [info exists exp_close_result] { - unset exp_close_result; + unset exp_close_result } remote_expect $dest $timeout { -re ".+" { - append output $expect_out(buffer); + append output $expect_out(buffer) if { [string length $output] > 512000 } { - remote_close $dest; - set status 1; + remote_close $dest + set status 1 } else { - exp_continue -continue_timer; + exp_continue -continue_timer } } timeout { - warning "program timed out."; + warning "program timed out." } eof { if [board_info $dest exists fileid_origid] { - global board_info; + global board_info - set id [board_info $dest fileid]; - set oid [board_info $dest fileid_origid]; + set id [board_info $dest fileid] + set oid [board_info $dest fileid_origid] verbose "$id $oid" - unset board_info($dest,fileid); - unset board_info($dest,fileid_origid); - catch "close -i $id"; + unset board_info($dest,fileid) + unset board_info($dest,fileid_origid) + catch "close -i $id" # I don't believe this. You HAVE to do a wait, even tho # it won't work! stupid ()*$%*)(% expect... - catch "wait -i $id"; - set r2 [catch "close $oid" res]; + catch "wait -i $id" + set r2 [catch "close $oid" res] if { $r2 != 0 } { - verbose "close result is $res"; - set status 1; + verbose "close result is $res" + set status 1 } else { - set status 0; + set status 0 } } else { - set s [wait -i [board_info $dest fileid]]; + set s [wait -i [board_info $dest fileid]] if { [lindex $s 0] != 0 && [lindex $s 2] == 0 } { - set status [lindex $s 3]; + set status [lindex $s 3] if { [llength $s] > 4 } { if { [lindex $s 4] == "CHILDKILLED" } { - set status 1; + set status 1 } } } @@ -1126,8 +1126,8 @@ proc standard_wait { dest timeout } { } } - remote_close $dest; - return [list $status $output]; + remote_close $dest + return [list $status $output] } # This checks the value cotained in the variable named "variable" in @@ -1136,7 +1136,7 @@ proc standard_wait { dest timeout } { # output from the wrapper is removed from the variable. proc check_for_board_status { variable } { - upvar $variable output; + upvar $variable output # If all programs of this board have a wrapper that always outputs a # status message, then the absence of it means that the program @@ -1149,9 +1149,9 @@ proc check_for_board_status { variable } { } if [regexp "(^|\[\r\n\])\\*\\*\\* EXIT code" $output] { - regsub "^.*\\*\\*\\* EXIT code " $output "" result; - regsub "\[\r\n\].*$" $result "" result; - regsub -all "(^|\[\r\n\]|\r\n)\\*\\*\\* EXIT code \[^\r\n\]*(\[\r\n\]\[\r\n\]?|$)" $output "" output; + regsub "^.*\\*\\*\\* EXIT code " $output "" result + regsub "\[\r\n\].*$" $result "" result + regsub -all "(^|\[\r\n\]|\r\n)\\*\\*\\* EXIT code \[^\r\n\]*(\[\r\n\]\[\r\n\]?|$)" $output "" output regsub "^\[^0-9\]*" $result "" result regsub "\[^0-9\]*$" $result "" result verbose "got board status $result" 3 @@ -1162,7 +1162,7 @@ proc check_for_board_status { variable } { return [expr $result] } } else { - return $nomatch_return; + return $nomatch_return } } @@ -1174,96 +1174,96 @@ proc check_for_board_status { variable } { # proc remote_expect { board timeout args } { - global errorInfo errorCode; - global remote_suppress_flag; + global errorInfo errorCode + global remote_suppress_flag - set spawn_id [board_info $board fileid]; + set spawn_id [board_info $board fileid] if { [llength $args] == 1 } { - set args "[lindex $args 0]"; + set args "[lindex $args 0]" } set res {} - set got_re 0; - set need_append 1; + set got_re 0 + set need_append 1 - set orig "$args"; + set orig "$args" - set error_sect ""; - set save_next 0; + set error_sect "" + set save_next 0 if { $spawn_id == "" } { # This should be an invalid spawn id. - set spawn_id 1000; + set spawn_id 1000 } for { set i 0; } { $i < [llength $args] } { incr i ; } { if { $need_append } { - append res "\n-i $spawn_id "; - set need_append 0; + append res "\n-i $spawn_id " + set need_append 0 } - set x "[lrange $args $i $i]"; - regsub "^\n*\[ \]*" "$x" "" x; + set x "[lrange $args $i $i]" + regsub "^\n*\[ \]*" "$x" "" x if { $x == "-i" || $x == "-timeout" || $x == "-ex" } { - append res "$x "; - set next [expr ${i}+1]; - append res "[lrange $args $next $next]"; - incr i; - continue; + append res "$x " + set next [expr ${i}+1] + append res "[lrange $args $next $next]" + incr i + continue } if { $x == "-n" || $x == "-notransfer" || $x == "-nocase" || $x == "-indices" } { - append res "${x} "; - continue; + append res "${x} " + continue } if { $x == "-re" } { - append res "${x} "; - set next [expr ${i}+1]; - set y [lrange $args $next $next]; - append res "${y} "; - set got_re 1; - incr i; - continue; + append res "${x} " + set next [expr ${i}+1] + set y [lrange $args $next $next] + append res "${y} " + set got_re 1 + incr i + continue } if { $got_re } { - set need_append 0; - append res "$x "; - set got_re 0; + set need_append 0 + append res "$x " + set got_re 0 if { $save_next } { - set save_next 0; - set error_sect [lindex $args $i]; + set save_next 0 + set error_sect [lindex $args $i] } } else { if { ${x} == "eof" } { - set save_next 1; + set save_next 1 } elseif { ${x} == "default" || ${x} == "timeout" } { if { $error_sect == "" } { - set save_next 1; + set save_next 1 } } - append res "${x} "; - set got_re 1; + append res "${x} " + set got_re 1 } } if [info exists remote_suppress_flag] { if { $remote_suppress_flag } { - set code 1; + set code 1 } } if ![info exists code] { - set res "\n-timeout $timeout $res"; - set body "expect \{\n-i $spawn_id -timeout $timeout $orig\}"; - set code [catch {uplevel $body} string]; + set res "\n-timeout $timeout $res" + set body "expect \{\n-i $spawn_id -timeout $timeout $orig\}" + set code [catch {uplevel $body} string] } if {$code == 1} { if { $error_sect != "" } { - set code [catch {uplevel $error_sect} string]; + set code [catch {uplevel $error_sect} string] } else { - warning "remote_expect statement without a default case?!"; - return; + warning "remote_expect statement without a default case?!" + return } } @@ -1280,84 +1280,84 @@ proc remote_expect { board timeout args } { # Push the current connection to HOST onto a stack. proc remote_push_conn { host } { - global board_info; + global board_info - set name [board_info $host name]; + set name [board_info $host name] if { $name == "" } { - return "fail"; + return "fail" } if ![board_info $host exists fileid] { - return "fail"; + return "fail" } - set fileid [board_info $host fileid]; - set conninfo [board_info $host conninfo]; + set fileid [board_info $host fileid] + set conninfo [board_info $host conninfo] if ![info exists board_info($name,fileid_stack)] { set board_info($name,fileid_stack) {} } - set board_info($name,fileid_stack) [list $fileid $conninfo $board_info($name,fileid_stack)]; - unset board_info($name,fileid); + set board_info($name,fileid_stack) [list $fileid $conninfo $board_info($name,fileid_stack)] + unset board_info($name,fileid) if [info exists board_info($name,conninfo)] { - unset board_info($name,conninfo); + unset board_info($name,conninfo) } - return "pass"; + return "pass" } # Pop a previously-pushed connection from a stack. You should have closed the # current connection before doing this. proc remote_pop_conn { host } { - global board_info; + global board_info - set name [board_info $host name]; + set name [board_info $host name] if { $name == "" } { - return "fail"; + return "fail" } if ![info exists board_info($name,fileid_stack)] { - return "fail"; + return "fail" } - set stack $board_info($name,fileid_stack); + set stack $board_info($name,fileid_stack) if { [llength $stack] < 3 } { - return "fail"; + return "fail" } - set board_info($name,fileid) [lindex $stack 0]; - set board_info($name,conninfo) [lindex $stack 1]; - set board_info($name,fileid_stack) [lindex $stack 2]; - return "pass"; + set board_info($name,fileid) [lindex $stack 0] + set board_info($name,conninfo) [lindex $stack 1] + set board_info($name,fileid_stack) [lindex $stack 2] + return "pass" } # # Swap the current connection with the topmost one on the stack. # proc remote_swap_conn { host } { - global board_info; - set name [board_info $host name]; + global board_info + set name [board_info $host name] if ![info exists board_info($name,fileid)] { - return "fail"; + return "fail" } - set fileid $board_info($name,fileid); + set fileid $board_info($name,fileid) if [info exists board_info($name,conninfo)] { - set conninfo $board_info($name,conninfo); + set conninfo $board_info($name,conninfo) } else { set conninfo {} } if { [remote_pop_conn $host] != "pass" } { - set board_info($name,fileid) $fileid; - set board_info($name,conninfo) $conninfo; - return "fail"; - } - set newfileid $board_info($name,fileid); - set newconninfo $board_info($name,conninfo); - set board_info($name,fileid) $fileid; - set board_info($name,conninfo) $conninfo; - remote_push_conn $host; - set board_info($name,fileid) $newfileid; - set board_info($name,conninfo) $newconninfo; - return "pass"; + set board_info($name,fileid) $fileid + set board_info($name,conninfo) $conninfo + return "fail" + } + set newfileid $board_info($name,fileid) + set newconninfo $board_info($name,conninfo) + set board_info($name,fileid) $fileid + set board_info($name,conninfo) $conninfo + remote_push_conn $host + set board_info($name,fileid) $newfileid + set board_info($name,conninfo) $newconninfo + return "pass" } -set sum_program "testcsum"; +set sum_program "testcsum" diff --git a/lib/rlogin.exp b/lib/rlogin.exp index b49cd5d..8fe32a5 100644 --- a/lib/rlogin.exp +++ b/lib/rlogin.exp @@ -29,7 +29,7 @@ proc rlogin_open { arg } { set result -1 if [board_info $arg exists fileid] { - return [board_info $arg fileid]; + return [board_info $arg fileid] } # get the hostname and port number from the config array @@ -47,13 +47,13 @@ proc rlogin_open { arg } { } if [board_info $arg exists fileid] { - unset board_info($arg,fileid); + unset board_info($arg,fileid) } # get the right version of rlogin if ![board_info $arg exists rlogin_prog] { set RLOGIN rlogin } else { - set RLOGIN [board_info $arg rlogin_prog]; + set RLOGIN [board_info $arg rlogin_prog] } # start connection and store the spawn_id @@ -136,38 +136,38 @@ proc rlogin_open { arg } { # proc rlogin_spawn { dest cmdline } { if ![board_info $dest exists shell_prompt] { - set shell_prompt "(^|\[\r\n\])\[^\r\n\]*>"; + set shell_prompt "(^|\[\r\n\])\[^\r\n\]*>" } else { - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] } set prefix "" - set ok 0; + set ok 0 for {set i 0;} {$i <= 2 && ! $ok} {incr i;} { - set shell_id [remote_open $dest]; + set shell_id [remote_open $dest] if { $shell_id != "" && $shell_id > 0 } { - remote_send $dest "echo k\r"; + remote_send $dest "echo k\r" remote_expect $dest 20 { -re "\\(gdb\\)" { - set shell_prompt "\\(gdb\\)"; + set shell_prompt "\\(gdb\\)" # gdb uses 'shell command'. - set prefix "shell "; - set ok 1; + set prefix "shell " + set ok 1 } -re ".*$shell_prompt" { - set ok 1; + set ok 1 } default { } } } if { ! $ok } { - remote_close $dest; - remote_reboot $dest; + remote_close $dest + remote_reboot $dest } } if { ! $ok } { return "unable to start command" } else { - remote_send $dest "${prefix}${cmdline}\n"; - return [board_info $dest fileid]; + remote_send $dest "${prefix}${cmdline}\n" + return [board_info $dest fileid] } } diff --git a/lib/rsh.exp b/lib/rsh.exp index 95de794..ed71143 100644 --- a/lib/rsh.exp +++ b/lib/rsh.exp @@ -33,7 +33,7 @@ proc rsh_open { hostname } { set RSH rsh } } else { - set RSH [board_info $hostname rsh_prog]; + set RSH [board_info $hostname rsh_prog] } if [board_info $hostname exists username] { @@ -44,7 +44,7 @@ proc rsh_open { hostname } { # get the hostname and port number from the config array if [board_info $hostname exists name] { - set hostname [board_info $hostname name]; + set hostname [board_info $hostname name] } set hostname [lindex [split [board_info ${hostname} netport] ":"] 0] if [board_info ${hostname} exists shell_prompt] { @@ -54,7 +54,7 @@ proc rsh_open { hostname } { } if [board_info $hostname exists fileid] { - unset board_info($hostname,fileid); + unset board_info($hostname,fileid) } spawn $RSH $rsh_useropts $hostname @@ -152,13 +152,13 @@ proc rsh_open { hostname } { proc rsh_download {desthost srcfile destfile} { # must be done before desthost is rewritten if [board_info $desthost exists rcp_prog] { - set RCP [board_info $desthost rcp_prog]; + set RCP [board_info $desthost rcp_prog] } else { set RCP rcp } if [board_info $desthost exists rsh_prog] { - set RSH [board_info $desthost rsh_prog]; + set RSH [board_info $desthost rsh_prog] } else { if { [which remsh] != 0 } { set RSH remsh @@ -176,18 +176,18 @@ proc rsh_download {desthost srcfile destfile} { } if [board_info $desthost exists name] { - set desthost [board_info $desthost name]; + set desthost [board_info $desthost name] } if [board_info $desthost exists hostname] { - set desthost [board_info $desthost hostname]; + set desthost [board_info $desthost hostname] } set status [catch "exec $RSH $rsh_useropts $desthost rm -f $destfile |& cat" output] set status [catch "exec $RCP $srcfile $rcp_user$desthost:$destfile |& cat" output] if { $status == 0 } { verbose "Copied $srcfile to $desthost:$destfile" 2 - return $destfile; + return $destfile } else { verbose "Download to $desthost failed, $output." return "" @@ -196,7 +196,7 @@ proc rsh_download {desthost srcfile destfile} { proc rsh_upload {desthost srcfile destfile} { if [board_info $desthost exists rcp_prog] { - set RCP [board_info $desthost rcp_prog]; + set RCP [board_info $desthost rcp_prog] } else { set RCP rcp } @@ -208,17 +208,17 @@ proc rsh_upload {desthost srcfile destfile} { } if [board_info $desthost exists name] { - set desthost [board_info $desthost name]; + set desthost [board_info $desthost name] } if [board_info $desthost exists hostname] { - set desthost [board_info $desthost hostname]; + set desthost [board_info $desthost hostname] } - set status [catch "exec $RCP $rcp_user$desthost:$srcfile $destfile" output]; + set status [catch "exec $RCP $rcp_user$desthost:$srcfile $destfile" output] if { $status == 0 } { verbose "Copied $desthost:$srcfile to $destfile" 2 - return $destfile; + return $destfile } else { verbose "Upload from $desthost failed, $output." return "" @@ -230,11 +230,11 @@ proc rsh_upload {desthost srcfile destfile} { # proc rsh_exec { boardname cmd args } { if { [llength $args] > 0 } { - set pargs [lindex $args 0]; + set pargs [lindex $args 0] if { [llength $args] > 1 } { - set inp [lindex $args 1]; + set inp [lindex $args 1] } else { - set inp ""; + set inp "" } } else { set pargs "" @@ -250,7 +250,7 @@ proc rsh_exec { boardname cmd args } { set RSH rsh } } else { - set RSH [board_info $boardname rsh_prog]; + set RSH [board_info $boardname rsh_prog] } if [board_info $boardname exists username] { @@ -260,13 +260,13 @@ proc rsh_exec { boardname cmd args } { } if [board_info $boardname exists name] { - set boardname [board_info $boardname name]; + set boardname [board_info $boardname name] } if [board_info $boardname exists hostname] { - set hostname [board_info $boardname hostname]; + set hostname [board_info $boardname hostname] } else { - set hostname $boardname; + set hostname $boardname } diff --git a/lib/standard.exp b/lib/standard.exp index a197eaa..ecbd244 100644 --- a/lib/standard.exp +++ b/lib/standard.exp @@ -24,17 +24,17 @@ proc ${tool}_load { program args } { if { [llength $args] > 0 } { - set program_args [lindex $args 0]; + set program_args [lindex $args 0] } else { set program_args "" } if { [llength $args] > 1 } { - set input_file [lindex $args 1]; + set input_file [lindex $args 1] } else { - set input_file ""; + set input_file "" } - return [remote_load target $program $program_args $input_file]; + return [remote_load target $program $program_args $input_file] } proc ${tool}_compile { srcfile destfile compile_type options } { diff --git a/lib/target.exp b/lib/target.exp index a5d5f47..d5540e1 100644 --- a/lib/target.exp +++ b/lib/target.exp @@ -126,7 +126,7 @@ proc pop_host { } { # Remove extraneous warnings we don't care about # proc prune_warnings { text } { - global host_triplet; + global host_triplet # remove the \r part of "\r\n" so we don't break all the patterns # we want to match. @@ -290,11 +290,11 @@ proc prune_warnings { text } { # proc target_compile {source destfile type options} { - set target [target_info name]; + set target [target_info name] if { [info proc ${target}_compile] != "" } { - return [${target}_compile $source $destfile $type $options]; + return [${target}_compile $source $destfile $type $options] } else { - return [default_target_compile $source $destfile $type $options]; + return [default_target_compile $source $destfile $type $options] } } @@ -320,9 +320,9 @@ proc default_target_compile {source destfile type options} { } if [info exists target_info(host,name)] { - set host [host_info name]; + set host [host_info name] } else { - set host "unix"; + set host "unix" } foreach i $options { @@ -331,11 +331,11 @@ proc default_target_compile {source destfile type options} { if [board_info $dest exists cxxflags] { append add_flags " [target_info cxxflags]" } - append add_flags " [g++_include_flags]"; + append add_flags " [g++_include_flags]" if [board_info $dest exists c++compiler] { - set compiler [target_info c++compiler]; + set compiler [target_info c++compiler] } else { - set compiler [find_g++]; + set compiler [find_g++] } } @@ -355,9 +355,9 @@ proc default_target_compile {source destfile type options} { if [regexp "^dest=" $i] { regsub "^dest=" $i "" tmp if [board_info $tmp exists name] { - set dest [board_info $tmp name]; + set dest [board_info $tmp name] } else { - set dest $tmp; + set dest $tmp } } if [regexp "^compiler=" $i] { @@ -399,7 +399,7 @@ proc default_target_compile {source destfile type options} { } if [board_info $host exists cflags_for_target] { - append add_flags " [board_info $host cflags_for_target]"; + append add_flags " [board_info $host cflags_for_target]" } global CC_FOR_TARGET @@ -425,9 +425,9 @@ proc default_target_compile {source destfile type options} { } if { $compiler == "" } { - set compiler [board_info $dest compiler]; + set compiler [board_info $dest compiler] if { $compiler == "" } { - return "default_target_compile: No compiler to compile with"; + return "default_target_compile: No compiler to compile with" } } @@ -463,7 +463,7 @@ proc default_target_compile {source destfile type options} { append add_flags " [board_info $dest ldflags]" } if { $compiler_type == "c++" } { - append add_flags " [g++_link_flags]"; + append add_flags " [g++_link_flags]" } if [isnative] { # This is a lose. @@ -490,7 +490,7 @@ proc default_target_compile {source destfile type options} { foreach i $options { if { $i == "debug" } { if [board_info $dest exists debug_flags] { - append add_flags " [board_info $dest debug_flags]"; + append add_flags " [board_info $dest debug_flags]" } else { append add_flags " -g" } @@ -498,7 +498,7 @@ proc default_target_compile {source destfile type options} { } if [info exists optimize] { - append add_flags " $optimize"; + append add_flags " $optimize" } if { $type == "executable" } { @@ -507,7 +507,7 @@ proc default_target_compile {source destfile type options} { if [file exists $x] { append source " $x" } else { - append add_flags " $x"; + append add_flags " $x" } } @@ -527,19 +527,19 @@ proc default_target_compile {source destfile type options} { } # This must be added here. - append add_flags " $ldscript"; + append add_flags " $ldscript" if [board_info $dest exists remote_link] { # Relink option. append add_flags " -Wl,-r" } if [board_info $dest exists output_format] { - append add_flags " -Wl,-oformat,[board_info $dest output_format]"; + append add_flags " -Wl,-oformat,[board_info $dest output_format]" } } if [board_info $dest exists multilib_flags] { - append add_flags " [board_info $dest multilib_flags]"; + append add_flags " [board_info $dest multilib_flags]" } verbose "doing compile" @@ -547,12 +547,12 @@ proc default_target_compile {source destfile type options} { set sources "" if [is_remote host] { foreach x $source { - set file [remote_download host $x]; + set file [remote_download host $x] if { $file == "" } { warning "Unable to download $x to host." return "Unable to download $x to host." } else { - append sources " $file"; + append sources " $file" } } } else { @@ -561,10 +561,10 @@ proc default_target_compile {source destfile type options} { if [is_remote host] { append add_flags " -o a.out" - remote_file host delete a.out; + remote_file host delete a.out } else { if { $destfile != "" } { - append add_flags " -o $destfile"; + append add_flags " -o $destfile" } } @@ -579,9 +579,9 @@ proc default_target_compile {source destfile type options} { if [is_remote host] { if [host_info exists use_at] { - set fid [open "atfile" "w"]; - puts $fid "$opts"; - close $fid; + set fid [open "atfile" "w"] + puts $fid "$opts" + close $fid set opts "@[remote_download host atfile]" remote_file build delete atfile } @@ -591,39 +591,39 @@ proc default_target_compile {source destfile type options} { if [info exists redirect] { verbose "Redirecting output to $redirect" 2 - set status [remote_exec host "$compiler $opts" "" "" $redirect]; + set status [remote_exec host "$compiler $opts" "" "" $redirect] } else { if [info exists timeout] { verbose "Setting timeout to $timeout" 2 - set status [remote_exec host "$compiler $opts" "" "" "" $timeout]; + set status [remote_exec host "$compiler $opts" "" "" "" $timeout] } else { - set status [remote_exec host "$compiler $opts"]; + set status [remote_exec host "$compiler $opts"] } } set compiler_flags $opts if [is_remote host] { - remote_upload host a.out $destfile; - remote_file host delete a.out; + remote_upload host a.out $destfile + remote_file host delete a.out } - set comp_output [prune_warnings [lindex $status 1]]; - regsub "^\[\r\n\]+" $comp_output "" comp_output; + set comp_output [prune_warnings [lindex $status 1]] + regsub "^\[\r\n\]+" $comp_output "" comp_output if { [lindex $status 0] != 0 } { - verbose -log "compiler exited with status [lindex $status 0]"; + verbose -log "compiler exited with status [lindex $status 0]" } if { [lindex $status 1] != "" } { - verbose -log "output is:\n[lindex $status 1]" 2; + verbose -log "output is:\n[lindex $status 1]" 2 } if { [lindex $status 0] != 0 && "${comp_output}" == "" } { - set comp_output "exit status is [lindex $status 0]"; + set comp_output "exit status is [lindex $status 0]" } - return ${comp_output}; + return ${comp_output} } proc reboot_target { } { set result [remote_reboot target] puts "REBOOT_TARGET: \"$result\"" - return ${result}; + return ${result} } # @@ -632,7 +632,7 @@ proc reboot_target { } { # assembler. # proc target_assemble { source destfile flags } { - return [default_target_assemble $source $destfile $flags]; + return [default_target_assemble $source $destfile $flags] } proc default_target_assemble { source destfile flags } { @@ -640,21 +640,21 @@ proc default_target_assemble { source destfile flags } { global ASFLAGS_FOR_TARGET if [info exists AS_FOR_TARGET] { - set AS "$AS_FOR_TARGET"; + set AS "$AS_FOR_TARGET" } else { if ![board_info target exists assembler] { - set AS [find_gas]; + set AS [find_gas] } else { - set AS [board_info target assembler]; + set AS [board_info target assembler] } } if [info exists ASFLAGS_FOR_TARGET] { - append flags " $ASFLAGS_FOR_TARGET"; + append flags " $ASFLAGS_FOR_TARGET" } if [is_remote host] { - set source [remote_download host $source]; + set source [remote_download host $source] set dest "a.out" } else { set dest $destfile @@ -664,14 +664,14 @@ proc default_target_assemble { source destfile flags } { remote_upload host $dest $destfile } - set comp_output [prune_warnings [lindex $status 1]]; + set comp_output [prune_warnings [lindex $status 1]] if { [lindex $status 0] != 0 } { - verbose -log "assembler exited with status [lindex $status 0]"; + verbose -log "assembler exited with status [lindex $status 0]" } if { [lindex $status 1] != "" } { - verbose -log "assembler output is:\n[lindex $status 1]" 2; + verbose -log "assembler output is:\n[lindex $status 1]" 2 } - return ${comp_output}; + return ${comp_output} } # @@ -680,7 +680,7 @@ proc default_target_assemble { source destfile flags } { # linker. # proc target_link { objects destfile flags } { - return [default_link target "$objects" "$destfile" $flags]; + return [default_link target "$objects" "$destfile" $flags] } proc default_link { board objects destfile flags } { @@ -713,17 +713,17 @@ proc default_link { board objects destfile flags } { } if [info exists LD_FOR_TARGET] { - set LD "$LD_FOR_TARGET"; + set LD "$LD_FOR_TARGET" } else { if ![board_info target exists linker] { - set LD [find_ld]; + set LD [find_ld] } else { - set LD [board_info target linker]; + set LD [board_info target linker] } } if [info exists LDFLAGS_FOR_TARGET] { - append flags " $LDFLAGS_FOR_TARGET"; + append flags " $LDFLAGS_FOR_TARGET" } # `ldflags' consists of arguments to gcc (that are then @@ -744,24 +744,24 @@ proc default_link { board objects destfile flags } { if [is_remote host] { foreach x $objects { - set nobjects "$nobjects [remote_download host $x]"; + set nobjects "$nobjects [remote_download host $x]" } - set objects "$nobjects"; - set dest "a.out"; + set objects "$nobjects" + set dest "a.out" } else { - set dest $destfile; + set dest $destfile } set status [remote_exec host "$LD $objects $flags -o $dest"] if [is_remote host] { - remote_upload host $dest $destfile; + remote_upload host $dest $destfile } - set comp_output [prune_warnings [lindex $status 1]]; + set comp_output [prune_warnings [lindex $status 1]] if { [lindex $status 0] != 0 } { - verbose -log "linker exited with status [lindex $status 0]"; + verbose -log "linker exited with status [lindex $status 0]" } if { [lindex $status 1] != "" } { - verbose -log "linker output is:\n[lindex $status 1]" 2; + verbose -log "linker output is:\n[lindex $status 1]" 2 } - return ${comp_output}; + return ${comp_output} } diff --git a/lib/targetdb.exp b/lib/targetdb.exp index 99b3f58..7592653 100644 --- a/lib/targetdb.exp +++ b/lib/targetdb.exp @@ -28,50 +28,50 @@ proc board_info { machine op args } { verbose "board_info $machine $op $args" 3 if [info exists target_info($machine,name)] { - set machine $target_info($machine,name); + set machine $target_info($machine,name) } if { $op == "exists" } { if { [llength $args] == 0 } { if [info exists board_info($machine,name)] { - return 1; + return 1 } else { - return 0; + return 0 } } else { if [info exists "board_info($machine,[lindex $args 0])"] { - return 1; + return 1 } else { - return 0; + return 0 } } } if { [llength $args] == 0 } { verbose "getting $machine $op" 3 if [info exists board_info($machine,$op)] { - return $board_info($machine,$op); + return $board_info($machine,$op) } else { return "" } } - return ""; + return "" } proc target_info { op args } { - return [eval "board_info target \"$op\" $args"]; + return [eval "board_info target \"$op\" $args"] } proc host_info { op args } { - return [eval "board_info host \"$op\" $args"]; + return [eval "board_info host \"$op\" $args"] } # # Fill in ENTRY with VALUE for the current board being defined. # proc set_board_info { entry value } { - global board_info board; + global board_info board if ![info exists board_info($board,$entry)] { - set board_info($board,$entry) $value; + set board_info($board,$entry) $value } } @@ -79,12 +79,12 @@ proc set_board_info { entry value } { # Fill in ENTRY with VALUE for the current target. # proc set_currtarget_info { entry value } { - global board_info; + global board_info - set board [target_info name]; + set board [target_info name] if ![info exists board_info($board,$entry)] { - set board_info($board,$entry) $value; + set board_info($board,$entry) $value } } @@ -92,10 +92,10 @@ proc set_currtarget_info { entry value } { # Unset ENTRY for the current board being defined. # proc unset_board_info { entry } { - global board_info board; + global board_info board if [info exists board_info($board,$entry)] { - unset board_info($board,$entry); + unset board_info($board,$entry) } } @@ -103,11 +103,11 @@ proc unset_board_info { entry } { # Unset ENTRY for the current board being defined. # proc unset_currtarget_info { entry } { - global board_info; + global board_info - set board [target_info name]; + set board [target_info name] if [info exists board_info($board,$entry)] { - unset board_info($board,$entry); + unset board_info($board,$entry) } } diff --git a/lib/telnet.exp b/lib/telnet.exp index 061ea58..3c21752 100644 --- a/lib/telnet.exp +++ b/lib/telnet.exp @@ -30,11 +30,11 @@ proc telnet_open { hostname args } { global timeout global board_info - set raw 0; + set raw 0 if { [llength $args] > 0 } { if { [lindex $args 0] == "raw" } { - set raw 1; + set raw 1 } } @@ -46,19 +46,19 @@ proc telnet_open { hostname args } { } if [board_info $connhost exists hostname] { - set hostname [board_info $connhost hostname]; + set hostname [board_info $connhost hostname] } if [file exists /usr/kerberos/bin/telnet] { - set telnet /usr/kerberos/bin/telnet; + set telnet /usr/kerberos/bin/telnet } else { - set telnet telnet; + set telnet telnet } # Instead of unsetting it, let's return it. One connection at a # time, please. if [board_info $connhost exists fileid] { - return [board_info $connhost fileid]; + return [board_info $connhost fileid] } # get the hostname and port number from the config array if [board_info $connhost exists netport] { @@ -81,16 +81,16 @@ proc telnet_open { hostname args } { set tries 0 set result -1 - set need_respawn 1; + set need_respawn 1 verbose "Starting a telnet connection to $hostname:$port $shell_prompt" 2 while { $result < 0 && $tries <= 3 } { if { $need_respawn } { - set need_respawn 0; - spawn $telnet $hostname $port; + set need_respawn 0 + spawn $telnet $hostname $port } expect { "Trying " { - exp_continue; + exp_continue } -re "$shell_prompt.*$" { verbose "Got prompt\n" @@ -98,35 +98,35 @@ proc telnet_open { hostname args } { } -re "nt Name:|ogin:" { if [board_info $connhost exists telnet_username] { - exp_send "[board_info $connhost telnet_username]\n"; - exp_continue; + exp_send "[board_info $connhost telnet_username]\n" + exp_continue } if [board_info $connhost exists username] { - exp_send "[board_info $connhost username]\n"; - exp_continue; + exp_send "[board_info $connhost username]\n" + exp_continue } perror "telnet: need to login" break } "assword:" { if [board_info $connhost exists telnet_password] { - exp_send "[board_info $connhost telnet_password]\n"; - exp_continue; + exp_send "[board_info $connhost telnet_password]\n" + exp_continue } if [board_info $connhost exists password] { - exp_send "[board_info $connhost password]\n"; - exp_continue; + exp_send "[board_info $connhost password]\n" + exp_continue } perror "telnet: need a password" break } -re "advance.*y/n.*\\?" { - exp_send "n\n"; - exp_continue; + exp_send "n\n" + exp_continue } -re {([Aa]dvanced|[Ss]imple) or ([Ss]imple|[Aa]dvanced)} { - exp_send "simple\n"; - exp_continue; + exp_send "simple\n" + exp_continue } "Connected to" { exp_continue @@ -137,13 +137,13 @@ proc telnet_open { hostname args } { break } "VxWorks Boot" { - exp_send "@\n"; - sleep 20; - exp_continue; + exp_send "@\n" + sleep 20 + exp_continue } -re "Escape character is.*\\.\[\r\n\]" { if { $raw || [board_info $connhost exists dont_wait_for_prompt] } { - set result 0; + set result 0 } else { if [board_info $connhost exists send_initial_cr] { exp_send "\n" @@ -159,8 +159,8 @@ proc telnet_open { hostname args } { break } -re "Connection refused.*$" { - catch "exp_send \"\003\"" foo; - sleep 5; + catch "exp_send \"\003\"" foo + sleep 5 warning "telnet: connection refused." } -re "Sorry, this system is engaged.*" { @@ -179,10 +179,10 @@ proc telnet_open { hostname args } { } eof { warning "telnet: got unexpected EOF from telnet." - catch close; - catch wait; - set need_respawn 1; - sleep 5; + catch close + catch wait + set need_respawn 1 + sleep 5 } } incr tries @@ -211,7 +211,7 @@ proc telnet_open { hostname args } { # proc telnet_binary { hostname } { if [board_info $hostname exists fileid] { - remote_send $hostname ""; + remote_send $hostname "" remote_expect $hostname 5 { -re "telnet> *$" {} default {} @@ -219,16 +219,16 @@ proc telnet_binary { hostname } { remote_send $hostname "set binary\n" remote_expect $hostname 5 { -re "Format is .*telnet> *$" { - remote_send $hostname "toggle binary\n"; - exp_continue; + remote_send $hostname "toggle binary\n" + exp_continue } -re "Negotiating network ascii.*telnet> *$" { - remote_send $hostname "toggle binary\n"; - exp_continue; + remote_send $hostname "toggle binary\n" + exp_continue } -re "Negotiating binary.*\[\r\n\].*$" { } -re "binary.*unknown argument.*telnet> *$" { - remote_send $hostname "mode character\n"; + remote_send $hostname "mode character\n" } -re "Already operating in binary.*\[\r\n\].*$" { } timeout { @@ -239,5 +239,5 @@ proc telnet_binary { hostname } { } proc telnet_transmit { dest file args } { - return [standard_transmit $dest $file]; + return [standard_transmit $dest $file] } diff --git a/lib/tip.exp b/lib/tip.exp index e829595..0828cec 100644 --- a/lib/tip.exp +++ b/lib/tip.exp @@ -30,7 +30,7 @@ proc tip_open { hostname } { set result -1 if [board_info $hostname exists name] { - set hostname [board_info ${hostname} name]; + set hostname [board_info ${hostname} name] } set port [board_info ${hostname} tipname] if [board_info ${hostname} exists shell_prompt] { @@ -40,7 +40,7 @@ proc tip_open { hostname } { } if [board_info ${hostname} exists fileid] { - unset board_info(${hostname},fileid); + unset board_info(${hostname},fileid) } spawn tip -v $port if { $spawn_id < 0 } { @@ -130,7 +130,7 @@ proc tip_download { dest file args } { global expect_out if [board_info $dest exists shell_prompt] { - set shell_prompt [board_info $dest shell_prompt]; + set shell_prompt [board_info $dest shell_prompt] } else { set shell_prompt ".*>" } @@ -138,9 +138,9 @@ proc tip_download { dest file args } { set result "" if ![board_info $dest exists fileid] { perror "tip_download: no connection to $dest." - return $result; + return $result } - set shell_id [board_info $dest fileid]; + set shell_id [board_info $dest fileid] if ![file exists $file] { perror "$file doesn't exist." @@ -159,7 +159,7 @@ proc tip_download { dest file args } { } -i $shell_id -re ".*lines transferred in.*minute.*seconds.*$shell_prompt.*$" { verbose "Download $file successfully" 1 - set result $file; + set result $file } -i $shell_id -re ".*Invalid command.*$shell_prompt$" { warning "Got an invalid command to the remote shell." diff --git a/lib/xsh.exp b/lib/xsh.exp index 07d6911..4d3661d 100644 --- a/lib/xsh.exp +++ b/lib/xsh.exp @@ -29,28 +29,28 @@ proc xsh_open { hostname } { global board_info if [board_info $hostname exists fileid] { - unset board_info($hostname,fileid); + unset board_info($hostname,fileid) } if ![board_info $hostname exists spectra] { - perror "No spectra directory for $hostname"; - return -1; + perror "No spectra directory for $hostname" + return -1 } else { - set spectra [board_info $hostname spectra]; + set spectra [board_info $hostname spectra] } if ![board_info $hostname exists xsh_shell_prompt] { set xsh_shell_prompt ".*> " } else { - set xsh_shell_prompt [board_info $hostname shell_prompt]; + set xsh_shell_prompt [board_info $hostname shell_prompt] } set retries 0 set result 0 if ![board_info $hostname exists xsh_prog] { - set xsh xsh; + set xsh xsh } else { - set xsh [board_info $hostname xsh_prog]; + set xsh [board_info $hostname xsh_prog] } if {[which $xsh] != 0} { @@ -121,7 +121,7 @@ proc xsh_open { hostname } { } } - set board_info($hostname,fileid) $spawn_id; + set board_info($hostname,fileid) $spawn_id # load to operating system set timeout 20 set retries 0 @@ -164,7 +164,7 @@ proc xsh_open { hostname } { perror "Couldn't connect after $retries retries.\n" return -1 } else { - set board_info($hostname,fileid) $spawn_id; + set board_info($hostname,fileid) $spawn_id return $spawn_id } } @@ -187,7 +187,7 @@ proc xsh_download { dest file destfile args } { set result 1 set retries 0 - set shell_id [board_info $dest fileid]; + set shell_id [board_info $dest fileid] if { [llength $args] > 1 } { set opts [lindex $args 1] @@ -310,12 +310,12 @@ proc xsh_close { hostname } { global board_info if ![board_info $hostname exists fileid] { - return; + return } - set shell_id [board_info ${hostname} fileid]; + set shell_id [board_info ${hostname} fileid] send -i $shell_id "exit\n" - unset board_info(${hostname},fileid); + unset board_info(${hostname},fileid) verbose "Exiting shell." return 0 diff --git a/runtest.exp b/runtest.exp index 5409da6..aaefb1d 100755 --- a/runtest.exp +++ b/runtest.exp @@ -210,7 +210,7 @@ proc transform { name } { global target_triplet global target_alias global host_triplet - global board; + global board if [string match $target_triplet $host_triplet] { return $name @@ -226,23 +226,23 @@ proc transform { name } { } else { if [info exists board] { if [board_info $board exists target_install] { - set target_install [board_info $board target_install]; + set target_install [board_info $board target_install] } } if [target_info exists target_install] { - set target_install [target_info target_install]; + set target_install [target_info target_install] } if [info exists target_alias] { - set tmp ${target_alias}-${name}; + set tmp ${target_alias}-${name} } elseif [info exists target_install] { if { [lsearch -exact $target_install $target_alias] >= 0 } { - set tmp ${target_alias}-${name}; + set tmp ${target_alias}-${name} } else { - set tmp "[lindex $target_install 0]-${name}"; + set tmp "[lindex $target_install 0]-${name}" } } - verbose "Transforming $name to $tmp"; - return $tmp; + verbose "Transforming $name to $tmp" + return $tmp } } @@ -335,7 +335,7 @@ proc load_file { args } { # TYPE is used when displaying error and progress messages. # proc search_and_load_file { type filelist dirlist } { - set found 0; + set found 0 foreach dir $dirlist { foreach initfile $filelist { @@ -363,14 +363,14 @@ proc search_and_load_file { type filelist dirlist } { break } } - return $found; + return $found } # # Give a usage statement. # proc usage { } { - global tool; + global tool send_user "USAGE: runtest \[options...\]\n" send_user "\t--all (-a)\t\tPrint all test output to screen\n" @@ -400,7 +400,7 @@ proc usage { } { send_user "\tscript.exp\[=arg(s)\]\tRun these tests only\n" if { [info exists tool] } { if { [info proc ${tool}_option_help] != "" } { - ${tool}_option_help; + ${tool}_option_help } } } @@ -482,8 +482,8 @@ for { set i 0 } { $i < $argc } { incr i } { } "--target_bo*" { - set target_list $optarg; - continue; + set target_list $optarg + continue } "--ta*" { # (--target) the target configuration @@ -503,12 +503,12 @@ for { set i 0 } { $i < $argc } { incr i } { "--tool_ro*" { set tool_root_dir $optarg - continue; + continue } "--to*" { # (--tool) specify tool name set tool $optarg - set comm_line_tool $optarg; + set comm_line_tool $optarg continue } @@ -574,9 +574,9 @@ proc lookfor_file { dir name } { foreach x ".. ../.. ../../.. ../../../.." { verbose "$dir/$name" 2 if [file exists $dir/$name] { - return $dir/$name; + return $dir/$name } - set dir [remote_file build dirname $dir]; + set dir [remote_file build dirname $dir] } return "" } @@ -593,10 +593,10 @@ proc load_lib { file } { global loaded_libs if [info exists loaded_libs($file)] { - return; + return } - set loaded_libs($file) ""; + set loaded_libs($file) "" if { [search_and_load_file "library file" $file [list ../lib $libdir $libdir/lib [file dirname [file dirname $srcdir]]/dejagnu/lib $srcdir/lib $execpath/lib . [file dirname [file dirname [file dirname $srcdir]]]/dejagnu/lib]] == 0 } { send_error "ERROR: Couldn't find library file $file.\n" @@ -637,9 +637,9 @@ if [expr [string match "." $objdir] || [string match $srcdir $objdir]] { # Well, this just demonstrates the real problem... if ![info exists tool_root_dir] { - set tool_root_dir [file dirname $objdir]; + set tool_root_dir [file dirname $objdir] if [file exists "$tool_root_dir/testsuite"] { - set tool_root_dir [file dirname $tool_root_dir]; + set tool_root_dir [file dirname $tool_root_dir] } } @@ -734,10 +734,10 @@ proc get_local_hostname { } { if [catch "info hostname" hb] { set hb "" } else { - regsub "\\..*$" $hb "" hb; + regsub "\\..*$" $hb "" hb } - verbose "hostname=$hb" 3; - return $hb; + verbose "hostname=$hb" 3 + return $hb } # @@ -749,41 +749,41 @@ proc get_local_hostname { } { # variable $board set to the name of the current target being defined. # proc setup_target_hook { whole_name name } { - global board; - global host_board; + global board + global host_board if [info exists host_board] { - set hb $host_board; + set hb $host_board } else { - set hb [get_local_hostname]; + set hb [get_local_hostname] } - set board $whole_name; + set board $whole_name - global board_type; - set board_type "target"; + global board_type + set board_type "target" - load_config base-config.exp; + load_config base-config.exp if ![load_board_description ${name} ${whole_name} ${hb}] { if { $name != "unix" } { - perror "couldn't load description file for ${name}"; - exit 1; + perror "couldn't load description file for ${name}" + exit 1 } else { load_generic_config "unix" } } if [board_info $board exists generic_name] { - load_tool_target_config [board_info $board generic_name]; + load_tool_target_config [board_info $board generic_name] } - unset board; - unset board_type; + unset board + unset board_type - push_target $whole_name; + push_target $whole_name if { [info procs ${whole_name}_init] != "" } { - ${whole_name}_init $whole_name; + ${whole_name}_init $whole_name } if { ![isnative] && ![is_remote target] } { @@ -798,52 +798,52 @@ proc setup_target_hook { whole_name name } { # Clean things up afterwards. # proc cleanup_target_hook { name } { - global tool; + global tool # Clean up the target board. if { [info procs "${name}_exit"] != "" } { - ${name}_exit; + ${name}_exit } # We also call the tool exit routine here. if [info exists tool] { if { [info procs "${tool}_exit"] != "" } { - ${tool}_exit; + ${tool}_exit } } - remote_close target; - pop_target; + remote_close target + pop_target } proc setup_host_hook { name } { - global board; - global board_info; - global board_type; + global board + global board_info + global board_type - set board $name; - set board_type "host"; + set board $name + set board_type "host" - load_board_description $name; - unset board; - unset board_type; - push_host $name; + load_board_description $name + unset board + unset board_type + push_host $name if { [info proc ${name}_init] != "" } { - ${name}_init $name; + ${name}_init $name } } proc setup_build_hook { name } { - global board; - global board_info; - global board_type; + global board + global board_info + global board_type - set board $name; - set board_type "build"; + set board $name + set board_type "build" - load_board_description $name; - unset board; - unset board_type; - push_build $name; + load_board_description $name + unset board + unset board_type + push_build $name if { [info proc ${name}_init] != "" } { - ${name}_init $name; + ${name}_init $name } } @@ -871,7 +871,7 @@ if [info exists env(DEJAGNU)] { send_error "WARNING: global config file $env(DEJAGNU) not found.\n" } if ![info exists boards_dir] { - set boards_dir "[file dirname $env(DEJAGNU)]/boards"; + set boards_dir "[file dirname $env(DEJAGNU)]/boards" } } @@ -928,10 +928,10 @@ proc load_tool_init { file } { global loaded_libs if [info exists loaded_libs($file)] { - return; + return } - set loaded_libs($file) ""; + set loaded_libs($file) "" if [file exists ${srcdir}/lib/$file] { verbose "Loading library file ${srcdir}/lib/$file" @@ -960,8 +960,8 @@ load_lib targetdb.exp load_lib libgloss.exp # Initialize the test counters and reset them to 0. -init_testcounts; -reset_vars; +init_testcounts +reset_vars # # Parse the command line arguments. @@ -970,11 +970,11 @@ reset_vars; # Load the tool initialization file. Allow the --tool option to override # what's set in the site.exp file. if [info exists comm_line_tool] { - set tool $comm_line_tool; + set tool $comm_line_tool } if [info exists tool] { - load_tool_init ${tool}.exp; + load_tool_init ${tool}.exp } set argc [ llength $argv ] @@ -1038,8 +1038,8 @@ for { set i 0 } { $i < $argc } { incr i } { "--target_bo*" { # Set it again, father knows best. - set target_list $optarg; - continue; + set target_list $optarg + continue } "--ta*" { # (--target) the target configuration @@ -1157,7 +1157,7 @@ for { set i 0 } { $i < $argc } { incr i } { "--tool_ro*" { set tool_root_dir $optarg - continue; + continue } "--to*" { # (--tool) specify tool name @@ -1173,7 +1173,7 @@ for { set i 0 } { $i < $argc } { incr i } { } "--he*" { # (--help) help text - usage; + usage exit 0 } @@ -1185,7 +1185,7 @@ for { set i 0 } { $i < $argc } { incr i } { if [info exists tool] { if { [info proc ${tool}_option_proc] != "" } { if [${tool}_option_proc $option] { - continue; + continue } } } @@ -1246,43 +1246,43 @@ clone_output "\n\t\t=== $tool tests ===\n" # proc load_generic_config { name } { - global srcdir; - global configfile; - global libdir; - global env; - global board; - global board_info; - global boards_dir; - global board_type; + global srcdir + global configfile + global libdir + global env + global board + global board_info + global boards_dir + global board_type if [info exists board] { if ![info exists board_info($board,generic_name)] { - set board_info($board,generic_name) $name; + set board_info($board,generic_name) $name } } if [info exists board_type] { - set type "for $board_type"; + set type "for $board_type" } else { set type "" } - set dirlist [concat ${libdir}/config [file dirname $libdir]/config $boards_dir]; - set result [search_and_load_file "generic interface file $type" ${name}.exp $dirlist]; + set dirlist [concat ${libdir}/config [file dirname $libdir]/config $boards_dir] + set result [search_and_load_file "generic interface file $type" ${name}.exp $dirlist] - return $result; + return $result } # # Load the tool-specific target description. # proc load_config { args } { - global srcdir; - global board_type; + global srcdir + global board_type - set found 0; + set found 0 - return [search_and_load_file "tool-and-target-specific interface file" $args [list ${srcdir}/config ${srcdir}/../config ${srcdir}/../../config ${srcdir}/../../../config]]; + return [search_and_load_file "tool-and-target-specific interface file" $args [list ${srcdir}/config ${srcdir}/../config ${srcdir}/../../config ${srcdir}/../../../config]] } # @@ -1304,7 +1304,7 @@ proc load_config { args } { proc load_tool_target_config { name } { global target_os libdir srcdir - set found [load_config "${name}.exp" "${target_os}.exp" "default.exp" "unknown.exp"]; + set found [load_config "${name}.exp" "${target_os}.exp" "default.exp" "unknown.exp"] if { $found == 0 } { send_error "WARNING: Couldn't find tool config file for $name, using default.\n" @@ -1322,67 +1322,67 @@ proc load_tool_target_config { name } { # proc load_board_description { board_name args } { - global srcdir; - global configfile; - global libdir; - global env; - global board; + global srcdir + global configfile + global libdir + global env + global board global board_info - global boards_dir; - global board_type; + global boards_dir + global board_type set dejagnu "" if { [llength $args] > 0 } { - set whole_name [lindex $args 0]; + set whole_name [lindex $args 0] } else { - set whole_name $board_name; + set whole_name $board_name } - set board_info($whole_name,name) $whole_name; + set board_info($whole_name,name) $whole_name if ![info exists board] { - set board $whole_name; - set board_set 1; + set board $whole_name + set board_set 1 } else { - set board_set 0; + set board_set 0 } - set dirlist {}; + set dirlist {} if { [llength $args] > 1 } { - set suffix [lindex $args 1]; + set suffix [lindex $args 1] if { ${suffix} != "" } { foreach x ${boards_dir} { lappend dirlist ${x}/${suffix} } - lappend dirlist ${libdir}/baseboards/${suffix}; + lappend dirlist ${libdir}/baseboards/${suffix} } } - set dirlist [concat $dirlist $boards_dir]; - lappend dirlist ${libdir}/baseboards; + set dirlist [concat $dirlist $boards_dir] + lappend dirlist ${libdir}/baseboards verbose "dirlist is $dirlist" if [info exists board_type] { - set type "for $board_type"; + set type "for $board_type" } else { - set type ""; + set type "" } if ![info exists board_info($whole_name,isremote)] { - set board_info($whole_name,isremote) 1; + set board_info($whole_name,isremote) 1 if [info exists board_type] { if { $board_type == "build" } { - set board_info($whole_name,isremote) 0; + set board_info($whole_name,isremote) 0 } } if { ${board_name} == [get_local_hostname] } { - set board_info($whole_name,isremote) 0; + set board_info($whole_name,isremote) 0 } } - search_and_load_file "standard board description file $type" standard.exp $dirlist; - set found [search_and_load_file "board description file $type" ${board_name}.exp $dirlist]; + search_and_load_file "standard board description file $type" standard.exp $dirlist + set found [search_and_load_file "board description file $type" ${board_name}.exp $dirlist] if { $board_set != 0 } { - unset board; + unset board } - return $found; + return $found } # @@ -1391,43 +1391,43 @@ proc load_board_description { board_name args } { # proc load_base_board_description { board_name } { - global srcdir; - global configfile; - global libdir; - global env; - global board; + global srcdir + global configfile + global libdir + global env + global board global board_info - global board_type; + global board_type - set board_set 0; - set board_info($board_name,name) $board_name; + set board_set 0 + set board_info($board_name,name) $board_name if ![info exists board] { - set board $board_name; - set board_set 1; + set board $board_name + set board_set 1 } if [info exists board_type] { - set type "for $board_type"; + set type "for $board_type" } else { set type "" - }; + } if ![info exists board_info($board_name,isremote)] { - set board_info($board_name,isremote) 1; + set board_info($board_name,isremote) 1 if [info exists board_type] { if { $board_type == "build" } { - set board_info($board_name,isremote) 0; + set board_info($board_name,isremote) 0 } } } if { ${board_name} == [get_local_hostname] } { - set board_info($board_name,isremote) 0; + set board_info($board_name,isremote) 0 } - set found [search_and_load_file "board description file $type" ${board_name}.exp ${libdir}/baseboards]; + set found [search_and_load_file "board description file $type" ${board_name}.exp ${libdir}/baseboards] if { $board_set != 0 } { - unset board; + unset board } - return $found; + return $found } # @@ -1448,11 +1448,11 @@ proc runtest { test_file_name } { set test_result "" if [file exists $test_file_name] { - set timestart [timestamp]; + set timestart [timestamp] if [info exists tool] { if { [info procs "${tool}_init"] != "" } { - ${tool}_init $test_file_name; + ${tool}_init $test_file_name } } @@ -1477,11 +1477,11 @@ proc runtest { test_file_name } { if [info exists tool] { if { [info procs "${tool}_finish"] != "" } { - ${tool}_finish; + ${tool}_finish } } - set timeend [timestamp]; - set timediff [expr $timeend - $timestart]; + set timeend [timestamp] + set timediff [expr $timeend - $timestart] verbose -log "testcase $test_file_name completed in $timediff seconds" 4 } else { # This should never happen, but maybe if the file got removed @@ -1505,50 +1505,50 @@ if ![exp_debug] { {SIGINT {interrupted by user}} \ {SIGQUIT {interrupted by user}} \ {SIGSEGV {segmentation violation}}" { - set signal [lindex $sig 0]; - set str [lindex $sig 1]; - trap "send_error \"got a \[trap -name\] signal, $str \\n\"; log_and_exit;" $signal; + set signal [lindex $sig 0] + set str [lindex $sig 1] + trap "send_error \"got a \[trap -name\] signal, $str \\n\"; log_and_exit;" $signal verbose "setting trap for $signal to $str" 1 } - unset signal str sig; + unset signal str sig } # # Given a list of targets, process any iterative lists. # proc process_target_variants { target_list } { - set result {}; + set result {} foreach x $target_list { if [regexp "\\(" $x] { - regsub "^.*\\((\[^()\]*)\\)$" "$x" "\\1" variant_list; - regsub "\\(\[^(\]*$" "$x" "" x; - set list [process_target_variants $x]; + regsub "^.*\\((\[^()\]*)\\)$" "$x" "\\1" variant_list + regsub "\\(\[^(\]*$" "$x" "" x + set list [process_target_variants $x] set result {} foreach x $list { - set result [concat $result [iterate_target_variants $x [split $variant_list ","]]]; + set result [concat $result [iterate_target_variants $x [split $variant_list ","]]] } } elseif [regexp "\{" $x] { - regsub "^.*\{(\[^\{\}\]*)\}$" "$x" "\\1" variant_list; - regsub "\{\[^\{\]*$" "$x" "" x; - set list [process_target_variants $x]; + regsub "^.*\{(\[^\{\}\]*)\}$" "$x" "\\1" variant_list + regsub "\{\[^\{\]*$" "$x" "" x + set list [process_target_variants $x] foreach x $list { foreach i [split $variant_list ","] { - set name $x; + set name $x if { $i != "" } { - append name "/" $i; + append name "/" $i } - lappend result $name; + lappend result $name } } } else { - lappend result "$x"; + lappend result "$x" } } - return $result; + return $result } proc iterate_target_variants { target variants } { - return [iterate_target_variants_two $target $target $variants]; + return [iterate_target_variants_two $target $target $variants] } # @@ -1557,34 +1557,34 @@ proc iterate_target_variants { target variants } { proc iterate_target_variants_two { orig_target target variants } { if { [llength $variants] == 0 } { - return [list $target]; + return [list $target] } else { if { [llength $variants] > 1 } { - set result [iterate_target_variants_two $orig_target $target [lrange $variants 1 end]]; + set result [iterate_target_variants_two $orig_target $target [lrange $variants 1 end]] } else { if { $target != $orig_target } { - set result [list $target]; + set result [list $target] } else { - set result {}; + set result {} } } if { [lindex $variants 0] != "" } { - append target "/" [lindex $variants 0]; - return [concat $result [iterate_target_variants_two $orig_target $target [lrange $variants 1 end]]]; + append target "/" [lindex $variants 0] + return [concat $result [iterate_target_variants_two $orig_target $target [lrange $variants 1 end]]] } else { - return [concat $result $target]; + return [concat $result $target] } } } -setup_build_hook [get_local_hostname]; +setup_build_hook [get_local_hostname] if [info exists host_board] { - setup_host_hook $host_board; + setup_host_hook $host_board } else { - set hb [get_local_hostname]; + set hb [get_local_hostname] if { $hb != "" } { - setup_host_hook $hb; + setup_host_hook $hb } } @@ -1609,9 +1609,9 @@ if ![info exists target_list] { # # Iterate through the list of targets. # -global current_target; +global current_target -set target_list [process_target_variants $target_list]; +set target_list [process_target_variants $target_list] set target_count [llength $target_list] @@ -1623,17 +1623,17 @@ clone_output "" foreach current_target $target_list { - verbose "target is $current_target"; - set current_target_name $current_target; - set tlist [split $current_target /]; - set current_target [lindex $tlist 0]; - set board_variant_list [lrange $tlist 1 end]; + verbose "target is $current_target" + set current_target_name $current_target + set tlist [split $current_target /] + set current_target [lindex $tlist 0] + set board_variant_list [lrange $tlist 1 end] # Set the counts for this target to 0. - reset_vars; + reset_vars clone_output "Running target $current_target_name" - setup_target_hook $current_target_name $current_target; + setup_target_hook $current_target_name $current_target # If multiple passes requested, set them up. Otherwise prepare just one. # The format of `MULTIPASS' is a list of elements containing @@ -1665,7 +1665,7 @@ foreach current_target $target_list { set multipass_name [lindex $multipass_elem 0] if {$p == $multipass_name} { lappend passes $multipass_elem - break; + break } } } @@ -1709,7 +1709,7 @@ foreach current_target $target_list { # DejaGNU's notion of test tree and test files is very # general: # given ${srcdir} and ${tool}, any subdirectory (at any - # level deep) with the "${tool}" prefix starts a test tree; + # level deep) with the "${tool}" prefix starts a test tree # given a test tree, any *.exp file underneath (at any # level deep) is a test file. # @@ -1749,13 +1749,13 @@ foreach current_target $target_list { set test_top_dirs ${temp_top_dirs} } verbose "Top level testsuite dirs are ${test_top_dirs}" 2 - set testlist ""; + set testlist "" if [info exists all_runtests] { foreach x [array names all_runtests] { verbose "trying to glob ${srcdir}/${x}" 2 - set s [glob -nocomplain ${srcdir}/$x]; + set s [glob -nocomplain ${srcdir}/$x] if { $s != "" } { - set testlist [concat $testlist $s]; + set testlist [concat $testlist $s] } } } @@ -1779,14 +1779,14 @@ foreach current_target $target_list { incr p -1 } if {[string range $subdir 0 $p] == $srcdir} { - set subdir [string range $subdir [expr $p+1] end]; + set subdir [string range $subdir [expr $p+1] end] regsub "^/" $subdir "" subdir } # XXX not the right thing to do. set runtests [list [file tail $test_name] ""] - runtest $test_name; + runtest $test_name } } else { # @@ -1866,9 +1866,9 @@ foreach current_target $target_list { # characters? We lose. Instead... set first [string first $srcdir $subdir] if { $first >= 0 } { - set first [expr $first + [string length $srcdir]]; - set subdir [string range $subdir $first end]; - regsub "^/" "$subdir" "" subdir; + set first [expr $first + [string length $srcdir]] + set subdir [string range $subdir $first end] + regsub "^/" "$subdir" "" subdir } if { "$srcdir" == "$subdir" || "$srcdir" == "$subdir/" } { set subdir "" @@ -1887,26 +1887,26 @@ foreach current_target $target_list { } else { set runtests [list [file tail $test_name] ""] } - runtest $test_name; + runtest $test_name } } } # Restore the variables set by this pass. foreach varval $restore { if { [llength $varval] > 1 } { - verbose "Restoring [lindex $varval 0] to [lindex $varval 1]" 4; - set [lindex $varval 0] [lindex $varval 1]; + verbose "Restoring [lindex $varval 0] to [lindex $varval 1]" 4 + set [lindex $varval 0] [lindex $varval 1] } else { - verbose "Restoring [lindex $varval 0] to `unset'" 4; - unset [lindex $varval 0]; + verbose "Restoring [lindex $varval 0] to `unset'" 4 + unset [lindex $varval 0] } } } } - cleanup_target_hook $current_target; + cleanup_target_hook $current_target if { $target_count > 1 } { - log_summary; + log_summary } } -log_and_exit; +log_and_exit -- cgit v1.1