Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Terry Guo" <terry.guo@arm.com>
To: "'Jonathan Larmour'" <jifl@ecoscentric.com>
Cc: "Pedro Alves" <palves@redhat.com>,
	"Ulrich Weigand" <uweigand@de.ibm.com>,
	"Yao Qi" <yao@codesourcery.com>,	<gdb-patches@sourceware.org>,
	<tromey@redhat.com>,
	"Richard Earnshaw" <Richard.Earnshaw@arm.com>,
	"Joey Ye" <Joey.Ye@arm.com>,
	"Matthew Gretton-Dann" <Matthew.Gretton-Dann@arm.com>
Subject: RE: [RFC] Enable GDB handle compressed target.xml returned by GDB stub
Date: Tue, 26 Jun 2012 02:39:00 -0000	[thread overview]
Message-ID: <000201cd5344$fd2feb30$f78fc190$@guo@arm.com> (raw)
In-Reply-To: <4FE4A91E.4040300@eCosCentric.com>



> -----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
> 
> 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.
> 
> Then they wouldn't have sent compressedXML+ in their qSupported
> response.
> So they'll continue to work fine.
> 
> > 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.
> 
> 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.
> 

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:read, 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:memory-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 support compressed xml file.

For your solution, I think the round trip attempting is still needed because 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 can return compressedXML+.

BR,
Terry



  reply	other threads:[~2012-06-26  2:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11  7:31 Terry Guo
2012-06-11 14:43 ` Jonathan Larmour
2012-06-12  9:37   ` Terry Guo
2012-06-12 12:44   ` Yao Qi
2012-06-12 12:57     ` Ulrich Weigand
2012-06-12 16:24       ` Jonathan Larmour
2012-06-13  1:58         ` Terry Guo
2012-06-13 13:42           ` Jonathan Larmour
2012-06-14  0:53             ` Terry Guo
2012-06-13 11:57         ` Terry Guo
2012-06-13 12:26           ` Pedro Alves
2012-06-13 12:51             ` Terry Guo
2012-06-13 13:12               ` Ulrich Weigand
2012-06-13 13:47                 ` Jonathan Larmour
2012-06-14  1:11                   ` Terry Guo
2012-06-14 10:14                 ` Pedro Alves
2012-06-14 13:54                   ` Joel Brobecker
2012-06-14 14:58                     ` Ulrich Weigand
2012-06-14 15:38                   ` Jonathan Larmour
2012-06-19  7:40                     ` Terry Guo
2012-06-22 17:19                       ` Jonathan Larmour
2012-06-26  2:39                         ` Terry Guo [this message]
2012-06-26  3:24                         ` Terry Guo
2012-06-26 11:58                           ` Jonathan Larmour
2012-06-27  3:42                             ` Terry Guo
2012-06-27 21:25                               ` Jonathan Larmour

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='000201cd5344$fd2feb30$f78fc190$@guo@arm.com' \
    --to=terry.guo@arm.com \
    --cc=Joey.Ye@arm.com \
    --cc=Matthew.Gretton-Dann@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jifl@ecoscentric.com \
    --cc=palves@redhat.com \
    --cc=tromey@redhat.com \
    --cc=uweigand@de.ibm.com \
    --cc=yao@codesourcery.com \
    /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