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

* Re: mi test fix for remote targets
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2003-01-17 22:04 UTC (permalink / raw)
  To: Mark Salter; +Cc: gdb-patches

On Fri, Jan 17, 2003 at 04:29:41PM -0500, Mark Salter wrote:
> I used the following tweak to get the mi tests to run on a
> remote target (RedBoot).

Not all remote targets want you to use "load"... this is yet another MI
change which wouldn't work with gdbserver.

Then again, gdbserver needs to override this entire function anyway,
the process of starting a remote server is completely different.  I'll
revise/resend that patch soon, really...

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: mi test fix for remote targets
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cagney @ 2003-01-31  5:47 UTC (permalink / raw)
  To: Mark Salter; +Cc: gdb-patches

> 2003-01-17  Mark Salter  <msalter@redhat.com>
> 
> 	* lib/mi-support.exp (mi_gdb_load): Support remote targets.
> 	Support empty arg.
> 

Yes, ok.

Andrew



^ 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