Page MenuHomePhabricator

ObjectFile[ELF]: Refactor gnu_debuglink interface
ClosedPublic

Authored by labath on Aug 1 2019, 1:41 AM.

Details

Summary

The contents of the gnu_debuglink section were passed through the
GetDebugSymbolFilePaths interface, which was more generic than needed.
As the only class implementing this function is ObjectFileELF, we can
modify the function to return just a single FileSpec (instead of a
list). Also, since the SymbolVendorELF already assumes ELF object files,
we don't have to make this method available on the generic ObjectFile
interface -- instead we can put it on ObjectFileELF directly.

This change also makes is so that if the Module has an explicit symbol
file spec set, we disregard the value the value of the debug link
(instead of doing a secondary lookup using that). I think it makes sense
to honor the users wishes if he had explicitly set the symbol file spec,
and this seems to be consistent with what SymbolVendorMacOSX is doing
(SymbolVendorMacOSX.cpp:125).

The main reason for making these changes is to make the treatment of
build-ids and debug links simpler in the follow-up patch.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Aug 1 2019, 1:41 AM
jankratochvil accepted this revision.Aug 4 2019, 1:58 PM

Yes, it looks to me as a nice simplification on its own. Just eyeballed.

This revision is now accepted and ready to land.Aug 4 2019, 1:58 PM
MaskRay accepted this revision.Aug 4 2019, 7:14 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2019, 2:57 AM