RE: [RFC] Enable GDB handle compressed target.xml returned by GDB stub

Terry Guo
2012-06-27T03:42:06Z

Hi Jonathan,

In terms of transferring the compressed xml file from stub to gdb, I find there are two methods:

1). Use the original binary format and escape special characters like "$", "#" and "}".
2). Convert the original binary format into ASCII format, such as the binary format(in hex) "01020304" will be converted into string of bytes "01020304"(in ASCII format). The size of binary format is 32 bits while the size of string format will be 64 bits (without the NULL terminator). The problem is that the binary format is much smaller than the original xml file, but after convert, we need to use bigger runtime buffer to store the string of bytes.

So which method will you prefer? I think the method 1) is better.

BR,
Terry

> -----Original Message-----
> From: Jonathan Larmour [mailto:jifl@ecoscentric.com]
> Sent: Tuesday, June 26, 2012 7:58 PM
> To: Terry Guo
> Cc: 'Pedro Alves'; 'Ulrich Weigand'; 'Yao Qi'; gdb-
> patches@sourceware.org; tromey@redhat.com; Richard Earnshaw; Joey Ye;
> Matthew Gretton-Dann
> Subject: Re: [RFC] Enable GDB handle compressed target.xml returned by
> GDB stub
>
> Terry Guo wrote:
> > Hi Jonathan,
> >
> > I read your email again and think your solution is:
> >
> > If stub doesn't return compressedXML+ then
> > We go with plain read
> > Else we go with compressed read
> > If we get NUL reply
> > Then we fall back to plain read
> >
> > If this time my understanding on your solution is correct, I think it
> > does save effort on round trip by not always round trip.
>
> Yes, that's what I was proposing.
>
> By the way, there are a lot of people on CC for this thread, and I
> don't
> know if they ought to be. Send me and Terry a direct note if you want
> off
> CC - I've just been preserving the CCs.
>
> Jifl
> --
> eCosCentric Limited http://www.eCosCentric.com/ The eCos
> experts
> Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223
> 245571
> Registered in England and Wales: Reg No 4422071.
> ------["Si fractum non sit, noli id reficere"]------
> Opinions==mine