From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10185 invoked by alias); 26 Jun 2012 02:39:35 -0000 Received: (qmail 10174 invoked by uid 22791); 26 Jun 2012 02:39:33 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,MSGID_MULTIPLE_AT,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Jun 2012 02:39:20 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 26 Jun 2012 03:39:18 +0100 Received: from shawin053 ([10.164.2.89]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 26 Jun 2012 03:40:02 +0100 From: "Terry Guo" To: "'Jonathan Larmour'" Cc: "Pedro Alves" , "Ulrich Weigand" , "Yao Qi" , , , "Richard Earnshaw" , "Joey Ye" , "Matthew Gretton-Dann" References: <201206131312.q5DDCUfK028160@d06av02.portsmouth.uk.ibm.com> <4FD9B96C.9020908@redhat.com> <4FDA0543.9030100@eCosCentric.com> <000101cd4dee$db02a030$9107e090$@guo@arm.com> <4FE4A91E.4040300@eCosCentric.com> In-Reply-To: <4FE4A91E.4040300@eCosCentric.com> Subject: RE: [RFC] Enable GDB handle compressed target.xml returned by GDB stub Date: Tue, 26 Jun 2012 02:39:00 -0000 Message-ID: <000201cd5344$fd2feb30$f78fc190$@guo@arm.com> MIME-Version: 1.0 X-MC-Unique: 112062603391803201 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 2012-06/txt/msg00791.txt.bz2 > -----Original Message----- > From: Jonathan Larmour [mailto:jifl@ecoscentric.com] > Sent: Saturday, June 23, 2012 1:19 AM > To: Terry Guo > Cc: Pedro Alves; Ulrich Weigand; Yao Qi; gdb-patches@sourceware.org; > tromey@redhat.com; Richard Earnshaw; Joey Ye > Subject: Re: [RFC] Enable GDB handle compressed target.xml returned by > GDB stub >=20 > On 19/06/12 08:40, Terry Guo wrote: > > Jifl wrote: > >> 1) Remote stub can return compressedXML+ in qSupported response > >> > >> 2) The current syntax of qXfer:features:read is: > >> qXfer:features:read:ANNEX:OFFSET,LENGTH I suggest instead: > >> qXfer:features:read:ANNEX:OFFSET,LENGTH[,Z] where the ,Z is only > >> attempted if the stub supports the compressedXML remote protocol > >> feature. > > > > I don't think it will work after I looked into some open source GDB > > servers like STLINk, OpenOCD. After they confirm that the packet is > > qXfer:features:read, they just extract information of ANNEX, OFFSET > and > > LENGTH. Whether there is a "Z" doesn't impact their response behavior. >=20 > Then they wouldn't have sent compressedXML+ in their qSupported > response. > So they'll continue to work fine. >=20 > > But the new "zread" can work because those existing gdb servers do > > check whether the op is "read". So for "zread", that check will fail > > and an error code will be returned to host gdb, thus host gdb knows > the > > compressed xml file isn't supported. While for the new stub that > knows > > "zread", the compressed xml file will be returned. >=20 > Sure, but with my suggestion we save having to implement a new command > on > the remote side, as well as avoiding a round trip of attempting the > zread, > failing, and fallback to read every time. >=20 Hi Jonathan, Maybe I am not correctly understanding your proposal. Please let me repeat = and feel free to correct me: There are a bunch of "qXfer:xxxxx:read" inside GDB such as qXfer:features:r= ead, qXfer:memory-map:read and so on. All of them are done by one function = named remote_read_qxfer. I think it's better if all the "qXfer:xxxxx:read" = can utilize the support of compressed xml file. It's possible that stub has= compressed xml for "qXfer:features:read" but has plain xml for "qXfer:memo= ry-map:read". So IMHO the round trip of attempting is unavoidable. With zread solution, the new GDB will do following things: Send command "qXfer:xxxxx:zread" to stub If get NULL reply Then send normal command "qXfer:xxxxx:read" to stub This solution can work with either existing stub or the new stub that suppo= rt compressed xml file. For your solution, I think the round trip attempting is still needed becaus= e stub might return compressed xml and plain xml file. Since we always need= the round trip, then I think it might not be important that whether stub c= an return compressedXML+. BR, Terry