summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2017-02-14 04:55:03 +0000
committerJason Molenda <jmolenda@apple.com>2017-02-14 04:55:03 +0000
commitbe227955e2f2e307c05f3cac71a632a7926f720d (patch)
tree70da9444540fb782f5808c8fd846cbf5d34544c6 /lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
parent4c82b4f6fa4da4981d680012391de8f4c75bab9f (diff)
downloadbcm5719-llvm-be227955e2f2e307c05f3cac71a632a7926f720d.tar.gz
bcm5719-llvm-be227955e2f2e307c05f3cac71a632a7926f720d.zip
Before returning a pc value for a stack frame,
run it through the ABI's FixCodeAddress method. <rdar://problem/29711506> llvm-svn: 295025
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp')
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index ba84c40e976..47a0083a313 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -2015,7 +2015,18 @@ bool RegisterContextLLDB::GetStartPC(addr_t &start_pc) {
return false;
if (!m_start_pc.IsValid()) {
- return ReadPC(start_pc);
+ bool read_successfully = ReadPC (start_pc);
+ if (read_successfully)
+ {
+ ProcessSP process_sp (m_thread.GetProcess());
+ if (process_sp)
+ {
+ ABI *abi = process_sp->GetABI().get();
+ if (abi)
+ start_pc = abi->FixCodeAddress(start_pc);
+ }
+ }
+ return read_successfully;
}
start_pc = m_start_pc.GetLoadAddress(CalculateTarget().get());
return true;
@@ -2044,9 +2055,16 @@ bool RegisterContextLLDB::ReadPC(addr_t &pc) {
if (m_all_registers_available == false && above_trap_handler == false &&
(pc == 0 || pc == 1)) {
return false;
- } else {
- return true;
}
+
+ ProcessSP process_sp (m_thread.GetProcess());
+ if (process_sp)
+ {
+ ABI *abi = process_sp->GetABI().get();
+ if (abi)
+ pc = abi->FixCodeAddress(pc);
+ }
+ return true;
} else {
return false;
}
OpenPOWER on IntegriCloud