Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@codesourcery.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org,  ukleinek@informatik.uni-freiburg.de
Subject: Re: [rfa] Clarify remote protocol RLE example
Date: Tue, 06 Nov 2007 18:31:00 -0000	[thread overview]
Message-ID: <m3zlxrns4c.fsf@codesourcery.com> (raw)
In-Reply-To: <20071103191822.GA17820@caradoc.them.org> (Daniel Jacobowitz's message of "Sat, 3 Nov 2007 15:18:22 -0400")


Daniel Jacobowitz <drow at false.org> writes:
> On Sat, Nov 03, 2007 at 09:01:21PM +0200, Eli Zaretskii wrote:
>>  Response @var{data} can be run-length encoded to save space.
>>  Run-length encoding replaces runs of identical characters with the
>>  character @samp{*} followed by a repeat count.
>
> How about "with an initial character, the character @samp{*}, and a
> repeat count"?  With that, I quite like your version.
>
>> >  The printable
>> >  characters @samp{$}, @samp{#}, @samp{+} and @samp{-} or with a numeric
>> >  value greater than 126 should not be used.
>> 
>> This part I simply don't understand.  What does it mean ``should not
>> be used''? what should be done instead? break the string into several
>> smaller ones?
>
> May not be used (they have special syntactical meaning in the
> protocol).  So you need to stop the RLE string one character earlier,
> e.g.:
>
>   {0}		0
>   {00}		00
>   {000}		000
>   {0* }		0000
>   {0*!}		00000
>   {0*"}		000000
>   {0*"0}	0000000
>   {0*"00}	00000000
>   {0*%}		000000000
>
> Rereading this, and looking at my notes in gdbserver, I don't think
> there is any point to the restriction on + or -.  They're the protocol
> ack and nack characters, but they can already appear elsewhere in
> responses.  Jim, do you see any reason they should be forbidden?

You're obviously right that the question is, "Should + and - be
permitted in packet bodies at all", not "are they permissible RLE
length characters".

If GDB sends a packet, and the stub sends an ACK and then a packet
that contains a +, but the ACK is garbled or dropped, GDB will skip
characters until it sees the + and then take that as the ACK.  Then
GDB will wait for the response which the stub has already sent, time
out, and retransmit the request.

However, if the packet doesn't contain a +, the consequence of the
missed ACK is a timeout anyway.

If GDB mistakes a packet body character for a NACK, it could
retransmit a request that the stub has carried out.  But we already
know that the protocol has no protection against retransmission, so
this is not a new bug.

So I don't think it makes any difference whether packets contain
ACK/NACK characters.

(I hereby express my resolution never to design a protocol that sends
acknowledgements outside checksummed frames.)


  parent reply	other threads:[~2007-11-06 18:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-03 16:20 Daniel Jacobowitz
2007-11-03 18:43 ` Eli Zaretskii
2007-11-03 19:02 ` Eli Zaretskii
2007-11-03 19:18   ` Daniel Jacobowitz
2007-11-03 22:08     ` Eli Zaretskii
2007-11-04  4:03       ` Eli Zaretskii
2007-12-16 20:33         ` Daniel Jacobowitz
2007-12-16 22:57           ` Eli Zaretskii
2007-12-16 23:01             ` Daniel Jacobowitz
2007-11-06 18:31     ` Jim Blandy [this message]
2007-11-07 19:33       ` Michael Snyder

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=m3zlxrns4c.fsf@codesourcery.com \
    --to=jimb@codesourcery.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=ukleinek@informatik.uni-freiburg.de \
    /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