From: "Maciej W. Rozycki" <macro@mips.com>
To: gdb-patches@sourceware.org
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: testsuite: Of all the timeouts provided always select the largest
Date: Tue, 26 Feb 2008 15:55:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.61.0802251311540.28703@perivale.mips.com> (raw)
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] {
next reply other threads:[~2008-02-26 14:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-26 15:55 Maciej W. Rozycki [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.61.0802251311540.28703@perivale.mips.com \
--to=macro@mips.com \
--cc=gdb-patches@sourceware.org \
--cc=macro@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox