This is an archive of the discontinued LLVM Phabricator instance.

DWARF: Introduce DWARFUnitHeader class
ClosedPublic

Authored by labath on May 17 2019, 11:53 AM.

Details

Summary

This patch introduces the DWARFUnitHeader class. Its purpose (and its
structure, to the extent it was possible to make it) is the same as its
LLVM counterpart -- to extract the unit header information before we
actually construct the unit, so that we know which kind of units to
construct. This is needed because as of DWARF5, type units live in the
.debug_info section, which means it's not possible to statically
determine the type of units in a given section.

Event Timeline

labath created this revision.May 17 2019, 11:53 AM
labath added a subscriber: jankratochvil.

The TypeUnit and CompileUnit classes are pretty much identical now, but that'll change once we start parsing type signatures and cross-referencing them.

Nice! FYI, we have a bot that runs the LLDB dotests against DWARF5 (the last stage http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/) to track the progress.

source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
882

clang-format?

Are type units still disabled with the kill switch we had in? Or is this on top of the .debug_types patch? We have an internal .debug_types patch we have been using on an older LLVM/Clang/LLDB and we had some major performance issues regarding line tables so I am not sure where we would need to put these fixes (in this patch or in the .debug_types specific patch. This patch seems to enable parsing .debug_types already. The main issue we ran into were:

  • only search actual compile unit line tables for breakpoints as many .debug_type units will point to existing line tables from real compile units
  • don't add address ranges to type unit DWARFUnits from the line tables
  • re-work how support files are parsed by sharing the line tables within a SymbolFileDWARF. .debug_types has type units that reuse line tables from real compile units (thousands of times) and we ended up seeing the same line table being parsed over and over and over. Another way to fix this is to no vend a lldb_private::CompileUnit for any units that aren't really compile units (DW_UT_type and DW_UT_split_type).

So if this patch is enabling all this, we will need to fix this patch to avoid all of the above mentioned issues. Let me know your thoughts.

labath marked an inline comment as done.May 20 2019, 2:51 AM

Nice! FYI, we have a bot that runs the LLDB dotests against DWARF5 (the last stage http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/) to track the progress.

Cool. That's nice to know. Unfortunately, Green Dragon seems to be in a pretty bad shape (looks like some infrastructure problems), so I can't really see what's the state of things.

Are type units still disabled with the kill switch we had in? Or is this on top of the .debug_types patch?

This is on top the debug_types patch. However, I decided it makes more sense to do things the other way around, so I'm going to flip their order around. I am going to reply to the rest of your message on the debug_types patch.

labath updated this revision to Diff 200227.May 20 2019, 2:51 AM

Rebase so that this does not require any debug_types support.

labath retitled this revision from Introduce DWARFUnitHeader and use it to parse type units out of .debug_info to DWARF: Introduce DWARFUnitHeader class.May 20 2019, 2:52 AM
labath edited the summary of this revision. (Show Details)
clayborg accepted this revision.May 20 2019, 9:46 AM

Fine if we get things in quick!

This revision is now accepted and ready to land.May 20 2019, 9:46 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2019, 12:20 AM