Hi Jason,

Indeed my stub implementation does not rely on the hex/otherwise encoding of the triple. I'm happy to revert the patch and change the implementation in the GDBRemote code (probably not till next week, though). My main regret is not floating my patch on lldb-dev first, but I assumed that the implementation was set in stone at that stage.

While we are at it, I also note that distribution_id, os_build, hostname, os_kernel are also currently hex encoded in qHostInfo response, so I'm now curious as to the encoding rationale to those datas too...

Matt


Jason Molenda wrote:
Hi Matthew,

If your stub implementation is not locked into hex encoding this triple string, let's 
change the lldb / stub implementation and the documentation.  It's a mistake and I'd hate 
to propagate it further.  Yeah, the - and + characters are used for ACK / NACK when a 
packet consists only of that character but normal packets are bounded by # and $ so we 
don't need to worry about + and -.  (plus lldb prefers to go into "no-ack" mode 
as soon as possible anyway :)  We've already got a ton of randomness in the remote 
protocol because of bugs which get deployed and we need to support them forever.

Thanks!

On Jul 24, 2014, at 10:22 PM, Matthew Gardiner <[email protected]> wrote:

Hi Jason,

Having the triple hex encoded did confuse me for a while in getting my 
architecture's stub up and working properly, when the previous documentation 
suggested a plain textual representation.

The comment in GDBRemoteCommunicationClient .cpp "// The triple comes as ASCII hex 
bytes since it contains '-' chars" got me thinking, and I discovered that '-' is 
used as the *first* byte in a packet to specify a NACK (in section E.11 Packet 
Acknowledgement of the GDB documentation).

I agree that the need to escape the '-' is probably unfounded since in the case 
of qHostInfo the '-' is wedged between $ and # characters anyway.

I'm happy to proceed with either presentation - so long as the documentation is 
correct.

Matt


Jason Molenda wrote:
The change to make the documentation match the implementation is fine.

But I don't see why the triple is sent hex encoded.  The comment & hex encoding 
was added in r128193 from March 23 2011 by Greg Clayton.  AFAIK '-' is not special 
in gdb-remote protocol.  Characters that can be a problem are $, #, *, }.

Greg?

J


On Jul 23, 2014, at 6:23 AM, Matthew Gardiner <[email protected]> wrote:

Folks,

When I first implemented the qHostInfo for the kalimba gdbserver stub, I sent 
the triple string as kalimba-csr-unknown. However the receiving code 
(GDBRemoteCommunicationClient) expects the string to be encoded as hex bytes, 
since '-' are a reserved GDB-RSP control character.

The documentation for qHostInfo in lldb-gdb-remote.txt does not allude to this 
at all. So I'm sending this patch which I think improves this state of affairs.

Could someone please apply this patch?

thanks Matt


Member of the CSR plc group of companies. CSR plc registered in England and 
Wales, registered number 4187346, registered office Churchill House, Cambridge 
Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Keep up to date with CSR on our 
technical blog, www.csr.com/blog, CSR people blog, www.csr.com/people, YouTube, 
www.youtube.com/user/CSRplc, Facebook, 
www.facebook.com/pages/CSR/191038434253534, or follow us on Twitter at 
www.twitter.com/CSR_plc.
New for 2014, you can now access the wide range of products powered by aptX at 
www.aptx.com.
<lldb-gdb-remote.patch>_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

  To report this email as spam click 
https://www.mailcontrol.com/sr/k!++gfQa3yzGX2PQPOmvUtVTDJsKpCsgiT6Sr2CBa5VmIDKRAkOMY8LPYX0hRhQfFVYH2!a+sDSMQcgptJ50Pg==
 .
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to