This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
mi test fix for remote targets
- From: Mark Salter <msalter at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 17 Jan 2003 16:29:41 -0500 (EST)
- Subject: mi test fix for remote targets
I used the following tweak to get the mi tests to run on a
remote target (RedBoot).
--Mark
2003-01-17 Mark Salter <msalter@redhat.com>
* lib/mi-support.exp (mi_gdb_load): Support remote targets.
Support empty arg.
Index: testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.20
diff -u -p -5 -r1.20 mi-support.exp
--- testsuite/lib/mi-support.exp 16 Dec 2002 20:03:17 -0000 1.20
+++ testsuite/lib/mi-support.exp 17 Jan 2003 21:24:54 -0000
@@ -289,12 +289,19 @@ proc mi_gdb_load { arg } {
global verbose
global loadpath
global loadfile
global GDB
global mi_gdb_prompt
+ global last_mi_gdb_file
upvar timeout timeout
+ if { $arg == "" } {
+ set arg $last_mi_gdb_file;
+ }
+
+ set last_mi_gdb_file $arg;
+
# ``gdb_unload''
# ``gdb_file_cmd''
# FIXME: Several of these patterns are only acceptable for console
# output. Queries are an error for mi.
@@ -383,10 +390,30 @@ proc mi_gdb_load { arg } {
gdb_expect 10 {
-re "48\\^done.*$mi_gdb_prompt$" {
}
timeout {
perror "Unable to download to sim target"
+ return -1
+ }
+ }
+ } elseif { [target_info gdb_protocol] == "remote" } {
+ # remote targets
+ send_gdb "target [target_info gdb_protocol] [target_info netport]\n"
+ gdb_expect 60 {
+ -re "\\^done,.*$mi_gdb_prompt$" {
+ }
+ timeout {
+ perror "Unable to connect to remote target"
+ return -1
+ }
+ }
+ send_gdb "48-target-download\n"
+ gdb_expect 10 {
+ -re "48\\^done.*$mi_gdb_prompt$" {
+ }
+ timeout {
+ perror "Unable to download to remote target"
return -1
}
}
}
return 0