Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: John Darrington <john@darrington.wattle.id.au>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/4] GDB: Fix documentation for invoking GDBSERVER
Date: Thu, 18 Oct 2018 20:27:00 -0000	[thread overview]
Message-ID: <871s8nxaoj.fsf@redhat.com> (raw)
In-Reply-To: <20181013175801.2670-3-john@darrington.wattle.id.au> (John	Darrington's message of "Sat, 13 Oct 2018 19:58:00 +0200")

On Saturday, October 13 2018, John Darrington wrote:

> The documentation did not mention the possibility of invoking gdbserver
> with the new connection forms such as tcp6:host:port.  This change fixes
> that.

Thanks for the patch.

As I mentioned while reviewing patch #1, there is a reason why gdbserver
doesn't accept prefixes (which means that there isn't a mistake in the
docs).  If you go with my suggestion and implement just the support for
the "unix:" prefix, then this patch will need to be changed because it
still won't be correct to mention the "tcp" prefixes.

> gdb/doc/
>
>   * gdb.texinfo (Server): Tabulate the various permitted forms of the @var{comm}
>    metasyntactical variable.  Include the unix:@var{host}:@var{socket} form as
>    one of them.
> ---
>  gdb/doc/gdb.texinfo | 60 +++++++++++++++++++++++++++++++++++++++--------------
>  1 file changed, 44 insertions(+), 16 deletions(-)
>
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 1e97d692b6..e3b62221cf 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -21097,9 +21097,19 @@ syntax is:
>  target> gdbserver @var{comm} @var{program} [ @var{args} @dots{} ]
>  @end smallexample
>  
> -@var{comm} is either a device name (to use a serial line), or a TCP
> -hostname and portnumber, or @code{-} or @code{stdio} to use
> -stdin/stdout of @code{gdbserver}.
> +@code{gdbserver} waits passively for the host @value{GDBN} to communicate
> +with it.
> +
> +@var{comm} may take several forms:
> +
> +@table @code
> +@item @code{@var{device}}
> +A serial line device.
> +
> +@item @code{-}
> +@itemx @code{stdio}
> +To use the stdin/stdout of @code{gdbserver}.
> +
>  For example, to debug Emacs with the argument
>  @samp{foo.txt} and communicate with @value{GDBN} over the serial port
>  @file{/dev/com1}:
> @@ -21108,8 +21118,27 @@ For example, to debug Emacs with the argument
>  target> gdbserver /dev/com1 emacs foo.txt
>  @end smallexample
>  
> -@code{gdbserver} waits passively for the host @value{GDBN} to communicate
> -with it.
> +The @code{stdio} connection is useful when starting @code{gdbserver}
> +with ssh:
> +
> +@smallexample
> +(gdb) target remote | ssh -T hostname gdbserver - hello
> +@end smallexample
> +
> +The @samp{-T} option to ssh is provided because we don't need a remote pty,
> +and we don't want escape-character handling.  Ssh does this by default when
> +a command is provided, the flag is provided to make it explicit.
> +You could elide it if you want to.
> +
> +Programs started with stdio-connected gdbserver have @file{/dev/null} for
> +@code{stdin}, and @code{stdout},@code{stderr} are sent back to gdb for
> +display through a pipe connected to gdbserver.
> +Both @code{stdout} and @code{stderr} use the same pipe.
> +
> +@item @code{@var{host}:@var{port}}
> +@itemx @code{tcp:@var{host}:@var{port}}
> +@itemx @code{tcp4:@var{host}:@var{port}}
> +To use a @acronym{TCP} @acronym{IPv4} socket connection on port number @var{port}.
>  
>  To use a TCP connection instead of a serial line:
>  
> @@ -21129,22 +21158,21 @@ conflicts with another service, @code{gdbserver} prints an error message
>  and exits.}  You must use the same port number with the host @value{GDBN}
>  @code{target remote} command.
>  
> -The @code{stdio} connection is useful when starting @code{gdbserver}
> -with ssh:
> +
> +@item @code{tcp6:@var{host}:@var{port}}
> +To use a @acronym{TCP} @acronym{IPv6} socket connection on port number @var{port}.
> +
> +@item @code{unix:@var{host}:@var{local-socket}}
> +To use a Unix domain socket.  This will create a socket with the file
> +system entry @var{local-socket} and listen on that.  For example:
>  
>  @smallexample
> -(gdb) target remote | ssh -T hostname gdbserver - hello
> +target> gdbserver unix:localhost:/tmp/gdb-socket0 emacs foo.txt
>  @end smallexample
>  
> -The @samp{-T} option to ssh is provided because we don't need a remote pty,
> -and we don't want escape-character handling.  Ssh does this by default when
> -a command is provided, the flag is provided to make it explicit.
> -You could elide it if you want to.
> +@var{host} must either be the null string or the literal string @code{localhost}.
> +@end table
>  
> -Programs started with stdio-connected gdbserver have @file{/dev/null} for
> -@code{stdin}, and @code{stdout},@code{stderr} are sent back to gdb for
> -display through a pipe connected to gdbserver.
> -Both @code{stdout} and @code{stderr} use the same pipe.
>  
>  @anchor{Attaching to a program}
>  @subsubsection Attaching to a Running Program
> -- 
> 2.11.0

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


  parent reply	other threads:[~2018-10-18 20:27 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09 17:33 Gdbserver can listen on local domain sockets John Darrington
2018-10-09 17:33 ` [PATCH] GDBSERVER: Listen on a unix domain (instead of TCP) socket if requested John Darrington
2018-10-09 17:56   ` Eli Zaretskii
2018-10-09 18:02   ` Pedro Alves
2018-10-09 18:41     ` John Darrington
2018-10-09 18:53       ` Pedro Alves
2018-10-09 19:00         ` John Darrington
2018-10-09 19:06           ` Pedro Alves
2018-10-13 17:58     ` [PATCH 1/4] " John Darrington
2018-10-13 17:58       ` [PATCH 3/4] GDB: Fix documentation for invoking GDBSERVER John Darrington
2018-10-13 18:10         ` Eli Zaretskii
2018-10-18 20:27         ` Sergio Durigan Junior [this message]
2018-10-19  7:05           ` John Darrington
2018-10-19 20:45             ` Sergio Durigan Junior
2018-10-21  7:33               ` John Darrington
2018-10-21 16:47                 ` Sergio Durigan Junior
2018-10-23 18:25               ` John Darrington
2018-10-23 18:58                 ` Sergio Durigan Junior
2018-10-13 17:58       ` [PATCH 4/4] GDB: Remote target can now accept the form unix::/path/to/socket John Darrington
2018-10-13 17:58       ` [PATCH 2/4] GDB: Document the unix::/path/to/socket of remote connection John Darrington
2018-10-13 18:11         ` Eli Zaretskii
2018-10-15  9:31         ` Simon Tatham
2018-10-18 20:21         ` Sergio Durigan Junior
2018-10-13 18:12       ` [PATCH 1/4] GDBSERVER: Listen on a unix domain (instead of TCP) socket if requested Eli Zaretskii
2018-10-18 20:18       ` Sergio Durigan Junior
2018-10-19 18:55         ` John Darrington
2018-10-19 19:43           ` Sergio Durigan Junior
2018-10-28 16:20             ` Simon Marchi
2018-10-28 18:10               ` John Darrington
2018-10-28 18:51                 ` Simon Marchi
2018-10-29  8:24                   ` John Darrington
2018-10-29  9:13                     ` Rainer Orth
2018-10-29  9:38                       ` Rainer Orth
     [not found]                       ` <4da7206f-6e6a-7aad-634e-a4485d99e988@ericsson.com>
     [not found]                         ` <20181029162513.oztznqp74gudrqgm@jocasta.intra>
2018-10-29 16:42                           ` Sergio Durigan Junior
2018-10-29 17:34                             ` John Darrington
2018-10-31 13:54                               ` Simon Marchi
2018-10-29 18:32                             ` Simon Marchi

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=871s8nxaoj.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=john@darrington.wattle.id.au \
    /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