This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] IPv6 support for gdbserver


Hi Eli,

the first patch (formerly "gdb-cvs-IPv6-fds-plus.patch") updated.


On Mon, 09 Oct 2006 06:33:09 +0200, Eli Zaretskii wrote:
...
> > -@item target remote @code{@var{host}:@var{port}}
> > +@item  target remote @code{@var{host}:@var{port}}
> 
> This just changes whitespace; please don't.

OK.  [ Code written before I read such advice from Mark Kettenis. ]

> > +@code{tcp6:} prefix forces IPv6 network connection while @code{tcp4:} forces
> 
> Please say ``The @code{tcp6:} prefix forces IPv6 network ...''.

OK.

> > +@code{udp6:} prefix forces IPv6 network connection while @code{udp4:} forces
> 
> Same here.

OK.

> > +@var{comm} is either a device name (to use a serial line) or file descriptions
> > +numbers or a TCP hostname and portnumber.  For example, to debug Emacs with the
> 
> A better way of putting it would be
> 
>   @var{comm} is a device name (to use a serial line), a file descriptor,
>   or a TCP hostname and portnumber.

OK. [ Assumed the "hostname" part will get dropped by the second patch. ]

> > -The only difference from the previous example is the first argument,
> > -specifying that you are communicating with the host @value{GDBN} via
> > -TCP.  The @samp{host:2345} argument means that @code{gdbserver} is to
> > -expect a TCP connection from machine @samp{host} to local TCP port 2345.
> > -(Currently, the @samp{host} part is ignored.)  You can choose any number
> > -you want for the port number as long as it does not conflict with any
> > -TCP ports already in use on the target system (for example, @code{23} is
> > -reserved for @code{telnet}).@footnote{If you choose a port number that
> > -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.
> 
> Why did you drop this part?

Only its first part was dropped - till "You can choose any port number ...".

The first sentence was reformulated as it is generally more complicated command
using socat(1) and so it is not "the only difference".

The part with "@samp{host}" part has been dropped completely as it never got
implemented (the "@samp{host}" part is still being ignored nowadays) and it is
no longer implementable on top of socat(1), moreover the whole
"@samp{host:port}" syntax has been considered as obsolete by the second patch.

Patch not changed in this case.


> > +This example still debugs the same program just in this case it is specifying
> > +that you are communicating with the host @value{GDBN} via TCP.
> > +The @code{gdbserver} specific part @code{fd34} directs @code{gdbserver} to use
> > +already preopened file descriptor 3 for @value{GDBN} remote serial protocol
> > +input and file descriptor 4 for the protocol output.  As the format is
> > +@code{fd<character><character>} you cannot specify file descriptors numbers
> > +above 9.
> 
> First, please use @var{} instead of <..>, as in
> @code{fd@var{c1}@var{c2}} (I find <character> too lengthy).
> 
> And second, isn't there a better way of specifying two descriptors?  I
> find the "fdNM" method inelegant, and the limitation of a single-digit
> descriptor it requires too high a price to pay.  I hope we can come up
> with a better method.

Designed for trivia C parsing as the IPv6 support was considered too
complicated by Daniel Jacobowitz and the string parsing in C is a lot of lines.
The new syntax looks like that of socat(1):
	socat EXEC:'gdbserver fdin=3,fdout=4 emacs foo.txt',fdin=3,fdout=4 TCP-LISTEN:2345


> > +You can choose any port number you want (@code{2345} here) as long as it does
> > +not conflict with any TCP ports already in use on the target system (for
> > +example, @code{23} is reserved for @code{telnet}).@footnote{If you choose
> > +a port number that conflicts with another service, @code{socat} prints an error
> > +message and exits.}  You must use the same port number with the host
> > +@value{GDBN} @code{target remote} command.
> > +
> > +On IPv4 networks you may also run @code{gdbserver} directly, without the
> > +@code{socat} helper there (equivalent command to the example above):
> > +
> > +@smallexample
> > +target> gdbserver :2345 emacs foo.txt
> > +@end smallexample
> 
> The example (and the sentence that precedes it) should be before the
> descriptive text, otherwise the text doesn't make sense.

The first paragraph describes the line above it:
	socat EXEC:'gdbserver fdin=3,fdout=4 emacs foo.txt',fdin=3,fdout=4 TCP-LISTEN:2345

It looks weird to me to move the deprecated syntax above the first paragraph
describing the port in 2345 general (primarily for the new socat(1) syntax).

Moreover even the following paragraph starting "On some targets,
@code{gdbserver} can also attach ..." precedes its sample code below it.

Text reshuffled although the port description is still above - for the socat(1)
syntax.  Otherwise the whole text should be reorganized to keep the IPv4
"host:port" syntax as the preferred one and socat(1) syntax as the secondary
one.  For example I personally do not like the requirement to use socat(1) at
the resource-limited embedded systems running gdbserver(1) at all.


> > 	* gdb.texinfo (Using the gdbserver program): Remove "host:port".
> 
> Why?  I think back-compatibility is important.

It looks broken to me to support IPv4 without supporting IPv6, moreover if the
IPv6 functions to use are simpler.  I hope you are aware of the former full
IPv6 support posted here:
	http://sourceware.org/ml/gdb-patches/2006-09/msg00216.html


The second patch "gdb-cvs-IPv6-hostport-minus.patch" was not updated for this
one as it looks as the IPv4 legacy code is not going to be dropped even with
the socat(1) support there.



Thanks,
Jan

Attachment: gdb-cvs-IPv6-fds.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]