From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15838 invoked by alias); 26 Feb 2008 14:36:36 -0000 Received: (qmail 15804 invoked by uid 22791); 26 Feb 2008 14:36:28 -0000 X-Spam-Check-By: sourceware.org Received: from dmz.mips-uk.com (HELO dmz.mips-uk.com) (194.74.144.194) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 26 Feb 2008 14:36:05 +0000 Received: from internal-mx1 ([192.168.192.240] helo=ukservices1.mips.com) by dmz.mips-uk.com with esmtp (Exim 3.35 #1 (Debian)) id 1JU0uY-0005RQ-00; Tue, 26 Feb 2008 14:36:02 +0000 Received: from perivale.mips.com ([192.168.192.200]) by ukservices1.mips.com with esmtp (Exim 3.36 #1 (Debian)) id 1JU0uR-0002V8-00; Tue, 26 Feb 2008 14:35:55 +0000 Received: from macro (helo=localhost) by perivale.mips.com with local-esmtp (Exim 4.63) (envelope-from ) id 1JU0uR-0003xC-6Y; Tue, 26 Feb 2008 14:35:55 +0000 Date: Tue, 26 Feb 2008 15:55:00 -0000 From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: "Maciej W. Rozycki" Subject: testsuite: Of all the timeouts provided always select the largest Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MIPS-Technologies-UK-MailScanner: Found to be clean X-MIPS-Technologies-UK-MailScanner-From: macro@mips.com Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00388.txt.bz2 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 * 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] {