This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfa] Clarify remote protocol RLE example
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb-patches at sourceware dot org, ukleinek at informatik dot uni-freiburg dot de
- Date: Sat, 03 Nov 2007 21:01:21 +0200
- Subject: Re: [rfa] Clarify remote protocol RLE example
- References: <20071103161956.GA7885@caradoc.them.org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Sat, 3 Nov 2007 12:19:56 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, ukleinek@informatik.uni-freiburg.de
Sorry for the previous unfinished message: hit SEND by mistake.
> Uwe pointed out that the example in the GDB manual for run-length
> encoding is a bit confusing. It suggests that "0* " should expand
> to 000, but in fact it expands to 0000, because the initial zero
> is counted separately.
>
> Is this version clearer? OK to commit?
Well, I still needed to read the text 2 or 3 times before I understood
what it tries to say.
How about this version instead:
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. The repeat count is
itself sent encoded, to avoid binary characters in @var{data}: a
value of @var{n} is sent as @code{@var{n}+29}. For a repeat count
greater or equal to 3, this produces a printable @sc{ascii}
character, e.g.@: a space (@sc{ascii} code 32) for a repeat count of
3. (This is because run-length encoding starts to win for counts 3
or more.) Thus, for example, @samp{0* } is a run-length encoding of
"0000": the space character after @samp{*} means repeat the leading
@code{0} @w{@code{32 - 29 = 3}} more times.
> 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?