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

Todd Fiala tfiala at google.com
Wed Jun 11 23:58:19 PDT 2014


> Sorry, my bad. I think I jumped the gun here!

No sweat, we've all been there :-)

> However, what do you (and others!) think of the discrepancy between the
qHostInfo and qProcessInfo docs?

My take on it is that while it is not ideal that they're different bases,
they are spec'd out right and the code in the field behaves the way it is
spec'd out.

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 ;-)


On Wed, Jun 11, 2014 at 11:35 PM, Matthew Gardiner <mg11 at csr.com> wrote:

> Todd Fiala wrote:
>
>> Hey Matthew,
>>
>> That 0 parameter to strtoul doesn't quite work like that.  The 0
>> indicates that the input character string determines how the base is
>> interpreted.  So a 0x{hex} will get interpreted base 16, a standard
>> non-zero-leading set of decimal numbers is base 10, and a 0{octal} is octal.
>>
>>
>>  Sorry, my bad. I think I jumped the gun here! However, the documentation
> in lldb-gdb-remote.txt does state that for qHostInfo:
>
>
> cputype: is a number that is the mach-o CPU type that is being debugged
> (base 10)
>
> but for qProcessInfo:
> cputype: the Mach-O CPU type of the process  (base 16)
>
> So I wondered whether bases of either message were intended to be
> different. That's why I think something is a bit wrong in the docs. Then I
> looked at the parsing code, and unfortunately misinterpreted the 0
> specification :-(
>
> However, what do you (and others!) think of the discrepancy between the
> qHostInfo and qProcessInfo docs?
>
>
> 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.
>



-- 
Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140611/cda87494/attachment.html>


More information about the lldb-commits mailing list