lib/gdb.exp(gdb_expect): Handle getting a value for $timeout
authorBob Manson <manson@cygnus>
Wed, 18 Jun 1997 05:10:11 +0000 (05:10 +0000)
committerBob Manson <manson@cygnus>
Wed, 18 Jun 1997 05:10:11 +0000 (05:10 +0000)
more gracefully.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index 09c26a324eeb216222256cd8231cdeb248e22315..f31071887fe6c3ed3646711101937ebc1e3e8a8a 100644 (file)
@@ -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>
 
index 385695fd38a0646b15e9fd619c390b19ffed8da4..0530f6eae32dc0af300ef265fde1d2adf952bb6a 100644 (file)
@@ -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;