diff options
author | Bob Manson <manson@cygnus> | 1997-03-06 05:30:54 +0000 |
---|---|---|
committer | Bob Manson <manson@cygnus> | 1997-03-06 05:30:54 +0000 |
commit | 2f693513f5b9a695aa0e52a2930b84840c018b8e (patch) | |
tree | 31341ba4863d04812ff65276b4216baa67ea271d /gdb/testsuite/config | |
parent | db38473ab8f77b5e315cdf871d884ec864938193 (diff) | |
download | gdb-2f693513f5b9a695aa0e52a2930b84840c018b8e.zip gdb-2f693513f5b9a695aa0e52a2930b84840c018b8e.tar.gz gdb-2f693513f5b9a695aa0e52a2930b84840c018b8e.tar.bz2 |
* config/monitor.exp(gdb_target_monitor): Add pattern for
"Ending remote" to detect errors in connecting.
* gdb.base/setshow.exp: Add .* within auto language test.
Diffstat (limited to 'gdb/testsuite/config')
-rw-r--r-- | gdb/testsuite/config/monitor.exp | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/gdb/testsuite/config/monitor.exp b/gdb/testsuite/config/monitor.exp index a2863b2..b7591e2 100644 --- a/gdb/testsuite/config/monitor.exp +++ b/gdb/testsuite/config/monitor.exp @@ -67,6 +67,7 @@ proc gdb_target_monitor { } { verbose "Set target to $targetname" return } + -re "Ending remote.*$gdb_prompt" { } -re "Connection refused.*$gdb_prompt" { verbose "Connection refused by remote target. Pausing, and trying again." sleep 30 @@ -99,32 +100,44 @@ proc gdb_load { arg } { global gdb_prompt global timeout - if { $arg != "" } { - if [gdb_file_cmd $arg] { return -1 } - } - - gdb_target_monitor - - if [is_remote host] { - # FIXME: - set arg a.out; - } + for { set j 1; } { $j <= 2 } {incr j; } { + if { $arg != "" } { + if [gdb_file_cmd $arg] { return -1 } + } + + gdb_target_monitor - verbose "Loading $arg" - send_gdb "load $arg\n" - set timeout 1000 - verbose "Timeout is now $timeout seconds" 2 - gdb_expect { - -re ".*$gdb_prompt $" { - verbose "Loaded $arg into $GDB\n" - return 1 + if [is_remote host] { + # FIXME: + set arg a.out; } - timeout { - if { $verbose > 1 } { - perror "Timed out trying to load $arg." + + verbose "Loading $arg" + send_gdb "load $arg\n" + set timeout 1000 + verbose "Timeout is now $timeout seconds" 2 + gdb_expect { + -re ".*\[Ff\]ailed.*$gdb_prompt $" { + verbose "load failed"; + } + -re ".*$gdb_prompt $" { + verbose "Loaded $arg into $GDB\n" + return 1 + } + timeout { + if { $verbose > 1 } { + perror "Timed out trying to load $arg." + } } } + gdb_test "target exec" "No exec file now." "" ".*Kill it.*y or n.*" "y" + + if { $j == 1 && ![reboot_target] } { + break; + } } + perror "Couldn't load file into GDB."; + return -1; } proc gdb_start { } { |