summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObjectVariable.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-05-03 20:19:39 +0000
committerAdrian Prantl <aprantl@apple.com>2018-05-03 20:19:39 +0000
commitb78a577179328e66b993fb0b160505b2d9c41886 (patch)
tree3192c301510fc630a9cc2ebea5bfc9af1570b9e4 /lldb/source/Core/ValueObjectVariable.cpp
parent88fc73d544835b8be16ee64086e306eb6bb2b03e (diff)
downloadbcm5719-llvm-b78a577179328e66b993fb0b160505b2d9c41886.tar.gz
bcm5719-llvm-b78a577179328e66b993fb0b160505b2d9c41886.zip
Revert "DWARFExpression: Convert file addresses to load addresses early on."
This reverts commit 331462 while investigating bot breakage. llvm-svn: 331480
Diffstat (limited to 'lldb/source/Core/ValueObjectVariable.cpp')
-rw-r--r--lldb/source/Core/ValueObjectVariable.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp
index a1c69f45ce6..e08963210ec 100644
--- a/lldb/source/Core/ValueObjectVariable.cpp
+++ b/lldb/source/Core/ValueObjectVariable.cpp
@@ -236,9 +236,23 @@ bool ValueObjectVariable::UpdateValue() {
// If we have a file address, convert it to a load address if we can.
if (value_type == Value::eValueTypeFileAddress && process_is_alive) {
- SymbolContext var_sc;
- variable->CalculateSymbolContext(&var_sc);
- m_value.ConvertToLoadAddress(var_sc);
+ lldb::addr_t file_addr =
+ m_value.GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
+ if (file_addr != LLDB_INVALID_ADDRESS) {
+ SymbolContext var_sc;
+ variable->CalculateSymbolContext(&var_sc);
+ if (var_sc.module_sp) {
+ ObjectFile *objfile = var_sc.module_sp->GetObjectFile();
+ if (objfile) {
+ Address so_addr(file_addr, objfile->GetSectionList());
+ lldb::addr_t load_addr = so_addr.GetLoadAddress(target);
+ if (load_addr != LLDB_INVALID_ADDRESS) {
+ m_value.SetValueType(Value::eValueTypeLoadAddress);
+ m_value.GetScalar() = load_addr;
+ }
+ }
+ }
+ }
}
if (!CanProvideValue()) {
OpenPOWER on IntegriCloud