[Lldb-commits] [lldb] r185366 - Split symbol support for ELF and Linux.

Mike Sartain mikesart at valvesoftware.com
Tue Jul 2 10:21:49 PDT 2013


> From: carpeddiem at gmail.com [carpeddiem at gmail.com] on behalf of Ed Maste [emaste at freebsd.org]
> > On 2 July 2013 11:18, Malea, Daniel <daniel.malea at intel.com> wrote:
> > What's UUID used for? Is it just used by LLDB to determine when an
> > executable has changed, or does it have other implications? If it's just
> > for detecting changed executables, is there any reason to not just compute
> > an MD5 sum of the binary (in the case UUID is missing) instead?
> 
> For the standalone debug files the GNU spec includes a crc32 of the
> main binary's contents, used to make sure the two files match.  I
> don't know of all of the UUID use cases within lldb, but it looks like
> Michael's patch uses the first four bytes of the UUID to store this
> crc.
> 
> In my case the crc is being calculated for the main binary, but I
> don't have one for the standalone debug file.

The build id rationalization and split debug files are described in these two links.

https://fedoraproject.org/wiki/Releases/FeatureBuildId
http://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

You can do a "readelf -n elf-file" to see what the build ids are. For the .gnu_debuglink section (debug file name and crc32 value), you can use something like this to dump (once you know the section id):

mikesart at mikesart-rad:~/data/src/blah2/build$ readelf -x 28 blah
Hex dump of section '.gnu_debuglink':
  0x00000000 626c6168 2e646562 75670000 d128edab blah.debug...(..

> I haven't yet looked into where the UUID is supposed to be set.

That GetModuleSpecifications call should wind up in ObjectFileELF::GetModuleSpecifications(), where it will call GetSectionHeaderInfo() in the same file which should get the build id via ParseNoteGNUBuildID() on line 806 of ObjectFileELF.cpp.

I'll try to set up freebsd in a virtualbox here and take a look at what's going on. Ed: If you have any pointers on this, please let me know as I haven't touched FreeBSD before... 

Thanks!
 -Mike



More information about the lldb-commits mailing list