From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15745 invoked by alias); 16 Dec 2007 20:30:49 -0000 Received: (qmail 15732 invoked by uid 22791); 16 Dec 2007 20:30:48 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 16 Dec 2007 20:30:38 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 81E2D98129; Sun, 16 Dec 2007 20:30:36 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 379A49811F; Sun, 16 Dec 2007 20:30:36 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1J408B-0008Nz-Ge; Sun, 16 Dec 2007 15:30:35 -0500 Date: Sun, 16 Dec 2007 20:33:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: gdb-patches@sourceware.org, ukleinek@informatik.uni-freiburg.de, jimb@codesourcery.com Subject: Re: [rfa] Clarify remote protocol RLE example Message-ID: <20071216203035.GD22905@caradoc.them.org> Mail-Followup-To: Eli Zaretskii , gdb-patches@sourceware.org, ukleinek@informatik.uni-freiburg.de, jimb@codesourcery.com References: <20071103161956.GA7885@caradoc.them.org> <20071103191822.GA17820@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes 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 X-SW-Source: 2007-12/txt/msg00218.txt.bz2 On Sun, Nov 04, 2007 at 06:02:44AM +0200, Eli Zaretskii wrote: > Sorry, I now realize that I misunderstood the reason why you used the > "initial character". You meant the repeated character itself, right? > > Then how about this variant: > > Run-length encoding replaces runs of identical characters with one > instance of the repeated character, followed by a @samp{*} and a > repeat count. When I put everything together, I came up with the attached patch. Is this clearer? -- Daniel Jacobowitz CodeSourcery 2007-12-16 Daniel Jacobowitz * gdb.texinfo (Overview): Clarify run-length encoding example. Remove the restriction on "+" and "-" characters. Index: gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.449 diff -u -p -r1.449 gdb.texinfo --- gdb.texinfo 15 Dec 2007 13:13:12 -0000 1.449 +++ gdb.texinfo 16 Dec 2007 20:28:44 -0000 @@ -23158,20 +23158,24 @@ must also escape @code{0x2a} (@sc{ascii} is not interpreted as the start of a run-length encoded sequence (described next). -Response @var{data} can be run-length encoded to save space. A @samp{*} -means that the next character is an @sc{ascii} encoding giving a repeat count -which stands for that many repetitions of the character preceding the -@samp{*}. The encoding is @code{n+29}, yielding a printable character -where @code{n >=3} (which is where rle starts to win). The printable -characters @samp{$}, @samp{#}, @samp{+} and @samp{-} or with a numeric -value greater than 126 should not be used. - -So: -@smallexample -"@code{0* }" -@end smallexample -@noindent -means the same as "0000". +Response @var{data} can be run-length encoded to save space. +Run-length encoding replaces runs of identical characters with one +instance of the repeated character, followed by a @samp{*} and 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{#} and @samp{$} or with a numeric value +greater than 126 must not be used. Runs of six repeats (@samp{#}) or +seven repeats (@samp{$}) can be expanded using a repeat count of only +five (@samp{"}). For example, @samp{00000000} can be encoded as +@samp{0*"00}. The error response returned for some packets includes a two character error number. That number is not well defined.