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

Ed Maste emaste at freebsd.org
Tue Jul 2 11:52:29 PDT 2013


On 2 July 2013 13:21, Mike Sartain <mikesart at valvesoftware.com> wrote:

> You can do a "readelf -n elf-file" to see what the build ids are.

Aha, there's part of the problem: FreeBSD's binutils is relatively
old, and doesn't support build IDs.

> 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...(..

Right, the .gnu_debuglink section in the main binary looks fine:

feynman% readelf -S hello | grep .gnu_debuglink
  [25] .gnu_debuglink    PROGBITS         0000000000000000  00000a16
feynman% readelf -x 25 hello

Hex dump of section '.gnu_debuglink':
  0x00000000 68656c6c 6f2e6465 62756700 51d94625 hello.debug.Q.F%

> 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.

Ahh, I see ObjectFileELF::GetUUID entering the
calc_gnu_debuglink_crc32 case for the main binary, and not being
called at all for the standalone debug file -- that looks backwards.

> 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...

The easiest way to try it out is to grab a snapshot from
http://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/.  Here's a
direct link for a stable/9 amd64 image:
http://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/20130630/9.1-STABLE/amd64/FreeBSD-9.1-STABLE-amd64-20130630-r252387.vmdk.xz

Login as root with no password.



More information about the lldb-commits mailing list