aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Manson <manson@cygnus>1997-06-18 05:10:11 +0000
committerBob Manson <manson@cygnus>1997-06-18 05:10:11 +0000
commit66e38fb28258e39e62219b23c4593c868e537aa1 (patch)
tree369575ee5fde458822c2a23781bcdf6fce952e45
parent3c4e3186a427c9cb9bfe4994d01ba2e317df81e5 (diff)
downloadgdb-66e38fb28258e39e62219b23c4593c868e537aa1.zip
gdb-66e38fb28258e39e62219b23c4593c868e537aa1.tar.gz
gdb-66e38fb28258e39e62219b23c4593c868e537aa1.tar.bz2
lib/gdb.exp(gdb_expect): Handle getting a value for $timeout
more gracefully.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/lib/gdb.exp19
2 files changed, 14 insertions, 10 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 09c26a3..f310718 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,7 +1,8 @@
Tue Jun 17 13:10:10 1997 Bob Manson <manson@charmed.cygnus.com>
- * lib/gdb.exp(gdb_expect): Declare errorInfo and errorCode
- as global variables.
+ * lib/gdb.exp(gdb_expect): Declare errorInfo and errorCode as
+ global variables. Handle getting a value for $timeout more
+ gracefully.
Sat Jun 14 09:23:26 1997 Bob Manson <manson@charmed.cygnus.com>
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 385695f..0530f6e 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -859,22 +859,25 @@ proc gdb_expect { args } {
upvar timeout timeout
if [target_info exists gdb,timeout] {
if [info exists timeout] {
- set oldt $timeout;
if { $timeout < [target_info gdb,timeout] } {
- set timeout [target_info gdb,timeout];
+ set gtimeout [target_info gdb,timeout];
+ } else {
+ set gtimeout $timeout;
}
} else {
- set timeout [target_info gdb,timeout];
+ set gtimeout [target_info gdb,timeout];
}
}
- set code [catch {uplevel remote_expect host $timeout $args} string];
- if [target_info exists gdb,timeout] {
- if [info exists oldt] {
- set timeout $oldt
+ if ![info exists gtimeout] {
+ global timeout;
+ if [info exists timeout] {
+ set gtimeout $timeout;
} else {
- unset timeout
+ # Eeeeew.
+ set gtimeout 60;
}
}
+ set code [catch {uplevel remote_expect host $gtimeout $args} string];
if {$code == 1} {
global errorInfo errorCode;