[Lldb-commits] [PATCH] D62178: DWARF: Don't compute address ranges for type units

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 21 01:00:28 PDT 2019


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

Type units don't describe any code, so they should never be the result
of any address lookup queries.

Previously, we would compute the address ranges for the type units for
via the line tables they reference because the type units looked a lot
like line-tables-only compile units. However, this is not correct, as
the line tables are only referenced from type units so that other
declarations can use the file names contained in them.

In this patch I make the BuildAddressRangeTable function virtual, and
implement it only for compile units.

Testing this was a bit tricky, because the behavior depends on the order
in which we add things to the address range map. This rarely caused a
problem with DWARF v4 type units, as they are always added after all
CUs. It happened more frequently with DWARF v5, as there clang emits the
type units first. However, this is still not something that it is
required to do, so for testing I've created an assembly file where I've
deliberately sandwiched a compile unit between two type units, which
should isolate us from both changes in how the compiler emits the units
and changes in the order we process them.


https://reviews.llvm.org/D62178

Files:
  lit/SymbolFile/DWARF/debug-types-address-ranges.s
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62178.200420.patch
Type: text/x-patch
Size: 30904 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190521/53e4ec30/attachment-0001.bin>


More information about the lldb-commits mailing list