Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* testsuite: Of all the timeouts provided always select the largest
@ 2008-02-26 15:55 Maciej W. Rozycki
  2008-02-26 16:02 ` Jim Blandy
  2008-02-26 16:10 ` Daniel Jacobowitz
  0 siblings, 2 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2008-02-26 15:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Maciej W. Rozycki

Hello,

 Some targets require long time to perform certain operations.  An example 
is a hardware board (i.e. non-simulated one) driven through a serial 
interface of some kind or the target itself may be slow.  Board 
description files can provide their own timeout setting, overriding 
defaults, like the global one or the tool-specific one.  Unfortunately 
this does not apply to explicit timeouts used with gdb_expect here and 
there.  I have seen cases of test suite failures resulting from that.

 To rectify I have modified gdb_expect so that one timeout can never lower 
any other one.  A patch follows.  No regressions with the 
mipsisa32-sde-elf target using the mips-sim-sde32/-EB/-march=mips32r2 
board.  It fixes several timeouts seen with the mips-fs2-sdelib board in 
some configurations though.

2008-02-25  Maciej W. Rozycki  <macro@mips.com>

	* lib/gdb.exp (gdb_expect): Of all the timeouts provided always
	select the largest.

 OK to apply?

  Maciej

14614.diff
Index: gdb/src/gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb.orig/src/gdb/testsuite/lib/gdb.exp	2007-02-13 16:40:36.000000000 +0000
+++ gdb/src/gdb/testsuite/lib/gdb.exp	2007-02-13 16:40:45.000000000 +0000
@@ -1697,34 +1697,44 @@
 
 proc gdb_expect { args } {
     if { [llength $args] == 2  && [lindex $args 0] != "-re" } {
-	set gtimeout [lindex $args 0];
+	set atimeout [lindex $args 0];
 	set expcode [list [lindex $args 1]];
     } else {
-	upvar timeout timeout;
-
 	set expcode $args;
-	if [target_info exists gdb,timeout] {
-	    if [info exists timeout] {
-		if { $timeout < [target_info gdb,timeout] } {
-		    set gtimeout [target_info gdb,timeout];
-		} else {
-		    set gtimeout $timeout;
-		}
-	    } else {
+    }
+
+    upvar timeout timeout;
+
+    if [target_info exists gdb,timeout] {
+	if [info exists timeout] {
+	    if { $timeout < [target_info gdb,timeout] } {
 		set gtimeout [target_info gdb,timeout];
+	    } else {
+		set gtimeout $timeout;
 	    }
+	} else {
+	    set gtimeout [target_info gdb,timeout];
 	}
+    }
 
+    if ![info exists gtimeout] {
+	global timeout;
+	if [info exists timeout] {
+	    set gtimeout $timeout;
+	}
+    }
+
+    if [info exists atimeout] {
+	if { ![info exists gtimeout] || $gtimeout < $atimeout } {
+	    set $gtimeout $atimeout;
+	}
+    } else {
 	if ![info exists gtimeout] {
-	    global timeout;
-	    if [info exists timeout] {
-		set gtimeout $timeout;
-	    } else {
-		# Eeeeew.
-		set gtimeout 60;
-	    }
+	    # Eeeeew.
+	    set gtimeout 60;
 	}
     }
+
     global suppress_flag;
     global remote_suppress_flag;
     if [info exists remote_suppress_flag] {


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-02-27 15:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-26 15:55 testsuite: Of all the timeouts provided always select the largest Maciej W. Rozycki
2008-02-26 16:02 ` Jim Blandy
2008-02-26 16:17   ` Maciej W. Rozycki
2008-02-26 16:39     ` Jim Blandy
2008-02-27 15:43       ` Maciej W. Rozycki
2008-02-27 15:45         ` Daniel Jacobowitz
2008-02-26 16:10 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox