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]

another monitor.exp change



Here's another simple patch to monitor.exp which allows me to run the
testsuites on a very slow remote target. I have to work with a fixed baud
rate serial line which is overrun by the download packets, so I added
gdb_download_size which if defined will be used to set download-write-size.
Also, this hardware is slooow. It takes ~50 minutes to download a 40KB
application. So, I added a gdb_load_timeout to override the default 26 minute
timeout on loads.

--Mark


gdb/testsuite/ChangeLog:

 2001-03-15  Mark Salter  <msalter@redhat.com>

    * config/monitor.exp (gdb_load): Add support for additional
    target_info: gdb_download_size and gdb_load_timeout.


Index: gdb/testsuite/config/monitor.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/config/monitor.exp,v
retrieving revision 1.4
diff -u -p -5 -r1.4 monitor.exp
--- gdb/testsuite/config/monitor.exp	2001/03/15 18:51:25	1.4
+++ gdb/testsuite/config/monitor.exp	2001/03/15 20:21:22
@@ -138,10 +138,21 @@ proc gdb_load { arg } {
     global GDB
     global gdb_prompt
     global timeout
     global last_gdb_file;
 
+    if [target_info exists gdb_download_size] {
+	send_gdb "set download-write-size [target_info gdb_download_size]\n";
+	gdb_expect 30 {
+	    -re "$gdb_prompt $" { }
+	    default {
+		perror "Setting download-write-size for target failed";
+		return -1;
+	    }
+	}
+    }
+
     if { $arg == "" } {
 	if [info exists last_gdb_file] {
 	    set arg $last_gdb_file;
 	} else {
 	    send_gdb "info files\n";
@@ -219,12 +230,18 @@ proc gdb_load { arg } {
 	    if [target_info exists gdb_load_offset] {
 		set command "load $farg [target_info gdb_load_offset]\n";
 	    } else {
 		set command "load $farg\n";
 	    }
+	    if [target_info exists gdb_load_timeout] {
+		set loadtimeout [target_info gdb_load_timeout]
+	    } else {
+		set loadtimeout 1600
+	    }
+
 	    send_gdb $command;
-	    gdb_expect 1600 {
+	    gdb_expect $loadtimeout {
 		-re "\[Ff\]ailed.*$gdb_prompt $" {
 		    verbose "load failed";
 		}
 		-re "Timeout reading from remote.*$gdb_prompt" {
 		}


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