* [PATCH] gdbserver_spawn "" rather than gdbserver_spawn ${binfile}
@ 2016-08-22 14:57 Yao Qi
2016-08-22 17:55 ` Pedro Alves
2016-08-22 18:12 ` Simon Marchi
0 siblings, 2 replies; 5+ messages in thread
From: Yao Qi @ 2016-08-22 14:57 UTC (permalink / raw)
To: gdb-patches
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-22 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.
---
gdb/testsuite/gdb.server/connect-stopped-target.exp | 2 +-
gdb/testsuite/gdb.server/connect-without-multi-process.exp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.server/connect-stopped-target.exp b/gdb/testsuite/gdb.server/connect-stopped-target.exp
index b083d89..9e445b0 100644
--- a/gdb/testsuite/gdb.server/connect-stopped-target.exp
+++ b/gdb/testsuite/gdb.server/connect-stopped-target.exp
@@ -44,7 +44,7 @@ proc do_test {nonstop} {
gdb_test "set non-stop $nonstop"
- set res [gdbserver_spawn ${binfile}]
+ set res [gdbserver_spawn ""]
set gdbserver_protocol [lindex $res 0]
set gdbserver_gdbport [lindex $res 1]
diff --git a/gdb/testsuite/gdb.server/connect-without-multi-process.exp b/gdb/testsuite/gdb.server/connect-without-multi-process.exp
index 79d7d72..2e9769b 100644
--- a/gdb/testsuite/gdb.server/connect-without-multi-process.exp
+++ b/gdb/testsuite/gdb.server/connect-without-multi-process.exp
@@ -41,7 +41,7 @@ proc do_test {multiprocess} {
gdb_test_no_output "set remote multiprocess-feature $multiprocess"
- set res [gdbserver_spawn ${binfile}]
+ set res [gdbserver_spawn ""]
set gdbserver_protocol [lindex $res 0]
set gdbserver_gdbport [lindex $res 1]
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdbserver_spawn "" rather than gdbserver_spawn ${binfile}
2016-08-22 14:57 [PATCH] gdbserver_spawn "" rather than gdbserver_spawn ${binfile} Yao Qi
@ 2016-08-22 17:55 ` Pedro Alves
2016-08-23 13:25 ` Yao Qi
2016-08-22 18:12 ` Simon Marchi
1 sibling, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2016-08-22 17:55 UTC (permalink / raw)
To: Yao Qi, gdb-patches
On 08/22/2016 03:57 PM, Yao Qi wrote:
> 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}.
>
Whoops.
> gdb/testsuite:
>
> 2016-08-22 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.
OK.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdbserver_spawn "" rather than gdbserver_spawn ${binfile}
2016-08-22 14:57 [PATCH] gdbserver_spawn "" rather than gdbserver_spawn ${binfile} Yao Qi
2016-08-22 17:55 ` Pedro Alves
@ 2016-08-22 18:12 ` Simon Marchi
2016-08-23 13:28 ` Yao Qi
1 sibling, 1 reply; 5+ messages in thread
From: Simon Marchi @ 2016-08-22 18:12 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
On 2016-08-22 10:57, Yao Qi wrote:
> --- a/gdb/testsuite/gdb.server/connect-stopped-target.exp
> +++ b/gdb/testsuite/gdb.server/connect-stopped-target.exp
> @@ -44,7 +44,7 @@ proc do_test {nonstop} {
>
> gdb_test "set non-stop $nonstop"
>
> - set res [gdbserver_spawn ${binfile}]
> + set res [gdbserver_spawn ""]
You could make gdbserver_spawn have a default empty argument, so you
don't have to keep the empty string here.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdbserver_spawn "" rather than gdbserver_spawn ${binfile}
2016-08-22 17:55 ` Pedro Alves
@ 2016-08-23 13:25 ` Yao Qi
0 siblings, 0 replies; 5+ messages in thread
From: Yao Qi @ 2016-08-23 13:25 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
On Mon, Aug 22, 2016 at 6:55 PM, Pedro Alves <palves@redhat.com> wrote:
>
>> gdb/testsuite:
>>
>> 2016-08-22 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.
>
> OK.
>
Patch is pushed into master.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdbserver_spawn "" rather than gdbserver_spawn ${binfile}
2016-08-22 18:12 ` Simon Marchi
@ 2016-08-23 13:28 ` Yao Qi
0 siblings, 0 replies; 5+ messages in thread
From: Yao Qi @ 2016-08-23 13:28 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb-patches
On Mon, Aug 22, 2016 at 7:12 PM, Simon Marchi <simon.marchi@polymtl.ca> wrote:
> On 2016-08-22 10:57, Yao Qi wrote:
>>
>> --- a/gdb/testsuite/gdb.server/connect-stopped-target.exp
>> +++ b/gdb/testsuite/gdb.server/connect-stopped-target.exp
>> @@ -44,7 +44,7 @@ proc do_test {nonstop} {
>>
>> gdb_test "set non-stop $nonstop"
>>
>> - set res [gdbserver_spawn ${binfile}]
>> + set res [gdbserver_spawn ""]
>
>
> You could make gdbserver_spawn have a default empty argument, so you don't
> have to keep the empty string here.
Yes, this can be a separate fix. I don't have cycles to fix it
recently, so patch
is welcome :)
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-23 13:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-22 14:57 [PATCH] gdbserver_spawn "" rather than gdbserver_spawn ${binfile} Yao Qi
2016-08-22 17:55 ` Pedro Alves
2016-08-23 13:25 ` Yao Qi
2016-08-22 18:12 ` Simon Marchi
2016-08-23 13:28 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox