summaryrefslogtreecommitdiff
path: root/source/Target/Target.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Target/Target.cpp')
-rw-r--r--source/Target/Target.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index d2aa1bac49f6..21e42916bae9 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -2442,18 +2442,18 @@ Target::GetBreakableLoadAddress (lldb::addr_t addr)
SymbolContext sc;
uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol;
temp_addr_module_sp->ResolveSymbolContextForAddress(resolved_addr, resolve_scope, sc);
+ Address sym_addr;
if (sc.function)
- {
- function_start = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(this);
- if (function_start == LLDB_INVALID_ADDRESS)
- function_start = sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
- }
+ sym_addr = sc.function->GetAddressRange().GetBaseAddress();
else if (sc.symbol)
- {
- Address sym_addr = sc.symbol->GetAddress();
+ sym_addr = sc.symbol->GetAddress();
+
+ function_start = sym_addr.GetLoadAddress(this);
+ if (function_start == LLDB_INVALID_ADDRESS)
function_start = sym_addr.GetFileAddress();
- }
- current_offset = addr - function_start;
+
+ if (function_start)
+ current_offset = addr - function_start;
}
// If breakpoint address is start of function then we dont have to do anything.