[Lldb-commits] Patch for Review: Linux split symbol support

Ed Maste emaste at freebsd.org
Fri Jun 14 12:47:28 PDT 2013


On 13 June 2013 21:13, Mike Sartain <mikesart at valvesoftware.com> wrote:
> On Thursday, June 13, 2013 5:29 PM, Ed Maste [emaste at freebsd.org] wrote:
>
>> I haven't yet reviewed the patch in detail, but as a general comment
>> this isn't Linux-specific -- it's probably more correct to call it
>> "ELF-y."  Specifically, it looks like this logic applies wholesale to
>> FreeBSD, and linux/Symbols.cpp probably belongs in common/ instead.
>
> I had it in Host/common/Symbols.cpp, but split it into a linux directory because that's how the macosx side currently exists. Happy to move it back to common though. If that's what folks what, I'll move it and leave it as ifdef'd __linux__ and let someone more familiar with freebsd make sure I didn't break anything on that platform.

That sounds good to me.  There's a lot of duplication between the
linux/ and freebsd/ subdirectories already, which I'm hoping to
eventually untangle.

I'll make sure this builds on FreeBSD and submit a patch to update the #ifdefs.

>> It seems unusual to dlopen libbfd to obtain a crc32; as far as I can
>> see it's just a standard implementation.  You can probably grab an
>> appropriate one from the FreeBSD source tree:
>> http://svnweb.freebsd.org/base/head/sys/libkern/crc32.c?view=markup
>
> The only spot I was aware of this code existing was in the gdb docs and code. For example, the bottom of this page:
>
> http://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
>
> And that's all GPL I believe. I figured we would be ok using the libbfd shared library if it existed, so I went with that. It'd obviously be way better to get real code in there to do this as it's a fairly small algorithm. Your bsd version appears to produce the same results though - given the "do anything" comment at the top, I assume I can copy / paste it ObjectFileELF.cpp with appropriate credits?

Yes, there should be no restriction on reusing the table & function
from there, although putting it in a separate .cpp file may make it
easier to track its origin.




More information about the lldb-commits mailing list