[Lldb-commits] [PATCH] Corrections for docs/lldb-gdb-remote.txt

Greg Clayton gclayton at apple.com
Thu Jun 12 09:41:21 PDT 2014

You are correct that the initial qHostInfo packet was done by me and used decimal. Jason Molenda later added code to qProcessInfo and used hex for cputype (probably for readability since many 64 bit architectures have a high bit set). So the docs are unfortunately correct and the two packets use different bases for cputype and cpusubtype. No one should be using the cputype and cpusubtype unless they are using Mach-o files or are mach-o based, the "triple" is the better option for everyone else.

That is one part of the GDB remote protocol I don't like. Each packet switches numbers. For example the 'p' and 'P' packets use native endian hex buffers, while other "key:value;" representations use big endian hex and decimal values. So there already is a wide inconsistency in the packets and the way numbers are sent.


> On Jun 12, 2014, at 12:01 AM, Matthew Gardiner <mg11 at csr.com> wrote:
> Todd Fiala wrote:
>> If we were to leave the client code the same and switch the qHostInfo to be hex, as long as we prepended the 0x to the qHostInfo generation in RNBRemote.cpp and GDBRemoteCommunicationServer.cpp, I think it would all still work.  (Existing older debugserver/lldb-platform would write decimal in a 0-base client friendly way and get interpreted correctly, and newer debugserver/lldb-platform/llgs would prepend a 0x and also get proper client interpretation due to the 0-base client code.  And since the code is the same on the client for old/new, the matrix of old/new stub and old/new client would probably work.  But I'd never mess with production code just for the benefit of making the spec look cleaner (and changing the spec in the process).  So my vote would be to leave it as it is.
>> But that's just my 2 cents ;-)
> Cool, cheers. Just wanted to clear it up a little. Need to change my stub now!
> Later
> 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-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

More information about the lldb-commits mailing list