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]

RFC: Fix basicclass.exp for sim targets


This is an RFC because it also involves correcting basic-sim.exp in DejaGNU;
so I want to get opinions before I do that.

The problem is that you can't rerun a binary on the simulator, in our test
harness.  We don't have anything that can issue the necessary "load"
command.  We have a matching hook for remote stubs and gdbserver, however:
gdb,do_reload_on_run.

This patch teaches the sim target about this, and supports it for non-remote
targets.  Comments?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-08-28  Daniel Jacobowitz  <drow@mvista.com>

	* config/sim.exp (gdb_load): Handle $arg == "".
	* lib/gdb.exp (gdb_run_cmd): Honor gdb,do_reload_on_run.
	* gdb.objc/basicclass.exp: Use gdb_run_cmd.

Index: testsuite/config/sim.exp
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/config/sim.exp,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 sim.exp
--- testsuite/config/sim.exp	16 Apr 1999 01:34:29 -0000	1.1.1.1
+++ testsuite/config/sim.exp	28 Aug 2003 19:31:52 -0000
@@ -55,7 +55,9 @@ proc gdb_load { arg } {
     global GDB
     global gdb_prompt
 
-    if [gdb_file_cmd $arg] then { return -1 }
+    if { $arg != "" } {
+	if [gdb_file_cmd $arg] then { return -1 }
+    }
 
     gdb_target_sim
 
Index: testsuite/gdb.objc/basicclass.exp
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/gdb.objc/basicclass.exp,v
retrieving revision 1.3
diff -u -p -r1.3 basicclass.exp
--- testsuite/gdb.objc/basicclass.exp	6 Jul 2003 22:27:34 -0000	1.3
+++ testsuite/gdb.objc/basicclass.exp	28 Aug 2003 19:30:43 -0000
@@ -125,13 +125,9 @@ gdb_test continue \
 #
 # Test resetting breakpoints when re-running program
 #
-send_gdb "run\n"
+gdb_run_cmd
 gdb_expect {
-    -re "The program .* has been started already.*y or n. $" {
-        send_gdb "y\n"
-        exp_continue
-    }
-    -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:.*$gdb_prompt $"\
+    -re "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:.*$gdb_prompt $"\
                             { pass "resetting breakpoints when rerunning" }
     -re ".*$gdb_prompt $"       { fail "resetting breakpoints when rerunning" }
     timeout                 { fail "resetting breakpoints when rerunning" }
Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.37
diff -u -p -r1.37 gdb.exp
--- testsuite/lib/gdb.exp	1 May 2003 01:09:51 -0000	1.37
+++ testsuite/lib/gdb.exp	28 Aug 2003 19:32:50 -0000
@@ -248,6 +248,12 @@ proc gdb_run_cmd {args} {
 	}
 	return
     }
+
+    if [target_info exists gdb,do_reload_on_run] {
+	if { [gdb_load ""] < 0 } {
+	    return;
+	}
+    }
     send_gdb "run $args\n"
 # This doesn't work quite right yet.
     gdb_expect 60 {


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