diff options
author | Michael Snyder <msnyder@specifix.com> | 2000-11-14 22:19:02 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@specifix.com> | 2000-11-14 22:19:02 +0000 |
commit | 5597f6eac3d5daeeb0d9393f0169503993d16f4d (patch) | |
tree | cf17ab763bfd89fe332a5b30b50b3ea8d223dc48 /gdb/testsuite/config/monitor.exp | |
parent | 21448313ab84029be1e553821930afa2c0d69dc3 (diff) | |
download | gdb-5597f6eac3d5daeeb0d9393f0169503993d16f4d.tar.gz |
2000-11-03 Michael Snyder <msnyder@cleaver.cygnus.com>
* config/monitor.exp (gdb_target_cmd): Abstracts some of the
code from gdb_target_monitor, so it can be used independantly
for gdbserver. Also comment out an unnecessary PUTS.
Diffstat (limited to 'gdb/testsuite/config/monitor.exp')
-rw-r--r-- | gdb/testsuite/config/monitor.exp | 97 |
1 files changed, 55 insertions, 42 deletions
diff --git a/gdb/testsuite/config/monitor.exp b/gdb/testsuite/config/monitor.exp index b4824807ef0..0b94ad326b7 100644 --- a/gdb/testsuite/config/monitor.exp +++ b/gdb/testsuite/config/monitor.exp @@ -16,7 +16,60 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. load_lib gdb.exp -puts "***** DID USE MONITOR ******" +# puts "***** DID USE MONITOR ******" + +# +# gdb_target_cmd +# Send gdb the "target" command +# +proc gdb_target_cmd { targetname serialport } { + global gdb_prompt + + for {set i 1} {$i <= 3} {incr i} { + send_gdb "target $targetname $serialport\n" + gdb_expect 60 { + -re "A program is being debugged already.*ill it.*y or n. $" { + send_gdb "y\n"; + exp_continue; + } + -re "Couldn't establish connection to remote.*$gdb_prompt" { + verbose "Connection failed"; + } + -re "Remote MIPS debugging.*$gdb_prompt" { + verbose "Set target to $targetname"; + return 0; + } + -re "Remote debugging using .*$serialport.*$gdb_prompt" { + verbose "Set target to $targetname"; + return 0; + } + -re "Remote target $targetname connected to.*$gdb_prompt" { + verbose "Set target to $targetname"; + return 0; + } + -re "Connected to.*$gdb_prompt" { + verbose "Set target to $targetname"; + return 0; + } + -re "Ending remote.*$gdb_prompt" { } + -re "Connection refused.*$gdb_prompt" { + verbose "Connection refused by remote target. Pausing, and trying again." + sleep 30 + continue + } + -re "Timeout reading from remote system.*$gdb_prompt" { + verbose "Got timeout error from gdb."; + } + timeout { + send_gdb ""; + break + } + } + } +} + + + # # gdb_target_monitor # Set gdb to target the monitor @@ -55,47 +108,7 @@ proc gdb_target_monitor { exec_file } { for {set j 1} {$j <= 2} {incr j} { if [gdb_file_cmd $exec_file] { return -1; } - for {set i 1} {$i <= 3} {incr i} { - send_gdb "target $targetname $serialport\n" - gdb_expect 60 { - -re "A program is being debugged already.*ill it.*y or n. $" { - send_gdb "y\n"; - exp_continue; - } - -re "Couldn't establish connection to remote.*$gdb_prompt" { - verbose "Connection failed"; - } - -re "Remote MIPS debugging.*$gdb_prompt" { - verbose "Set target to $targetname"; - return 0; - } - -re "Remote debugging using .*$serialport.*$gdb_prompt" { - verbose "Set target to $targetname"; - return 0; - } - -re "Remote target $targetname connected to.*$gdb_prompt" { - verbose "Set target to $targetname"; - return 0; - } - -re "Connected to.*$gdb_prompt" { - verbose "Set target to $targetname"; - return 0; - } - -re "Ending remote.*$gdb_prompt" { } - -re "Connection refused.*$gdb_prompt" { - verbose "Connection refused by remote target. Pausing, and trying again." - sleep 30 - continue - } - -re "Timeout reading from remote system.*$gdb_prompt" { - verbose "Got timeout error from gdb."; - } - timeout { - send_gdb ""; - break - } - } - } + gdb_target_cmd $targetname $serialport; gdb_target_exec; |