From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47916 invoked by alias); 18 Oct 2018 20:27:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 47902 invoked by uid 89); 18 Oct 2018 20:27:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=pipe, pty X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Oct 2018 20:27:26 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2470D308403E; Thu, 18 Oct 2018 20:27:25 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED39567649; Thu, 18 Oct 2018 20:27:24 +0000 (UTC) From: Sergio Durigan Junior To: John Darrington Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/4] GDB: Fix documentation for invoking GDBSERVER References: <20181013175801.2670-1-john@darrington.wattle.id.au> <20181013175801.2670-3-john@darrington.wattle.id.au> Date: Thu, 18 Oct 2018 20:27:00 -0000 In-Reply-To: <20181013175801.2670-3-john@darrington.wattle.id.au> (John Darrington's message of "Sat, 13 Oct 2018 19:58:00 +0200") Message-ID: <871s8nxaoj.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00403.txt.bz2 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/