summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRExecutionUnit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Expression/IRExecutionUnit.cpp')
-rw-r--r--lldb/source/Expression/IRExecutionUnit.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp
index 4ae1a4c65db..6b223fd5c1b 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -798,15 +798,25 @@ IRExecutionUnit::FindInSymbols(const std::vector<IRExecutionUnit::SearchSpec> &s
const bool is_external = (candidate_sc.function) ||
(candidate_sc.symbol && candidate_sc.symbol->IsExternal());
+ if (candidate_sc.symbol)
+ {
+ load_address = candidate_sc.symbol->ResolveCallableAddress(*target);
- load_address = candidate_sc.symbol->ResolveCallableAddress(*target);
+ if (load_address == LLDB_INVALID_ADDRESS)
+ {
+ if (target->GetProcessSP())
+ load_address = candidate_sc.symbol->GetAddress().GetLoadAddress(target);
+ else
+ load_address = candidate_sc.symbol->GetAddress().GetFileAddress();
+ }
+ }
- if (load_address == LLDB_INVALID_ADDRESS)
+ if (load_address == LLDB_INVALID_ADDRESS && candidate_sc.function)
{
- if (target->GetProcessSP())
- load_address = candidate_sc.symbol->GetAddress().GetLoadAddress(target);
- else
- load_address = candidate_sc.symbol->GetAddress().GetFileAddress();
+ if (target->GetProcessSP())
+ load_address = candidate_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(target);
+ else
+ load_address = candidate_sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
}
if (load_address != LLDB_INVALID_ADDRESS)
OpenPOWER on IntegriCloud