Page MenuHomePhabricator

Introduce SymbolFileBreakpad and use it to fill symtab
ClosedPublic

Authored by labath on Dec 31 2018, 6:07 AM.

Details

Summary

This commit adds the glue code necessary to integrate the
SymbolFileBreakpad into the plugin system. Most of the methods are
stubbed out. The only method implemented method is AddSymbols, which
parses the PUBLIC "section" of the breakpad "object file", and fills out
the Module's symtab.

To enable testing this, I've made two additional changes:

  • dump Symtab from the SymbolVendor class. The symtab was already being dumped as a part of the object file dump, but that happened before symbol vendor kicked in, so it did not reflect any symbols added there.
  • add ability to explicitly specify the external symbol file in lldb-test (so that the object file could be linked with the breakpad symbol file). To make things simpler, I've changed lldb-test from consuming multiple inputs (and dumping their symbols) to having it just process a single file per invocation. This was not a problem since everyone was using it that way already.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

labath created this revision.Dec 31 2018, 6:07 AM
labath updated this revision to Diff 179819.Jan 2 2019, 12:19 AM

Add some "image lookup" commands to the test. The test now goes through lldb
instead of lldb-test, but I've kept the lldb-test changes, as I think they make
sense regardless. The tricky part about the new test is the need to specify the
"target symbols add" command via '-o', because I need lit to substitute the full
path to the symbol file.

clayborg accepted this revision.Jan 2 2019, 9:52 AM

LGTM.

This revision is now accepted and ready to land.Jan 2 2019, 9:52 AM
labath updated this revision to Diff 180240.Jan 4 2019, 6:37 AM

A couple of minor tweaks to the patch:

  • log in case we were unable to fetch the base address of the object file
  • extend the test case to cover ICF-ed symbols (marked with m)
  • move the yaml representation of an empty ELF file to a separate Inputs file, so it can be reused in other tests
This revision was automatically updated to reflect the committed changes.