From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10100 invoked by alias); 21 Jan 2014 03:24:35 -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 10089 invoked by uid 89); 21 Jan 2014 03:24:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=AWL,BAYES_00,GARBLED_BODY autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2014 03:24:33 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1W5Rwz-0005mP-AN from Yao_Qi@mentor.com ; Mon, 20 Jan 2014 19:24:29 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 20 Jan 2014 19:24:29 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Mon, 20 Jan 2014 19:23:17 -0800 Message-ID: <52DDE7ED.20302@codesourcery.com> Date: Tue, 21 Jan 2014 03:24:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Tom Tromey CC: Subject: Re: [RFC 2/9] move some rsp bits into rsp-low.h References: <1390245501-1186-1-git-send-email-tromey@redhat.com> <1390245501-1186-3-git-send-email-tromey@redhat.com> In-Reply-To: <1390245501-1186-3-git-send-email-tromey@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00803.txt.bz2 On 01/21/2014 03:18 AM, Tom Tromey wrote: > Note that the two variants of remote_escape_output disagreed on the > treatment of "*". On the theory that quoting cannot hurt but the > absence possibly can, I chose the gdbserver variant to be the > canonical one. Right, we must escape "*", because "Responses sent by the stub must also escape 0x2a (ascii ‘*’), so that it is not interpreted as the start of a run-length encoded sequence (described next).", said in https://sourceware.org/gdb/current/onlinedocs/gdb/Overview.html > + > +/* Convert BUFFER, escaped data LEN bytes long, into binary data > + in OUT_BUF. Return the number of bytes written to OUT_BUF. > + Raise an error if the total number of bytes exceeds OUT_MAXLEN. > + > + This function reverses remote_escape_output. It allows more > + escaped characters than that function does, in particular because I know these comments are moved mechanically, but it is out of date. We can remove this line... > + '*' must be escaped to avoid the run-length encoding processing > + in reading packets. */ ... and move this line to remote_escape_output to explain why '*' is escaped. > + > +extern int remote_unescape_input (const gdb_byte *buffer, int len, > + gdb_byte *out_buf, int out_maxlen); > + -- Yao (齐尧)