This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/mi-testsuite] Re: MI and remote debugging


On Thu, Feb 21, 2002 at 12:35:47AM -0500, Daniel Jacobowitz wrote:
> On Wed, Feb 13, 2002 at 01:41:13AM -0500, Daniel Jacobowitz wrote:
> > On Wed, Feb 13, 2002 at 01:26:04AM -0500, Andrew Cagney wrote:
> > > >Any remote config (like gdbserver, or even monitor, I think...) that
> > > >overrides gdb_target_cmd/gdb_file_cmd loses because of the static mi 
> > > >version
> > > >in mi-support.exp.  This leads to almost a day's worth of timeouts.  I've
> > > >tried to cobble together a gdbserver version of mi_gdb_file_cmd and an
> > > >mi-aware mi_gdb_target_cmd; I can't do it.
> > > >
> > > >Andrew, any thoughts?
> > > 
> > > For targets other than ``target remote'' I don't think we need to be too 
> > > concerned.  However, ``target remote'' variants should work.  I know it 
> > > works for SID (a remote simulator).
> > > 
> > > Can you expand a little.
> > 
> > For target remote it does not necessarily work.  Look at
> > config/gdbserver.exp to see what you need to do to spawn a gdbserver on
> > load; mi overrides that function entirely.  The comment
> > "# ``gdb_file_cmd''" in mi_gdb_file_cmd appears to be as close as we
> > come to thinking about this.
> 
> Well, since no one else had any helpful comments, I eventually sat down
> and fixed this :)  I still get some timeouts running the MI testsuite,
> but they appear to be somewhat legitimate.  GDB crashes trying to do
> some varobj tests for the remote target (mi-var-cmd.exp, while stepping
> at do_locals_tests).

Fixed, after some discussion with Keith.  There's a real varobj problem
here; it allocates symbols on the objfile obstack, so when I reloaded
the executably from gdb_load we crashed.  He and I are talking about
that off-list.  I just eliminated the spurious loads for now.

This patch tests MI with no problems.  There's a timeout in
mi-console.exp, which surprises me not at all, and some watchpoint
failures, which also surprise me not at all.  Otherwise it looks great.

OK?


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2002-02-20  Daniel Jacobowitz  <drow@mvista.com>

	* config/gdbserver.exp: Clear $use_default_mi_gdb_load.
	(gdbserver_gdb_load): Renamed from gdb_load.  Add MI support.
	Do not rerun gdb_file_cmd if $arg is "".
	(gdb_load): New function.
	(mi_gdb_load): New function.
	* config/monitor.exp (mi_gdb_target_cmd): New function.
	* lib/gdb.exp: Always load mi-support.exp.
	* lib/mi-support.exp (mi_gdb_file_cmd): New function, broken
	out from mi_gdb_load.
	(mi_gdb_load): Call mi_gdb_file_cmd.
	(mi_run_cmd): Expect an MI style result from 000-exec-continue.

	* mi-basics.exp: Remove load of mi-support.exp.
	* mi-break.exp: Likewise.
	* mi-console.exp: Likewise.
	* mi-disassemble.exp: Likewise.
	* mi-eval.exp: Likewise.
	* mi-hack-cli.exp: Likewise.
	* mi-read-memory.exp: Likewise.
	* mi-regs.exp: Likewise.
	* mi-return.exp: Likewise.
	* mi-simplerun.exp: Likewise.
	* mi-stack.exp: Likewise.
	* mi-stepi.exp: Likewise.
	* mi-until.exp: Likewise.
	* mi-var-block.exp: Likewise.
	* mi-var-child.exp: Likewise.
	* mi-var-cmd.exp: Likewise.
	* mi-var-display.exp: Likewise.
	* mi-watch.exp: Likewise.
	* mi0-basics.exp: Likewise.
	* mi0-break.exp: Likewise.
	* mi0-console.exp: Likewise.
	* mi0-disassemble.exp: Likewise.
	* mi0-eval.exp: Likewise.
	* mi0-hack-cli.exp: Likewise.
	* mi0-read-memory.exp: Likewise.
	* mi0-regs.exp: Likewise.
	* mi0-return.exp: Likewise.
	* mi0-simplerun.exp: Likewise.
	* mi0-stack.exp: Likewise.
	* mi0-stepi.exp: Likewise.
	* mi0-until.exp: Likewise.
	* mi0-var-block.exp: Likewise.
	* mi0-var-child.exp: Likewise.
	* mi0-var-cmd.exp: Likewise.
	* mi0-var-display.exp: Likewise.
	* mi0-watch.exp: Likewise.

Index: testsuite/config/gdbserver.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/config/gdbserver.exp,v
retrieving revision 1.4
diff -u -p -r1.4 gdbserver.exp
--- gdbserver.exp	2001/05/10 19:33:13	1.4
+++ gdbserver.exp	2002/02/21 16:24:29
@@ -89,11 +89,12 @@ global server_exec;
 global portnum;
 set portnum "2345";
 
-proc gdb_load { args } {
+proc gdbserver_gdb_load { mi arg } {
     global server_exec;
     global portnum;
     global verbose;
     global gdb_prompt;
+    global mi_gdb_prompt;
 
     # Port id -- either specified in baseboard file, or managed here.
     if [target_info exists gdb,socketport] {
@@ -133,28 +134,45 @@ proc gdb_load { args } {
     # Export the host:port pair.
     set gdbport $debughost$portnum;
 
-    if { $args == "" || $args == "{}" } {
-	if [info exists server_exec] {
-	    set args $server_exec;
-	} else {
+
+    # remember new exec file 
+    if { $arg == "" } {
+	if { ! [info exists server_exec] } {
 	    send_gdb "info files\n";
-	    gdb_expect 30 {
-		-re "Symbols from \"(\[^\"\]+)\"" {
-		    set args $expect_out(1,string);
-		    exp_continue;
-		}
-		-re "Local exec file:\[\r\n\]+\[ \t\]*`(\[^'\]+)'," {
-		    set args $expect_out(1,string);
-		    exp_continue;
+	    if { $mi == 0 } {
+		gdb_expect 30 {
+		    -re "Symbols from \"(\[^\"\]+)\"" {
+			set server_exec $expect_out(1,string);
+			exp_continue;
+		    }
+		    -re "Local exec file:\[\r\n\]+\[ \t\]*`(\[^'\]+)'," {
+			set server_exec $expect_out(1,string);
+			exp_continue;
+		    }
+		    -re "$gdb_prompt $" { }
 		}
-		-re "$gdb_prompt $" { }
+	    } else {
+		gdb_expect 30 {
+		    -re "~\"Symbols from \\\\\"(\[^\"\]+)\\\\\"\." {
+			set server_exec $expect_out(1,string);
+			exp_continue;
+		    }
+		    -re "~\"Local exec file:\\\\n\"\[\r\n\]+~\"\\\\t`(\[^'\]+)'," {
+			set server_exec $expect_out(1,string);
+			exp_continue;
+		    }
+		    -re "$mi_gdb_prompt$" { }
+		}
+	    }
+	    if { ! [info exists server_exec] } {
+		# None?
+		set server_exec ""
 	    }
 	}
+    } else {
+	set server_exec $arg
     }
 
-    # remember new exec file 
-    set server_exec $args;
-
     # Fire off the debug agent
     if [target_info exists gdb_server_args] {
         # This flavour of gdbserver takes as arguments those specified
@@ -167,46 +185,79 @@ proc gdb_load { args } {
         # This flavour of gdbserver takes as arguments the port information
         # and the name of the executable file to be debugged.
         remote_spawn host \
-	    "$gdbserver $sockethost$portnum $args >& /dev/null < /dev/null &" \
+	    "$gdbserver $sockethost$portnum $server_exec >& /dev/null < /dev/null &" \
 	    writeonly 
     } 
     # Give it a little time to establish
     sleep 2
 
     # tell gdb what file we are debugging
-    if [gdb_file_cmd $args] {
-	return -1;
+    if { $arg != "" } {
+	if { $mi == 0 } {
+	    if [gdb_file_cmd $arg] {
+		return -1;
+	    }
+	} else {
+	    if [mi_gdb_file_cmd $arg] {
+		return -1;
+	    }
+	}
     }
 
     # attach to the "serial port"
-    gdb_target_cmd $protocol $gdbport;
+    if { $mi == 0 } {
+	gdb_target_cmd $protocol $gdbport
+    } else {
+	mi_gdb_target_cmd $protocol $gdbport
+    }
 
     # do the real load if needed
     if [target_info exists gdb_server_do_load] {
         send_gdb "load\n"
         set timeout 2400
         verbose "Timeout is now $timeout seconds" 2
-        gdb_expect {
-            -re ".*$gdb_prompt $" {
-                if $verbose>1 then {
-                    send_user "Loaded $arg into $GDB\n"
-                }
-                set timeout 30
-                verbose "Timeout is now $timeout seconds" 2
-                return 1
-            }
-            -re "$gdb_prompt $"     {
-                if $verbose>1 then {
-                    perror "GDB couldn't load."
-                }
-            }
-            timeout {
-                if $verbose>1 then {
-                    perror "Timed out trying to load $arg."
-                }
-            }
-        }
+	if { $mi == 0 } {
+	    gdb_expect {
+		-re ".*$gdb_prompt $" {
+		    if $verbose>1 then {
+			send_user "Loaded $server_exec into $GDB\n"
+		    }
+		    set timeout 30
+		    verbose "Timeout is now $timeout seconds" 2
+		    return 1
+		}
+		timeout {
+		    if $verbose>1 then {
+			perror "Timed out trying to load $server_exec."
+		    }
+		}
+	    }
+	} else {
+	    gdb_expect {
+		-re ".*$mi_gdb_prompt$" {
+		    if $verbose>1 then {
+			send_user "Loaded $server_exec into $GDB\n"
+		    }
+		    set timeout 30
+		    verbose "Timeout is now $timeout seconds" 2
+		    return 1
+		}
+		timeout {
+		    if $verbose>1 then {
+			perror "Timed out trying to load $server_exec."
+		    }
+		}
+	    }
+	}
     }
 
     return 0;
+}
+
+proc gdb_load { arg } {
+    gdbserver_gdb_load 0 $arg
+}
+
+proc mi_gdb_load { arg } {
+    gdbserver_gdb_load 1 $arg
 }
Index: testsuite/config/monitor.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/config/monitor.exp,v
retrieving revision 1.5
diff -u -p -r1.5 monitor.exp
--- monitor.exp	2001/03/15 21:46:57	1.5
+++ monitor.exp	2002/02/21 16:24:30
@@ -71,6 +71,55 @@ proc gdb_target_cmd { targetname serialp
 }
 
 
+# Much the same, but for MI.
+proc mi_gdb_target_cmd { targetname serialport } {
+    global mi_gdb_prompt
+
+    for {set i 1} {$i <= 3} {incr i} {
+	send_gdb "target $targetname $serialport\n"
+	gdb_expect 60 {
+	    -re "Couldn't establish connection to remote.*$mi_gdb_prompt" {
+		verbose "Connection failed";
+	    }
+	    -re "Remote MIPS debugging.*$mi_gdb_prompt" {
+		verbose "Set target to $targetname";
+		return 0;
+	    }
+	    -re "Remote debugging using .*$serialport.*$mi_gdb_prompt" {
+		verbose "Set target to $targetname";
+		return 0;
+	    }
+	    -re "Remote target $targetname connected to.*$mi_gdb_prompt" {
+		verbose "Set target to $targetname";
+		return 0;
+	    }
+	    -re "Connected to.*$mi_gdb_prompt" { 
+		verbose "Set target to $targetname";
+		return 0;
+	    }
+	    -re "Ending remote.*$mi_gdb_prompt" { }
+	    -re "Connection refused.*$mi_gdb_prompt" {
+		verbose "Connection refused by remote target.  Pausing, and trying again."
+		sleep 30
+		continue
+	    }
+	    -re "Timeout reading from remote system.*$mi_gdb_prompt" {
+		verbose "Got timeout error from gdb.";
+	    }
+	    -re "\\^done,.*$mi_gdb_prompt$" {
+		verbose "Set target to $targetname"
+		return 0
+	    }
+	    timeout {
+		send_gdb "";
+		break
+	    }
+	}
+    }
+    return 1
+}
+
+
 
 #
 # gdb_target_monitor
Index: testsuite/gdb.mi/mi-basics.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-basics.exp,v
retrieving revision 1.6
diff -u -p -r1.6 mi-basics.exp
--- mi-basics.exp	2001/06/27 17:27:07	1.6
+++ mi-basics.exp	2002/02/21 16:24:30
@@ -29,7 +29,6 @@
 # but the command syntax and correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-break.exp,v
retrieving revision 1.5
diff -u -p -r1.5 mi-break.exp
--- mi-break.exp	2001/06/27 17:27:07	1.5
+++ mi-break.exp	2002/02/21 16:24:30
@@ -28,7 +28,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-console.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-console.exp,v
retrieving revision 1.7
diff -u -p -r1.7 mi-console.exp
--- mi-console.exp	2001/08/19 01:23:43	1.7
+++ mi-console.exp	2002/02/21 16:24:30
@@ -32,7 +32,6 @@
 # through GDB.  Check that we're either talking to a simulator or a
 # remote target.
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-disassemble.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-disassemble.exp,v
retrieving revision 1.10
diff -u -p -r1.10 mi-disassemble.exp
--- mi-disassemble.exp	2001/08/19 01:23:43	1.10
+++ mi-disassemble.exp	2002/02/21 16:24:30
@@ -24,7 +24,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-eval.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-eval.exp,v
retrieving revision 1.6
diff -u -p -r1.6 mi-eval.exp
--- mi-eval.exp	2001/08/19 01:23:43	1.6
+++ mi-eval.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-hack-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-hack-cli.exp,v
retrieving revision 1.5
diff -u -p -r1.5 mi-hack-cli.exp
--- mi-hack-cli.exp	2001/10/28 00:29:50	1.5
+++ mi-hack-cli.exp	2002/02/21 16:24:30
@@ -20,7 +20,6 @@
 
 # Some basic checks for the CLI.
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-read-memory.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-read-memory.exp,v
retrieving revision 1.7
diff -u -p -r1.7 mi-read-memory.exp
--- mi-read-memory.exp	2001/08/19 01:23:43	1.7
+++ mi-read-memory.exp	2002/02/21 16:24:30
@@ -29,7 +29,6 @@
 # but the command syntax and correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-regs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-regs.exp,v
retrieving revision 1.10
diff -u -p -r1.10 mi-regs.exp
--- mi-regs.exp	2002/02/05 23:58:45	1.10
+++ mi-regs.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 #
 
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-return.exp,v
retrieving revision 1.7
diff -u -p -r1.7 mi-return.exp
--- mi-return.exp	2001/08/19 01:23:43	1.7
+++ mi-return.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 # the correct output response to MI operations.  
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
retrieving revision 1.9
diff -u -p -r1.9 mi-simplerun.exp
--- mi-simplerun.exp	2001/11/11 20:11:03	1.9
+++ mi-simplerun.exp	2002/02/21 16:24:30
@@ -28,7 +28,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stack.exp,v
retrieving revision 1.8
diff -u -p -r1.8 mi-stack.exp
--- mi-stack.exp	2001/08/19 01:23:43	1.8
+++ mi-stack.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stepi.exp,v
retrieving revision 1.7
diff -u -p -r1.7 mi-stepi.exp
--- mi-stepi.exp	2001/08/19 01:23:43	1.7
+++ mi-stepi.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 # the correct output response to MI operations.  
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-until.exp,v
retrieving revision 1.7
diff -u -p -r1.7 mi-until.exp
--- mi-until.exp	2001/08/19 01:23:43	1.7
+++ mi-until.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 # the correct output response to MI operations.  
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-var-block.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-block.exp,v
retrieving revision 1.6
diff -u -p -r1.6 mi-var-block.exp
--- mi-var-block.exp	2001/08/19 01:23:43	1.6
+++ mi-var-block.exp	2002/02/21 16:24:30
@@ -23,7 +23,6 @@
 #
 
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-var-child.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-child.exp,v
retrieving revision 1.8
diff -u -p -r1.8 mi-var-child.exp
--- mi-var-child.exp	2002/02/05 23:56:45	1.8
+++ mi-var-child.exp	2002/02/21 16:24:30
@@ -23,7 +23,6 @@
 #
 
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-var-cmd.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-cmd.exp,v
retrieving revision 1.8
diff -u -p -r1.8 mi-var-cmd.exp
--- mi-var-cmd.exp	2001/11/11 20:11:03	1.8
+++ mi-var-cmd.exp	2002/02/21 16:24:30
@@ -23,7 +23,6 @@
 #
 
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v
retrieving revision 1.7
diff -u -p -r1.7 mi-var-display.exp
--- mi-var-display.exp	2001/12/19 22:57:46	1.7
+++ mi-var-display.exp	2002/02/21 16:24:30
@@ -23,7 +23,6 @@
 #
 
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.8
diff -u -p -r1.8 mi-watch.exp
--- mi-watch.exp	2001/08/19 01:23:43	1.8
+++ mi-watch.exp	2002/02/21 16:24:30
@@ -28,7 +28,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-basics.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-basics.exp,v
retrieving revision 1.3
diff -u -p -r1.3 mi0-basics.exp
--- mi0-basics.exp	2001/06/23 21:47:09	1.3
+++ mi0-basics.exp	2002/02/21 16:24:30
@@ -29,7 +29,6 @@
 # but the command syntax and correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-break.exp,v
retrieving revision 1.3
diff -u -p -r1.3 mi0-break.exp
--- mi0-break.exp	2001/06/23 21:47:09	1.3
+++ mi0-break.exp	2002/02/21 16:24:30
@@ -28,7 +28,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-console.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-console.exp,v
retrieving revision 1.5
diff -u -p -r1.5 mi0-console.exp
--- mi0-console.exp	2001/08/19 01:23:43	1.5
+++ mi0-console.exp	2002/02/21 16:24:30
@@ -32,7 +32,6 @@
 # through GDB.  Check that we're either talking to a simulator or a
 # remote target.
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-disassemble.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-disassemble.exp,v
retrieving revision 1.4
diff -u -p -r1.4 mi0-disassemble.exp
--- mi0-disassemble.exp	2001/08/19 01:23:43	1.4
+++ mi0-disassemble.exp	2002/02/21 16:24:30
@@ -24,7 +24,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-eval.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-eval.exp,v
retrieving revision 1.4
diff -u -p -r1.4 mi0-eval.exp
--- mi0-eval.exp	2001/08/19 01:23:43	1.4
+++ mi0-eval.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-hack-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-hack-cli.exp,v
retrieving revision 1.4
diff -u -p -r1.4 mi0-hack-cli.exp
--- mi0-hack-cli.exp	2001/10/28 00:29:50	1.4
+++ mi0-hack-cli.exp	2002/02/21 16:24:30
@@ -20,7 +20,6 @@
 
 # Some basic checks for the CLI.
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-read-memory.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-read-memory.exp,v
retrieving revision 1.4
diff -u -p -r1.4 mi0-read-memory.exp
--- mi0-read-memory.exp	2001/08/19 01:23:43	1.4
+++ mi0-read-memory.exp	2002/02/21 16:24:30
@@ -29,7 +29,6 @@
 # but the command syntax and correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-regs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-regs.exp,v
retrieving revision 1.5
diff -u -p -r1.5 mi0-regs.exp
--- mi0-regs.exp	2002/02/05 23:58:45	1.5
+++ mi0-regs.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 #
 
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-return.exp,v
retrieving revision 1.5
diff -u -p -r1.5 mi0-return.exp
--- mi0-return.exp	2001/08/19 01:23:43	1.5
+++ mi0-return.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 # the correct output response to MI operations.  
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-simplerun.exp,v
retrieving revision 1.6
diff -u -p -r1.6 mi0-simplerun.exp
--- mi0-simplerun.exp	2001/11/11 20:11:03	1.6
+++ mi0-simplerun.exp	2002/02/21 16:24:30
@@ -28,7 +28,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-stack.exp,v
retrieving revision 1.4
diff -u -p -r1.4 mi0-stack.exp
--- mi0-stack.exp	2001/08/19 01:23:43	1.4
+++ mi0-stack.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-stepi.exp,v
retrieving revision 1.5
diff -u -p -r1.5 mi0-stepi.exp
--- mi0-stepi.exp	2001/08/19 01:23:43	1.5
+++ mi0-stepi.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 # the correct output response to MI operations.  
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-until.exp,v
retrieving revision 1.5
diff -u -p -r1.5 mi0-until.exp
--- mi0-until.exp	2001/08/19 01:23:43	1.5
+++ mi0-until.exp	2002/02/21 16:24:30
@@ -26,7 +26,6 @@
 # the correct output response to MI operations.  
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-var-block.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-var-block.exp,v
retrieving revision 1.4
diff -u -p -r1.4 mi0-var-block.exp
--- mi0-var-block.exp	2001/08/19 01:23:43	1.4
+++ mi0-var-block.exp	2002/02/21 16:24:30
@@ -23,7 +23,6 @@
 #
 
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-var-child.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-var-child.exp,v
retrieving revision 1.5
diff -u -p -r1.5 mi0-var-child.exp
--- mi0-var-child.exp	2002/02/05 23:56:45	1.5
+++ mi0-var-child.exp	2002/02/21 16:24:30
@@ -23,7 +23,6 @@
 #
 
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-var-cmd.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-var-cmd.exp,v
retrieving revision 1.6
diff -u -p -r1.6 mi0-var-cmd.exp
--- mi0-var-cmd.exp	2001/11/11 20:11:03	1.6
+++ mi0-var-cmd.exp	2002/02/21 16:24:30
@@ -23,7 +23,6 @@
 #
 
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-var-display.exp,v
retrieving revision 1.6
diff -u -p -r1.6 mi0-var-display.exp
--- mi0-var-display.exp	2001/12/19 22:57:46	1.6
+++ mi0-var-display.exp	2002/02/21 16:24:30
@@ -23,7 +23,6 @@
 #
 
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/gdb.mi/mi0-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-watch.exp,v
retrieving revision 1.4
diff -u -p -r1.4 mi0-watch.exp
--- mi0-watch.exp	2001/08/19 01:23:43	1.4
+++ mi0-watch.exp	2002/02/21 16:24:30
@@ -28,7 +28,6 @@
 # but to verify the correct output response to MI operations.
 #
 
-load_lib mi-support.exp
 set MIFLAGS "-i=mi0"
 
 gdb_exit
Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.14
diff -u -p -r1.14 gdb.exp
--- gdb.exp	2001/10/02 19:42:10	1.14
+++ gdb.exp	2002/02/21 16:24:31
@@ -25,6 +25,7 @@
 # or by passing arguments.
 
 load_lib libgloss.exp
+load_lib mi-support.exp
 
 global GDB
 global CHILL_LIB
Index: testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.13
diff -u -p -r1.13 mi-support.exp
--- mi-support.exp	2001/11/12 19:44:28	1.13
+++ mi-support.exp	2002/02/21 16:24:31
@@ -253,10 +253,10 @@ proc mi_gdb_reinitialize_dir { subdir } 
 }
 
 #
-# load a file into the debugger.
+# load a file into the debugger (file command only).
 # return a -1 if anything goes wrong.
 #
-proc mi_gdb_load { arg } {
+proc mi_gdb_file_cmd { arg } {
     global verbose
     global loadpath
     global loadfile
@@ -264,16 +264,21 @@ proc mi_gdb_load { arg } {
     global mi_gdb_prompt
     upvar timeout timeout
 
-    # ``gdb_unload''
+    if [is_remote host] {
+	set arg [remote_download host $arg];
+	if { $arg == "" } {
+	    error "download failed"
+	    return -1;
+	}
+    }
 
-    # ``gdb_file_cmd''
 # FIXME: Several of these patterns are only acceptable for console
 # output.  Queries are an error for mi.
     send_gdb "105-file-exec-and-symbols $arg\n"
     gdb_expect 120 {
         -re "Reading symbols from.*done.*$mi_gdb_prompt$" {
             verbose "\t\tLoaded $arg into the $GDB"
-            # All OK
+            return 0
         }
         -re "has no symbol-table.*$mi_gdb_prompt$" {
             perror "$arg wasn't compiled with \"-g\""
@@ -302,14 +307,15 @@ proc mi_gdb_load { arg } {
             return -1
         }
         -re "105-file-exec-and-symbols .*\r\n105\\\^done\r\n$mi_gdb_prompt$" {
-            # We are just giving the prompt back for now
-	    # All OK
-            }
+            # We (MI) are just giving the prompt back for now, instead of giving
+	    # some acknowledgement.
+	    return 0
+	}
         timeout {
             perror "couldn't load $arg into $GDB (timed out)."
             return -1
         }
-        eof {
+	eof {
             # This is an attempt to detect a core dump, but seems not to
             # work.  Perhaps we need to match .* followed by eof, in which
             # gdb_expect does not seem to have a way to do that.
@@ -317,7 +323,24 @@ proc mi_gdb_load { arg } {
             return -1
         }
     }
-    
+}
+
+#
+# load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+proc mi_gdb_load { arg } {
+    global verbose
+    global loadpath
+    global loadfile
+    global GDB
+    global mi_gdb_prompt
+    upvar timeout timeout
+
+    # ``gdb_unload''
+
+    mi_gdb_file_cmd $arg
+
     # ``load''
     if { [info procs send_target_sid] != "" } {
 	# For SID, things get complex
@@ -580,7 +603,7 @@ proc mi_run_cmd {args} {
 	    }
 	    send_gdb "000-exec-continue\n";
 	    gdb_expect 60 {
-		-re "Continu\[^\r\n\]*\[\r\n\]" {}
+		-re "000\\^running\[\r\n\]+$mi_gdb_prompt$" {}
 		default {}
 	    }
 	    return;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]