[Lldb-commits] [PATCH] D61908: DWARF: Add ability to reference debug info coming from multiple sections

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 14 08:41:04 PDT 2019


labath created this revision.
labath added reviewers: JDevlieghere, clayborg, aprantl.
Herald added a subscriber: arphaman.

This patch adds the ability to precisely address debug info in
situations when a single file can have more than one debug-info-bearing
sections (as is the case with type units in DWARF v4).

The changes here can be classified into roughly three categories:

- the code which addresses a debug info by offset gets an additional argument, which specifies the section one should look into.
- the DIERef class also gets an additional member variable specifying the section. This way, code dealing with DIERefs can know which section is the object referring to.
- the user_id_t encoding steals one bit from the dwarf_id field to store the section. This means the total number of separate object files (apple .o, or normal .dwo) is limited to 2 billion, but that is fine as it's not possible to hit that number without switching to DWARF64 anyway.

This patch is functionally equivalent to (and inspired by) the two
patches (D61503 <https://reviews.llvm.org/D61503> and D61504 <https://reviews.llvm.org/D61504>) by Jan Kratochvil, but there are differences
in the implementation:

- it uses an enum instead of a bool flag to differentiate the sections
- it increases the size of DIERef struct instead of reducing the amount of addressable debug info
- it sets up DWARFDebugInfo to store the units in a single vector instead of two. This sets us up for the future in which type units can also live in the debug_info section, and I believe it's cleaner because there's no need for unit index remapping

There are no tests with this patch as this is essentially NFC until
we start parsing type units from the debug_types section.


https://reviews.llvm.org/D61908

Files:
  lit/SymbolFile/DWARF/array-sizes.s
  lit/SymbolFile/DWARF/dwarf5_locations.s
  source/Plugins/SymbolFile/DWARF/DIERef.cpp
  source/Plugins/SymbolFile/DWARF/DIERef.h
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
  source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
  source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61908.199462.patch
Type: text/x-patch
Size: 16714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190514/a5c39066/attachment-0001.bin>


More information about the lldb-commits mailing list