[Lldb-commits] [PATCH] D61482: [DWARF] Store compile unit IDs in the DIERef class
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri May 3 02:33:42 PDT 2019
labath created this revision.
labath added reviewers: JDevlieghere, clayborg, aprantl.
Herald added a subscriber: arphaman.
The offset of a compile unit is enough to identify in a section, but
things start to get a lot more complicated when you have multiple object
files, each with potentially several debug-info-carrying sections
We were already pushing this concept to its limits split-dwarf, which
required juggling offsets of several units to get things to work.
However, this really become a problem when we tried to introduce
debug_types support, which resulted in a long series of attempts to
"concatenate" various debug info sections so that the unit offset
remains a valid identifier.
Instead of attempting to assign unique offsets to all units that we care
about, this patch does something more fundamental. We just admit that
using offsets as unique identifiers does not scale to all debug info
formats we want to support, and uses a different ID instead.
Decoupling the ID from the offset means the offset can be free to point
to the actual offset of the compile unit in the relevant section,
without any changes to low-level parsing code needed. And using a
surrogate ID means its much easier to map the compile units into a
single address space. At least two strategies are possible after this
a) map all relevant units into a single continuous sequence of integers
(as if the were all stored in one vector)
b) steal some bits from the cu_idx field and use it as some sort of a
discriminator (essentially creating multiple address spaces)
Additionally, this makes us better prepared for the future, where the
total size of debug info exceeds 4GB. It also simplifies code, as we can
treat different debug info flavours more uniformly.
- renames the cu_offset field of DIERef to cu_idx and fixes all uses to treat it as such
- removes DWARFUnit::GetBaseObjOffset as it no longer serves any useful purpose. Instead the DWO unit is made to share the ID of the "base" unit, as they logically represent a single compilation.
- changes SymbolFileDWARFDwo to use the index of the contained unit as its ID (this is the same approach taken by SymbolFileDWARFDebugMap).
- has a longer commit message than the code it changes. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 11292 bytes
Desc: not available
More information about the lldb-commits