Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Dmitry Antipov <dantipov@nvidia.com>
Cc: GDB Development <gdb@sourceware.org>
Subject: Re: Testing with remote gdbserver
Date: Thu, 08 Feb 2018 16:31:00 -0000	[thread overview]
Message-ID: <f8452f453e95a5a6e8a4539f166c8619@polymtl.ca> (raw)
In-Reply-To: <1d63145a1dba01bce9608c232d459a0c@polymtl.ca>

On 2018-02-08 11:28, Simon Marchi wrote:
> The remote-stdio-gdbserver.exp board should work, but be aware of this
> issue that was reported recently:
> 
>   https://sourceware.org/ml/gdb/2018-01/msg00023.html
> 
> I just tried it and stumbled on another bug, if you are using
> gdb/gdbserver 8.1.  You might get something like this in gdb.log:
> 
> (gdb) target remote | /usr/bin/ssh simark@s.thetu.bz
> /usr/bin/gdbserver --once stdio jump
> Remote debugging using | /usr/bin/ssh simark@s.thetu.bz
> /usr/bin/gdbserver --once stdio jump
> stdin/stdout redirected
> zsh:1: command not found: jump
> During startup program exited with code 127.
> 
> This is likely caused by the fact that gdbserver now starts (by
> default) the inferior process through a shell.  If you run "gdbserver
> ... jump", it will try to run the "jump" command through the shell,
> which is not found because it's not in the path.  I worked around it
> by doing this simple change:
> 
> diff --git a/gdb/testsuite/boards/remote-stdio-gdbserver.exp
> b/gdb/testsuite/boards/remote-stdio-gdbserver.exp
> index aff7902..3e01d1b 100644
> --- a/gdb/testsuite/boards/remote-stdio-gdbserver.exp
> +++ b/gdb/testsuite/boards/remote-stdio-gdbserver.exp
> @@ -70,7 +70,7 @@ proc get_remote_login { } {
>  proc get_target_remote_pipe_cmd { } {
>      set target_exec [gdbserver_download_current_prog]
>      set rsh_cmd "[board_info [target_info name] rsh_prog] 
> [get_remote_login]"
> -    return "$rsh_cmd /usr/bin/gdbserver --once stdio $target_exec"
> +    return "$rsh_cmd /usr/bin/gdbserver --once stdio ./$target_exec"
>  }
> 
>  proc ${board}_file { dest op args } {
> 
> 
> With this I'm able to test using a remote gdbserver between two x86
> machines (though note that it uses the gdbserver on the target
> machine, the testsuite doesn't upload it itself).
> 
> Simon

For reference, here's the command line I used (replace example.com with 
the appropriate hostname/ip, of course):

make check TESTS="gdb.base/jump.exp" 
RUNTESTFLAGS="--target_board=remote-stdio-gdbserver 
REMOTE_USERNAME=simark REMOTE_HOSTNAME=example.com"

Simon


      reply	other threads:[~2018-02-08 16:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 14:29 Dmitry Antipov
2018-02-08 15:50 ` Yao Qi
2018-02-08 16:28 ` Simon Marchi
2018-02-08 16:31   ` Simon Marchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8452f453e95a5a6e8a4539f166c8619@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=dantipov@nvidia.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox