Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* mi test fix for remote targets
@ 2003-01-17 21:29 Mark Salter
  2003-01-17 22:04 ` Daniel Jacobowitz
  2003-01-31  5:47 ` Andrew Cagney
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Salter @ 2003-01-17 21:29 UTC (permalink / raw)
  To: gdb-patches

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


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

end of thread, other threads:[~2003-01-31  5:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-17 21:29 mi test fix for remote targets Mark Salter
2003-01-17 22:04 ` Daniel Jacobowitz
2003-01-31  5:47 ` Andrew Cagney

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