aboutsummaryrefslogtreecommitdiff
path: root/source/Core/Address.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Core/Address.cpp')
-rw-r--r--source/Core/Address.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/source/Core/Address.cpp b/source/Core/Address.cpp
index de2165cff84e..5ac2bcce70f0 100644
--- a/source/Core/Address.cpp
+++ b/source/Core/Address.cpp
@@ -16,6 +16,7 @@
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
+#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Symbol/SymbolVendor.h"
@@ -327,15 +328,27 @@ Address::GetLoadAddress (Target *target) const
addr_t
Address::GetCallableLoadAddress (Target *target, bool is_indirect) const
{
- if (is_indirect && target) {
+ addr_t code_addr = LLDB_INVALID_ADDRESS;
+
+ if (is_indirect && target)
+ {
ProcessSP processSP = target->GetProcessSP();
Error error;
if (processSP.get())
- return processSP->ResolveIndirectFunction(this, error);
+ {
+ code_addr = processSP->ResolveIndirectFunction(this, error);
+ if (!error.Success())
+ code_addr = LLDB_INVALID_ADDRESS;
+ }
}
-
- addr_t code_addr = GetLoadAddress (target);
-
+ else
+ {
+ code_addr = GetLoadAddress (target);
+ }
+
+ if (code_addr == LLDB_INVALID_ADDRESS)
+ return code_addr;
+
if (target)
return target->GetCallableLoadAddress (code_addr, GetAddressClass());
return code_addr;