llvm-project/lldb
Pavel Labath 3b9269882e DWARF: Add "dwo_num" field to the DIERef class
Summary:
When dwo support was introduced, it used a trick where debug info
entries were referenced by the offset of the compile unit in the main
file, but the die offset was relative to the dwo file. Although there
was some elegance to it, this representation was starting to reach its
breaking point:
- the fact that the skeleton compile unit owned the DWO file meant that
  it was impossible (or at least hard and unintuitive) to support DWO
  files containing more than one compile unit. These kinds of files are
  produced by LTO for example.
- it made it impossible to reference any DIEs in the skeleton compile
  unit (although the skeleton units are generally empty, clang still
  puts some info into them with -fsplit-dwarf-inlining).
- (current motivation) it made it very hard to support type units placed
  in DWO files, as type units don't have any skeleton units which could
  be referenced in the main file

This patch addresses this problem by introducing an new
"dwo_num" field to the DIERef class, whose purpose is to identify the
dwo file. It's kind of similar to the dwo_id field in DWARF5 unit
headers, but while this is a 64bit hash whose main purpose is to catch
file mismatches, this is just a smaller integer used to indentify a
loaded dwo file. Currently, this is based on the index of the skeleton
compile unit which owns the dwo file, but it is intended to be
eventually independent of that (to support the LTO use case).

Simultaneously the cu_offset is dropped to conserve space, as it is no
longer necessary.  This means we can remove the "BaseObjectOffset" field
from the DWARFUnit class. It also means we can remove some of the
workarounds put in place to support the skeleton-unit+dwo-die combo.
More work is needed to remove all of them, which is out of scope of this
patch.

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: mehdi_amini, dexonsmith, arphaman, lldb-commits

Differential Revision: https://reviews.llvm.org/D63428

llvm-svn: 364009
2019-06-21 07:56:50 +00:00
..
cmake Specify log level for CMake messages (less stderr) 2019-06-19 15:25:32 +00:00
docs [Docs] Modernize references to macOS 2019-05-30 16:46:22 +00:00
examples Python 3: decode string as utf-8 to avoid type mismatch. 2019-06-14 15:39:14 +00:00
include/lldb Add ReadCStringFromMemory for faster string reads 2019-06-18 23:27:57 +00:00
lit DWARF: Add "dwo_num" field to the DIERef class 2019-06-21 07:56:50 +00:00
lldb.xcodeproj Update AuxVector.cpp 2019-06-11 21:20:34 +00:00
lldb.xcworkspace Remove accidentally commited file in xcshareddata 2019-02-05 23:35:01 +00:00
packages/Python/lldbsuite Stabilize TestGdbRemoteLibrariesSvr4Support 2019-06-19 08:41:13 +00:00
resources [CMake] Revised LLDB.framework builds 2019-01-04 12:46:50 +00:00
scripts Make SBDebugger.RunCommandInterpreter callable from Python. 2019-05-15 00:08:55 +00:00
source DWARF: Add "dwo_num" field to the DIERef class 2019-06-21 07:56:50 +00:00
test [CMake] Folder structure for generated Xcode project to cover more targets 2019-05-28 09:29:05 +00:00
third_party/Python/module [lldb/thirdparty] Remove unneeded files, asked by Jonas. 2019-03-12 20:41:36 +00:00
tools [lldb] [test] Extend D55859 symbols.enable-external-lookup=false for more testcases 2019-06-17 14:46:17 +00:00
unittests [unittests] Use object library if cmake supports it 2019-06-20 15:06:31 +00:00
utils [CMake] Fix lldb-dotest for single-config generators in standalone builds 2019-06-13 17:35:43 +00:00
.arcconfig
.clang-format
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt [CMake] LLDB.framework tools handling 2019-05-29 11:26:06 +00:00
CODE_OWNERS.txt Fix/unify the spelling of Objective-C. 2018-06-13 16:21:24 +00:00
INSTALL.txt Fix build URL in new LLDB website 2019-05-01 09:55:00 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
use_lldb_suite_root.py