From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20998 invoked by alias); 4 Feb 2010 17:43:09 -0000 Received: (qmail 20989 invoked by uid 22791); 4 Feb 2010 17:43:08 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Feb 2010 17:43:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id F41FC2BAB4A for ; Thu, 4 Feb 2010 12:43:02 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wBEeWD738mU4 for ; Thu, 4 Feb 2010 12:43:02 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6AAA22BAB3F for ; Thu, 4 Feb 2010 12:43:02 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 501AAF59A2; Thu, 4 Feb 2010 21:42:54 +0400 (RET) Date: Thu, 04 Feb 2010 17:43:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [RFA/testsuite] Reset the timeout duration at the start of each testcase. Message-ID: <20100204174254.GC2715@adacore.com> References: <20100129153726.GC30542@caradoc.them.org> <1265263706-22569-1-git-send-email-brobecker@adacore.com> <20100204155956.GA14962@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100204155956.GA14962@caradoc.them.org> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-02/txt/msg00125.txt.bz2 > > Joel> gdb/testsuite/ChangeLog: > > Joel> * lib/gdb.exp (default_test_timeout): New global variable. > > Joel> Set it to timeout if not already set. > > Joel> (gdb_init): Reset the value of timeout to default_test_timeout. > > > > Joel> OK to apply? > > > > FWIW, it seems reasonable to me. > > Ditto. This will even work with existing board files that "set timeout". I haven't looked when the board files are evaluated, so I'm missing the point. I am wondering if this has an effect on the following: Just something that occured to me: What if I changed the implementation to just store $timeout at the time gdb.exp is evaluated. From the user's perspective, the difference is that he would need to override the value of $timeout, which is an already-known variable, instead of setting the value of the new default_test_timeout variable. Would that be ugly? This isn't tested (it's getting late here), but this is what I have in mind: # The default timeout used when testing GDB commands. We want to use # the same timeout as the default dejagnu timeout, unless the user has # already overridden it with a new value (probably through a site.exp # file). Either way, $timeout if the timeout value we should use. global default_test_timeout set default_test_timeout $timeout proc gdb_init { args } { # Reset the timeout value to the default. This way, any testcase # that changes the timeout value without resetting it cannot affect # the timeout used in subsequent testcases. global default_test_timeout global timeout set timeout $default_test_timeout I can test this if you like this approach better. Otherwise, I'll commit the first patch tomorrow. -- Joel