public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout for remote targets
@ 2010-03-14 22:01 Mike Frysinger
  2010-03-15  0:42 ` Joel Brobecker
  2010-03-15  1:52 ` Jie Zhang
  0 siblings, 2 replies; 7+ messages in thread
From: Mike Frysinger @ 2010-03-14 22:01 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jie Zhang

From: Jie Zhang <jie@codesourcery.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@codesourcery.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
2010-03-14  Jie Zhang  <jie@codesourcery.com>

	* gdb/testsuite/config/monitor.exp (gdb_load): New decimal variable.
	Save remotetimeout setting in oldremotetimeout.  Set remotetimeout to
	$loadtimeout.  Restore when done.

 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 9a9c0d1..cd29370 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.0

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

* Re: [PATCH] gdb: tests/monitor: set remotetimeout to  gdb_load_timeout for remote targets
  2010-03-14 22:01 [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout for remote targets Mike Frysinger
@ 2010-03-15  0:42 ` Joel Brobecker
  2010-03-15  3:56   ` Jie Zhang
  2010-03-15  1:52 ` Jie Zhang
  1 sibling, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2010-03-15  0:42 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, Jie Zhang

> 	* gdb/testsuite/config/monitor.exp (gdb_load): New decimal variable.
> 	Save remotetimeout setting in oldremotetimeout.  Set remotetimeout to
> 	$loadtimeout.  Restore when done.

Do you have to use send_gdb/gdb_expect in this file, or can you use
gdb_test, or gdb_test_multiple?

Watch out for stray semicolon at the end of a few statements. Eg:

> +             send_gdb "set remotetimeout $oldremotetimeout\n";
                                                               ^^^

-- 
Joel

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

* Re: [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout  for remote targets
  2010-03-14 22:01 [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout for remote targets Mike Frysinger
  2010-03-15  0:42 ` Joel Brobecker
@ 2010-03-15  1:52 ` Jie Zhang
  2010-03-15  7:16   ` Mike Frysinger
  1 sibling, 1 reply; 7+ messages in thread
From: Jie Zhang @ 2010-03-15  1:52 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

Mike,

On 03/15/2010 06:02 AM, Mike Frysinger wrote:
> From: Jie Zhang<jie@codesourcery.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@codesourcery.com>
> Signed-off-by: Mike Frysinger<vapier@gentoo.org>
> ---
> 2010-03-14  Jie Zhang<jie@codesourcery.com>
>
> 	* gdb/testsuite/config/monitor.exp (gdb_load): New decimal variable.
> 	Save remotetimeout setting in oldremotetimeout.  Set remotetimeout to
> 	$loadtimeout.  Restore when done.
>
I think this patch is not needed for Blackfin now. I believe any 
testcase in GDB can be loaded via gnICE in seconds now.


Jie

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

* Re: [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout  for remote targets
  2010-03-15  0:42 ` Joel Brobecker
@ 2010-03-15  3:56   ` Jie Zhang
  0 siblings, 0 replies; 7+ messages in thread
From: Jie Zhang @ 2010-03-15  3:56 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Mike Frysinger, gdb-patches

On 03/15/2010 08:42 AM, Joel Brobecker wrote:
>> 	* gdb/testsuite/config/monitor.exp (gdb_load): New decimal variable.
>> 	Save remotetimeout setting in oldremotetimeout.  Set remotetimeout to
>> 	$loadtimeout.  Restore when done.
>
> Do you have to use send_gdb/gdb_expect in this file, or can you use
> gdb_test, or gdb_test_multiple?
>
> Watch out for stray semicolon at the end of a few statements. Eg:
>
>> +             send_gdb "set remotetimeout $oldremotetimeout\n";
>                                                                 ^^^
I will see if I can find some time later today to fix these. Thanks for 
review.

-- 
Jie Zhang
CodeSourcery
(650) 331-3385 x735

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

* Re: [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout for remote targets
  2010-03-15  1:52 ` Jie Zhang
@ 2010-03-15  7:16   ` Mike Frysinger
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2010-03-15  7:16 UTC (permalink / raw)
  To: Jie Zhang; +Cc: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 994 bytes --]

On Sunday 14 March 2010 21:52:11 Jie Zhang wrote:
> On 03/15/2010 06:02 AM, Mike Frysinger wrote:
> > From: Jie Zhang<jie@codesourcery.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@codesourcery.com>
> > Signed-off-by: Mike Frysinger<vapier@gentoo.org>
> > ---
> > 2010-03-14  Jie Zhang<jie@codesourcery.com>
> > 
> > 	* gdb/testsuite/config/monitor.exp (gdb_load): New decimal variable.
> > 	Save remotetimeout setting in oldremotetimeout.  Set remotetimeout to
> > 	$loadtimeout.  Restore when done.
> 
> I think this patch is not needed for Blackfin now. I believe any
> testcase in GDB can be loaded via gnICE in seconds now.

yes, your work on the gnICE/gnICE+ means the slow loading is a thing of the 
past, but i think your changes here are reasonable and address a real problem
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout for remote targets
  2011-06-05 21:34 Mike Frysinger
@ 2011-06-18 22:31 ` Mike Frysinger
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2011-06-18 22:31 UTC (permalink / raw)
  To: gdb-patches; +Cc: toolchain-devel, Jie Zhang

[-- Attachment #1: Type: Text/Plain, Size: 246 bytes --]

On Sunday, June 05, 2011 17:34:38 Mike Frysinger wrote:
> 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.

any love ?
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout for remote targets
@ 2011-06-05 21:34 Mike Frysinger
  2011-06-18 22:31 ` Mike Frysinger
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2011-06-05 21:34 UTC (permalink / raw)
  To: gdb-patches; +Cc: toolchain-devel, Jie Zhang

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

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

end of thread, other threads:[~2011-06-18 22:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-14 22:01 [PATCH] gdb: tests/monitor: set remotetimeout to gdb_load_timeout for remote targets 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
2011-06-05 21:34 Mike Frysinger
2011-06-18 22:31 ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).