Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb: tests/mi-support: use gdb_load_timeout when loading
@ 2010-03-14 20:50 Mike Frysinger
  2010-03-15  0:37 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2010-03-14 20:50 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jie Zhang

From: Jie Zhang <jie@codesourcery.com>

Rather than hardcoding the timeout value, used the already existing
configuration option.

Signed-off-by: Jie Zhang <jie@codesourcery.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
2010-03-14  Jie Zhang  <jie@codesourcery.com>

	* lib/mi-support.exp (mi_gdb_target_load): Delete unused timeout var.
	Declare and use new loadtimeout variable.

 gdb/testsuite/lib/mi-support.exp |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index ec60ef9..e1dbd19 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -462,7 +462,12 @@ proc mi_gdb_target_load { } {
     global loadfile
     global GDB
     global mi_gdb_prompt
-    upvar timeout timeout
+
+    if [target_info exists gdb_load_timeout] {
+	set loadtimeout [target_info gdb_load_timeout]
+    } else {
+	set loadtimeout 1600
+    }
 
     if { [info procs gdbserver_gdb_load] != "" } {
 	mi_gdb_test "kill" ".*" ""
@@ -480,40 +485,40 @@ proc mi_gdb_target_load { } {
 	    -re ".*$mi_gdb_prompt$"
 	}
 	send_target_sid
-	gdb_expect 60 {
+	gdb_expect $loadtimeout {
 	    -re "\\^done.*$mi_gdb_prompt$" {
 	    }
 	    timeout {
-		perror "Unable to connect to SID target"
+		perror "Unable to connect to SID target (timeout)"
 		return -1
 	    }
 	}
 	send_gdb "48-target-download\n"
-	gdb_expect 10 {
+	gdb_expect $loadtimeout {
 	    -re "48\\^done.*$mi_gdb_prompt$" {
 	    }
 	    timeout {
-		perror "Unable to download to SID target"
+		perror "Unable to download to SID target (timeout)"
 		return -1
 	    }
 	}
     } elseif { [target_info protocol] == "sim" } {
 	# For the simulator, just connect to it directly.
 	send_gdb "47-target-select sim\n"
-	gdb_expect 10 {
+	gdb_expect $loadtimeout {
 	    -re "47\\^connected.*$mi_gdb_prompt$" {
 	    }
 	    timeout {
-		perror "Unable to select sim target"
+		perror "Unable to select sim target (timeout)"
 		return -1
 	    }
 	}
 	send_gdb "48-target-download\n"
-	gdb_expect 10 {
+	gdb_expect $loadtimeout {
 	    -re "48\\^done.*$mi_gdb_prompt$" {
 	    }
 	    timeout {
-		perror "Unable to download to sim target"
+		perror "Unable to download to sim target (timeout)"
 		return -1
 	    }
 	}
@@ -524,11 +529,11 @@ proc mi_gdb_target_load { } {
 	    return -1
 	}
 	send_gdb "48-target-download\n"
-	gdb_expect 10 {
+	gdb_expect $loadtimeout {
 	    -re "48\\^done.*$mi_gdb_prompt$" {
 	    }
 	    timeout {
-		perror "Unable to download to remote target"
+		perror "Unable to download to remote target (timeout)"
 		return -1
 	    }
 	}
-- 
1.7.0


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

* Re: [PATCH] gdb: tests/mi-support: use gdb_load_timeout when  loading
  2010-03-14 20:50 [PATCH] gdb: tests/mi-support: use gdb_load_timeout when loading Mike Frysinger
@ 2010-03-15  0:37 ` Joel Brobecker
  2010-03-15  3:46   ` Jie Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2010-03-15  0:37 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches, Jie Zhang

> 2010-03-14  Jie Zhang  <jie@codesourcery.com>
> 
> 	* lib/mi-support.exp (mi_gdb_target_load): Delete unused timeout var.
> 	Declare and use new loadtimeout variable.

This looks fine, it's the equivalent of what we do on the CLI side.
OK.

-- 
Joel


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

* Re: [PATCH] gdb: tests/mi-support: use gdb_load_timeout when  loading
  2010-03-15  0:37 ` Joel Brobecker
@ 2010-03-15  3:46   ` Jie Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Jie Zhang @ 2010-03-15  3:46 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Mike Frysinger, gdb-patches

On 03/15/2010 08:37 AM, Joel Brobecker wrote:
>> 2010-03-14  Jie Zhang<jie@codesourcery.com>
>>
>> 	* lib/mi-support.exp (mi_gdb_target_load): Delete unused timeout var.
>> 	Declare and use new loadtimeout variable.
>
> This looks fine, it's the equivalent of what we do on the CLI side.
> OK.
>
Thanks. I have committed it.

Mike, Thanks for submitting it.

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


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

end of thread, other threads:[~2010-03-15  3:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-14 20:50 [PATCH] gdb: tests/mi-support: use gdb_load_timeout when loading Mike Frysinger
2010-03-15  0:37 ` Joel Brobecker
2010-03-15  3:46   ` Jie Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox