This is the mail archive of the gdb-patches@sourceware.org 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: [RFC] Adjust SID-specific version of gdb_load to honor empty argument


Below is the patch that I ended up committing.   This version differs
from the patch that I originally submitted in that this version removes
the call to gdb_unload.  This change was suggested by Daniel in the
`Add another "Are you sure..."...' thread.  I've tested it and it works
fine.

	* config/sid.exp (gdb_load): Add test for empty argument.  Adjust
	return value to be compatible with gdb_run_cmd in lib/gdb.exp.
	Remove call to gdb_unload.

Index: testsuite/config/sid.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/config/sid.exp,v
retrieving revision 1.9
diff -u -p -r1.9 sid.exp
--- testsuite/config/sid.exp	9 Jan 2007 17:59:08 -0000	1.9
+++ testsuite/config/sid.exp	19 Jul 2007 00:40:33 -0000
@@ -175,8 +175,10 @@ proc gdb_load { arg } {
     global gdb_prompt
     global retval
 
-    gdb_unload
-    if [gdb_file_cmd $arg] then { return -1 }
+    if { $arg != "" } {
+	if [gdb_file_cmd $arg] then { return -1 }
+    }
+
     gdb_target_sid
 
     send_gdb "load\n"
@@ -195,7 +197,7 @@ proc gdb_load { arg } {
 	    if $verbose>1 then {
 		send_user "Loaded $arg into $GDB\n"
 	    }
-	    set retval 1;
+	    set retval 0;
 	}
 	-re "$gdb_prompt $"     {
 	    if $verbose>1 then {


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