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]

[patch] Rename gdbserver-support.exp:gdbserver_download


Hi.

I have a dejagnu board config file that does:

load_generic_config "gdbserver"

This is what native-gdbserver.exp does too.

This causes dejagnu to look for a function named gdbserver_download
when trying to download files to the target.
native-gdbserver.exp doesn't trip over this because it defines
${board}_download which dejagnu looks for first.
That's a bit subtle as a solution, so this patch removes the potential
collision by renaming gdb's "internal use" gdbserver_download to a different
name.

I will check it in tomorrow if there are no objections.

Tested on amd64-linux and android arm-gdb (where I tripped over this).

2010-01-07  Doug Evans  <dje@google.com>

	* lib/gdbserver-support.exp (gdbserver_download_current_prog): Rename
	from gdbserver_download.  All callers updated.

Index: gdb.server/ext-attach.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.server/ext-attach.exp,v
retrieving revision 1.5
diff -u -p -r1.5 ext-attach.exp
--- gdb.server/ext-attach.exp	1 Jan 2010 07:32:06 -0000	1.5
+++ gdb.server/ext-attach.exp	7 Jan 2010 23:39:37 -0000
@@ -42,7 +42,7 @@ gdb_start
 gdb_load $binfile
 gdb_reinitialize_dir $srcdir/$subdir
 
-set target_exec [gdbserver_download]
+set target_exec [gdbserver_download_current_prog]
 gdbserver_start_extended
 
 gdb_test "set remote exec-file $target_exec" "" "set remote exec-file"
Index: gdb.server/ext-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.server/ext-run.exp,v
retrieving revision 1.6
diff -u -p -r1.6 ext-run.exp
--- gdb.server/ext-run.exp	1 Jan 2010 07:32:06 -0000	1.6
+++ gdb.server/ext-run.exp	7 Jan 2010 23:39:37 -0000
@@ -31,12 +31,12 @@ if  { [gdb_compile "${srcdir}/${subdir}/
     return -1
 }
 
 gdb_exit
 gdb_start
 gdb_load $binfile
 gdb_reinitialize_dir $srcdir/$subdir
 
-set target_exec [gdbserver_download]
+set target_exec [gdbserver_download_current_prog]
 gdbserver_start_extended
 
 gdb_test "set remote exec-file $target_exec" "" "set remote exec-file"
Index: lib/gdbserver-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdbserver-support.exp,v
retrieving revision 1.16
diff -u -p -r1.16 gdbserver-support.exp
--- lib/gdbserver-support.exp	1 Jan 2010 07:32:07 -0000	1.16
+++ lib/gdbserver-support.exp	7 Jan 2010 23:39:37 -0000
@@ -139,8 +139,10 @@ proc skip_gdbserver_tests { } {
 
 # Download the currently loaded program to the target if necessary.
 # Return the target system filename.
+# NOTE: This was named "gdbserver_download", but that collides with the
+# dejagnu "download" API function when using load_generic_config "gdbserver".
 
-proc gdbserver_download { } {
+proc gdbserver_download_current_prog { } {
     global gdbserver_host_exec
     global gdbserver_host_mtime
     global gdbserver_server_exec
@@ -266,7 +268,7 @@ proc gdbserver_start { options arguments
 # Returns the target protocol and socket to connect to.
 
 proc gdbserver_spawn { child_args } {
-    set target_exec [gdbserver_download]
+    set target_exec [gdbserver_download_current_prog]
 
     # Fire off the debug agent.  This flavour of gdbserver takes as
     # arguments the port information, the name of the executable file to


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