summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2012-07-12 23:43:02 +0000
committerJason Molenda <jmolenda@apple.com>2012-07-12 23:43:02 +0000
commitd59fd74eec765cba98e815b7bf900fee0ce1ce44 (patch)
tree5f17b6e2b0bed985e10f5c797a9beb2ed6f3d4a5 /lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
parent9460fbf21957f5b1c8b6d85d7c606301209ece62 (diff)
downloadbcm5719-llvm-d59fd74eec765cba98e815b7bf900fee0ce1ce44.tar.gz
bcm5719-llvm-d59fd74eec765cba98e815b7bf900fee0ce1ce44.zip
When parsing the epilogue of a thumbv2 function, when we see the
frame pointer overwritten with the caller's fp value, return to expressing the CFA in terms of the stack pointer. <rdar://problem/11855862> llvm-svn: 160150
Diffstat (limited to 'lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp')
-rw-r--r--lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
index 6d2b0a54b6a..58416dd5ea3 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -490,6 +490,20 @@ UnwindAssemblyInstEmulation::WriteRegister (EmulateInstruction *instruction,
{
m_curr_row.SetRegisterLocationToSame (reg_num, must_replace);
}
+ // if we just restored the caller's reg value in the reg we were using for the frame pointer,
+ // change the CFA to be in terms of the stack pointer again.
+ if (m_fp_is_cfa && reg_num == m_cfa_reg_info.kinds[m_unwind_plan_ptr->GetRegisterKind()])
+ {
+ m_fp_is_cfa = false;
+ m_inst_emulator_ap->GetRegisterInfo (m_unwind_plan_ptr->GetRegisterKind(),
+ m_unwind_plan_ptr->GetInitialCFARegister(),
+ m_cfa_reg_info);
+ m_curr_row.SetCFARegister(m_cfa_reg_info.kinds[m_unwind_plan_ptr->GetRegisterKind()]);
+ if (log && log->GetVerbose())
+ {
+ log->Printf("UnwindAssemblyInstEmulation::WriteRegister - CFA is expressed in terms of %s again", m_cfa_reg_info.name);
+ }
+ }
}
break;
OpenPOWER on IntegriCloud