llvm-project/lldb
Adrian Prantl f796e763b2 DWARFExpression: Resolve file addresses in the linked module
This is a follow-up to https://reviews.llvm.org/D46362.

When evaluating a complex expression in DWARFExpression::Evaluate,
file addresses must be resolved to load addresses before we can
perform operations such as DW_OP_deref on them.

For this the address goes through three steps

1. Read the file address as stored in the DWARF
2. Link/relocate the file address (when reading from a .dSYM, this is a no-op)
3. Convert the file address to a load address.

D46362 implemented step (3) by resolving the file address using the
Module that the original DWARF came from. In the case of a dSYM that
is correct, but when reading from .o files, we need to look up
relocated/linked addresses, so the right place to look them up is the
current frame's module. This patch fixes that by setting the
expression's Module to point to the linked debugmap object.

A word a bout the unorthodox testcase: The motivating testcase for
this fix is in Swift, but I managed to hand-modify LLVM-IR for a
trivial C program to exhibit the same problem, so we can fix this in
llvm.org.

rdar://problem/44689915

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

llvm-svn: 343612
2018-10-02 17:50:42 +00:00
..
cmake [cmake] Add option to skip building lldb-server 2018-08-23 18:05:45 +00:00
docs Enable AUTOBRIEF in doxygen configuration. 2018-05-02 16:55:16 +00:00
examples Fixes for GDB remote packet disassembler: 2018-09-27 17:55:36 +00:00
include/lldb DWARFExpression: Resolve file addresses in the linked module 2018-10-02 17:50:42 +00:00
lit [Interpreter] Escape backticks when dumping format entities. 2018-10-01 13:22:24 +00:00
lldb.xcodeproj [DataFormatters] Add formatter for C++17 std::variant 2018-09-19 18:07:05 +00:00
lldb.xcworkspace Fix a typo in the gtest build target for Debug configuration. 2018-04-10 17:49:56 +00:00
packages/Python/lldbsuite DWARFExpression: Resolve file addresses in the linked module 2018-10-02 17:50:42 +00:00
resources Fix up Info.plist when building LLDB.framework with CMake 2018-06-19 02:59:30 +00:00
scripts [SBAPI/Target] Expose SetStatistics(bool enable)/GetStatistics(). 2018-09-28 23:27:54 +00:00
source DWARFExpression: Resolve file addresses in the linked module 2018-10-02 17:50:42 +00:00
test Allow use of self.filecheck in LLDB tests (c.f self.expect) 2018-09-18 19:31:47 +00:00
third_party/Python/module *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
tools [Driver] Remove unused declarations and "include" directives 2018-09-28 19:58:03 +00:00
unittests [lldb] Remove an assertion in RichManglingContext::GetBufferRef() hit when debugging a native x86 Windows process 2018-09-28 02:33:51 +00:00
utils [CMake] Unify and relayer testing 2018-05-03 16:54:10 +00:00
www Add docs for scripted breakpoint resolvers 2018-09-17 21:55:46 +00:00
.arcconfig
.clang-format Updated .clang-format rules so bring LLDB in line with LLVM standards. 2016-09-06 17:19:00 +00:00
.gitignore [dotest] Remove crashinfo hook 2018-01-10 10:18:47 +00:00
CMakeLists.txt Allow use of self.filecheck in LLDB tests (c.f self.expect) 2018-09-18 19:31:47 +00:00
CODE_OWNERS.txt Fix/unify the spelling of Objective-C. 2018-06-13 16:21:24 +00:00
INSTALL.txt Changed builld-llvm.py to use .json files 2017-02-23 02:21:34 +00:00
LICENSE.TXT
use_lldb_suite_root.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00