binutils-gdb/gdb/testsuite/gdb.server
Yao Qi e9d9abd747 gdbserver_spawn "" rather than gdbserver_spawn ${binfile}
Hi,
I happen to see gdbserver is spawned like this in gdb.log,

spawn /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/../../gdb/gdbserver/gdbserver --once :2346 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.s
erver/connect-stopped-target/connect-stopped-target /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.server/connect-stopped-target/connect-stopped-t
arget

spawn /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/../../gdb/gdbserver/gdbserver --once :2347 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.s
erver/connect-stopped-target/connect-stopped-target /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.server/connect-stopped-target/connect-stopped-t
arget

as we can see, there are two instances of connect-stopped-target or
connect-stopped-target in the command line spawning gdbserver, but
none of these gets parameters from command line.  In these two
tests, gdbserver is spawned via "gdbserver_spawn ${binfile}".  However,
the argument of gdbserver_spawn is the argument passed the child
inferior, not the program itself.

 # Start a gdbserver process running SERVER_EXEC, and connect GDB
 # to it.  CHILD_ARGS are passed to the inferior.
 #
 # Returns the target protocol and socket to connect to.

proc gdbserver_spawn { child_args } {
    set target_exec [gdbserver_download_current_prog]

GDBserver gets the program via last_loaded_file, which is set by
gdb_file_cmd.  In each test, we don't need to pass ${binfile}.

gdb/testsuite:

2016-08-23  Yao Qi  <yao.qi@linaro.org>

	* gdb.server/connect-stopped-target.exp (do_test): Pass "" to
	gdbserver_spawn.
	* gdb.server/connect-without-multi-process.exp (do_test):
	Likewise.
2016-08-23 14:24:03 +01:00
..
connect-stopped-target.c
connect-stopped-target.exp gdbserver_spawn "" rather than gdbserver_spawn ${binfile} 2016-08-23 14:24:03 +01:00
connect-with-no-symbol-file.c Test GDB connection to GDBserver with no symbol files 2016-04-13 15:22:14 -05:00
connect-with-no-symbol-file.exp Test GDB connection to GDBserver with no symbol files 2016-04-13 15:22:14 -05:00
connect-without-multi-process.c
connect-without-multi-process.exp gdbserver_spawn "" rather than gdbserver_spawn ${binfile} 2016-08-23 14:24:03 +01:00
ext-attach.c
ext-attach.exp
ext-restart.exp
ext-run.exp
ext-wrapper.exp
file-transfer.exp
no-thread-db.c
no-thread-db.exp
non-existing-program.exp
server-exec-info.exp
server-kill.c
server-kill.exp
server-mon.exp
server-run.exp
server.c
solib-list-lib.c
solib-list-main.c
solib-list.exp Fix fail in gdb.server/solib-list.exp 2016-07-21 09:15:21 +01:00
transfer.txt
wrapper.c
wrapper.exp