<div dir="ltr"><div class="markdown-here-wrapper" style><p style="margin:1.2em 0px!important">Hey Jason,</p>
<blockquote style="margin:1.2em 0px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221);padding:0px 1em;color:rgb(119,119,119);quotes:none">
<p style="margin:1.2em 0px!important"> I don’t know about llgs or how much work it would be to change the kalimba gdbserver stub.</p>
</blockquote>
<p style="margin:1.2em 0px!important">Currently GDBRemoteCommunicationServer, used by both llgs and lldb-platform, does send the triple as hex encoded via this code:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;background-color:rgb(248,248,248);white-space:pre;overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,255)">response.PutCString("triple:");
response.PutCStringAsRawHex8(host_triple.getTriple().c_str());
</code></pre><p style="margin:1.2em 0px!important">We can easily not do that as you suggest.  Are there any ramifications for your usage of lldb-platform, though?  We’d need to change the receiver code of that, which would then differ based on which lldb-platform version you’re talking to.</p>

<p style="margin:1.2em 0px!important">You might want to try it locally against some older devices to see if that has any negative consequences.  Those went in with Greg’s change in 2011:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;background-color:rgb(248,248,248);white-space:pre;overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,255)">Did a lot more work on abtracting and organizing the platforms. 

On Mac OS X we now have 3 platforms:
PlatformDarwin - must be subclassed to fill in the missing pure virtual funcs
                 but this implements all the common functionality between
                 remote-macosx and remote-ios. It also allows for another
                 platform to be used (remote-gdb-server for now) when doing
                 remote connections. Keeping this pluggable will allow for
                 flexibility.
PlatformMacOSX - Now implements both local and remote macosx desktop platforms.
PlatformRemoteiOS - Remote only iOS that knows how to locate SDK files in the
                    cached SDK locations on the host.

A new agnostic platform has been created:
PlatformRemoteGDBServer - this implements the platform using the GDB remote 
                          protocol and uses the built in lldb_private::Host
                          static functions to implement many queries.
</code></pre><p style="margin:1.2em 0px!important">-Todd</p>
<div title="MDH:SGV5IEphc29uLDxkaXY+PGJyPjwvZGl2PjxkaXY+Jmd0OyZuYnNwOzxzcGFuIHN0eWxlPSJmb250
LWZhbWlseTogYXJpYWwsIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTogMTNweDsiPiZuYnNwO0kgZG9u
J3Qga25vdyBhYm91dCBsbGdzIG9yIGhvdyBtdWNoIHdvcmsgaXQgd291bGQgYmUgdG8gY2hhbmdl
IHRoZSBrYWxpbWJhIGdkYnNlcnZlciBzdHViLjwvc3Bhbj48L2Rpdj48ZGl2IGNsYXNzPSIiIHN0
eWxlPSJmb250LWZhbWlseTogYXJpYWwsIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTogMTNweDsiPjxi
cj48L2Rpdj48ZGl2IGNsYXNzPSIiIHN0eWxlPSJmb250LWZhbWlseTogYXJpYWwsIHNhbnMtc2Vy
aWY7IGZvbnQtc2l6ZTogMTNweDsiPkN1cnJlbnRseSBHREJSZW1vdGVDb21tdW5pY2F0aW9uU2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ic3A7ICZuYnNwOyAmbmJzcDsgcHJvdG9jb2wgYW5kIHVz
ZXMgdGhlIGJ1aWx0IGluIGxsZGJfcHJpdmF0ZTo6SG9zdDwvZGl2PjxkaXY+Jm5ic3A7ICZuYnNw
OyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7
ICZuYnNwOyAmbmJzcDsgJm5ic3A7IHN0YXRpYyBmdW5jdGlvbnMgdG8gaW1wbGVtZW50IG1hbnkg
cXVlcmllcy48L2Rpdj48L2Rpdj48ZGl2PmBgYDwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+LVRv
ZGQ8L2Rpdj4=" style="height:0;font-size:0em;padding:0;margin:0">​</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 25, 2014 at 3:23 AM, Matthew Gardiner <span dir="ltr"><<a href="mailto:mg11@csr.com" target="_blank">mg11@csr.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jason,<br>
<br>
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.<br>

<br>
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...<br>
<br>
Matt<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
Jason Molenda wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Matthew,<br>
<br>
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.<br>

<br>
Thanks!<br>
<br>
On Jul 24, 2014, at 10:22 PM, Matthew Gardiner <<a href="mailto:mg11@csr.com" target="_blank">mg11@csr.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Jason,<br>
<br>
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.<br>
<br>
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).<br>

<br>
I agree that the need to escape the '-' is probably unfounded since in the case of qHostInfo the '-' is wedged between $ and # characters anyway.<br>
<br>
I'm happy to proceed with either presentation - so long as the documentation is correct.<br>
<br>
Matt<br>
<br>
<br>
Jason Molenda wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The change to make the documentation match the implementation is fine.<br>
<br>
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 $, #, *, }.<br>

<br>
Greg?<br>
<br>
J<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Jul 23, 2014, at 6:23 AM, Matthew Gardiner <<a href="mailto:mg11@csr.com" target="_blank">mg11@csr.com</a>> wrote:<br>
<br>
Folks,<br>
<br>
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.<br>

<br>
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.<br>
<br>
Could someone please apply this patch?<br>
<br>
thanks Matt<br>
<br>
<br>
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<br>

More information can be found at <a href="http://www.csr.com" target="_blank">www.csr.com</a>. Keep up to date with CSR on our technical blog, <a href="http://www.csr.com/blog" target="_blank">www.csr.com/blog</a>, CSR people blog, <a href="http://www.csr.com/people" target="_blank">www.csr.com/people</a>, YouTube, <a href="http://www.youtube.com/user/CSRplc" target="_blank">www.youtube.com/user/CSRplc</a>, Facebook, <a href="http://www.facebook.com/pages/CSR/191038434253534" target="_blank">www.facebook.com/pages/CSR/<u></u>191038434253534</a>, or follow us on Twitter at <a href="http://www.twitter.com/CSR_plc" target="_blank">www.twitter.com/CSR_plc</a>.<br>

New for 2014, you can now access the wide range of products powered by aptX at <a href="http://www.aptx.com" target="_blank">www.aptx.com</a>.<br>
<lldb-gdb-remote.patch>_______<u></u>______________________________<u></u>__________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/lldb-commits</a><br>
</blockquote>
<br>
  To report this email as spam click <a href="https://www.mailcontrol.com/sr/k!++gfQa3yzGX2PQPOmvUtVTDJsKpCsgiT6Sr2CBa5VmIDKRAkOMY8LPYX0hRhQfFVYH2!a+sDSMQcgptJ50Pg==" target="_blank">https://www.mailcontrol.com/<u></u>sr/k!++<u></u>gfQa3yzGX2PQPOmvUtVTDJsKpCsgiT<u></u>6Sr2CBa5VmIDKRAkOMY8LPYX0hRhQf<u></u>FVYH2!a+sDSMQcgptJ50Pg==</a> .<br>

</blockquote>
______________________________<u></u>_________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/lldb-commits</a><br>
</blockquote></blockquote>
<br>
______________________________<u></u>_________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/lldb-commits</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>