From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Cc: toolchain-devel@blackfin.uclinux.org, Jie Zhang <jie.zhang@analog.com>
Subject: [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout for remote targets
Date: Sun, 05 Jun 2011 21:34:00 -0000 [thread overview]
Message-ID: <1307309678-10966-1-git-send-email-vapier@gentoo.org> (raw)
From: Jie Zhang <jie.zhang@analog.com>
Rather than relying on the default remotetimeout value (which might be too
small for some slower devices), use the existing gdb_load_timeout config
option to set it.
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
gdb/testsuite/config/monitor.exp | 47 +++++++++++++++++++++++++++++++++++++-
1 files changed, 46 insertions(+), 1 deletions(-)
diff --git a/gdb/testsuite/config/monitor.exp b/gdb/testsuite/config/monitor.exp
index be98f1a..9efaf39 100644
--- a/gdb/testsuite/config/monitor.exp
+++ b/gdb/testsuite/config/monitor.exp
@@ -138,6 +138,7 @@ proc gdb_load { arg } {
global gdb_prompt
global timeout
global last_gdb_file;
+ global decimal
if { $arg == "" } {
if [info exists last_gdb_file] {
@@ -226,6 +227,32 @@ proc gdb_load { arg } {
set loadtimeout 1600
}
+ if [is_remote target] {
+ send_gdb "show remotetimeout\n"
+ gdb_expect {
+ -re "Timeout limit to wait for target to respond is ($decimal).*$gdb_prompt $" {
+ set oldremotetimeout $expect_out(1,string);
+ }
+ timeout {
+ if { $verbose > 1 } {
+ perror "Timed out trying to get remotetimeout."
+ }
+ }
+ }
+ send_gdb "set remotetimeout $loadtimeout\n";
+ gdb_expect {
+ -re "$gdb_prompt $" {
+ verbose "Set remotetimeout to $loadtimeout\n"
+ }
+ timeout {
+ if { $verbose > 1 } {
+ perror "Timed out trying to set remotetimeout."
+ }
+ }
+ }
+ }
+
+ set load_ok 0
send_gdb $command;
gdb_expect $loadtimeout {
-re "\[Ff\]ailed.*$gdb_prompt $" {
@@ -235,7 +262,7 @@ proc gdb_load { arg } {
}
-re "$gdb_prompt $" {
verbose "Loaded $farg into $GDB\n"
- return 0;
+ set load_ok 1
}
timeout {
if { $verbose > 1 } {
@@ -243,6 +270,24 @@ proc gdb_load { arg } {
}
}
}
+
+ if [is_remote target] {
+ send_gdb "set remotetimeout $oldremotetimeout\n";
+ gdb_expect {
+ -re "$gdb_prompt $" {
+ verbose "Set remotetimeout to $oldremotetimeout\n"
+ }
+ timeout {
+ if { $verbose > 1 } {
+ perror "Timed out trying to set remotetimeout."
+ }
+ }
+ }
+ }
+
+ if { $load_ok == 1 } {
+ return 0;
+ }
}
# Make sure we don't have an open connection to the target.
--
1.7.5.3
next reply other threads:[~2011-06-05 21:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-05 21:34 Mike Frysinger [this message]
2011-06-18 22:31 ` Mike Frysinger
2011-06-19 19:04 ` [PATCH v2] gdb: tests: " Mike Frysinger
2011-06-29 16:25 ` Joel Brobecker
2011-06-29 17:29 ` Jie Zhang
2011-06-30 8:59 ` Pedro Alves
2011-06-30 13:30 ` [toolchain-devel] " Mike Frysinger
2011-06-30 13:48 ` Pedro Alves
2011-06-29 23:25 ` [PATCH v3] " Mike Frysinger
2011-06-30 22:54 ` Joel Brobecker
2011-07-01 0:19 ` Mike Frysinger
-- strict thread matches above, loose matches on Subject: below --
2010-03-14 22:01 [PATCH] gdb: tests/monitor: " Mike Frysinger
2010-03-15 0:42 ` Joel Brobecker
2010-03-15 3:56 ` Jie Zhang
2010-03-15 1:52 ` Jie Zhang
2010-03-15 7:16 ` Mike Frysinger
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=1307309678-10966-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
--cc=jie.zhang@analog.com \
--cc=toolchain-devel@blackfin.uclinux.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