[Lldb-commits] [PATCH] D62012: Make DWARFContext dwo-aware and port debug_info sections over

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 16 08:09:10 PDT 2019

labath created this revision.
labath added reviewers: aprantl, clayborg, JDevlieghere.

The previous attempt and moving section handling over to DWARFContext
(D59611 <https://reviews.llvm.org/D59611>) failed because it did not take into account the dwo sections
correctly. All DWARFContexts (even those in SymbolFileDWARFDwo) used the
main module for loading the sections, but in the dwo scenario some
sections should come from the dwo file.

This patch fixes that by making the DWARFContext aware of whether it a
dwo context or a regular one. A dwo context gets two sections lists, and
it knows where to look for a particular type of a section. This isn't
fully consistent with how the llvm DWARFContext behaves, because that
one leaves it up to the user to know whether it should ask for a dwo
section or not. However, for the time being, it seems useful to have a
single entity which knows how to peice together the debug info in dwo
and non-dwo scenarios. The rough roadmap for the future is:

- port over the rest of the sections to DWARFContext
- find a way to get rid of SymbolFileDWARFDwo/Dwp/DwpDwo. This will likely involve adding the ability for the DWARFContext to spawn dwo sub-contexts, similarly to how it's done in llvm.
- get rid of the special handling of the "dwo" contexts by making sure everything knows whether it should ask for the .dwo version of the section or not (similarly to how llvm's DWARFUnits do that)

To demonstrate how the DWARFContext should behave in this new world, I
port the debug_info section (which is debug_info.dwo in the dwo file)
handling to DWARFContext. The rest of the sections will come in
subsequent patches.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62012.199833.patch
Type: text/x-patch
Size: 10243 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190516/9cd6e7d2/attachment.bin>

More information about the lldb-commits mailing list