This is an archive of the discontinued LLVM Phabricator instance.

[lldb/DWARF] Re-enable basic dwp support
ClosedPublic

Authored by labath on Jan 31 2020, 6:09 AM.

Details

Summary

This patch removes the bitrotted SymbolFileDWARF(Dwo)Dwp classes, and
replaces them with dwp support implemented directly inside
SymbolFileDWARFDwo, in a manner mirroring the implementation in llvm.
This patch does:

  • add support for the .debug_cu_index section to our DWARFContext
  • adds a llvm::DWARFUnitIndex argument to the DWARFUnit constructors. This argument is used to look up the offsets of the debug_info and debug_abbrev contributions in the sections of the dwp file.
  • makes sure the creation of the DebugInfo object as well as the initial discovery of DWARFUnits is thread-safe, as we can now call this concurrently when doing parallel indexing.

This patch does not:

  • use the DWARFUnitIndex to search for other kinds of contributions (debug_loc, debug_ranges, etc.). This means that units which reference these sections will not work correctly. These will be handled by follow-up patches, but even the present level of support is sufficient to enable basic functionality.
  • Make the llvm::DWARFContext thread-safe. Righ now, it just avoids this problem by ensuring everything is initialized ahead of time. However, this is something we will run into more often as we try to use more of llvm, and so I plan to start looking into our options here.

Diff Detail

Event Timeline

labath created this revision.Jan 31 2020, 6:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2020, 6:09 AM
Herald added subscribers: mgrang, mgorny. · View Herald Transcript
aprantl accepted this revision.Jan 31 2020, 11:10 AM

This looks good to me.

This revision is now accepted and ready to land.Jan 31 2020, 11:10 AM
This revision was automatically updated to reflect the committed changes.
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp