summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/UnwindAssembly/InstEmulation
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2015-06-30 09:35:46 +0000
committerTamas Berghammer <tberghammer@google.com>2015-06-30 09:35:46 +0000
commitf366af309abd27cd8a2f828d236586c9f752f445 (patch)
treeec1286698956d09e0cc8d366b93ef94270aa05ed /lldb/source/Plugins/UnwindAssembly/InstEmulation
parent0b736f1ed0a94790a53c87100dfea10979f79be4 (diff)
downloadbcm5719-llvm-f366af309abd27cd8a2f828d236586c9f752f445.tar.gz
bcm5719-llvm-f366af309abd27cd8a2f828d236586c9f752f445.zip
Ignore "push/pop {sp}" in emulation based unwinding
These instructions confusing the unwind code because in case of a push it assumes that the original valu of a register is pushed to the stack what is not neccessarily true in case of SP. The same is true for the pop (in the opposite way). Differential revision: http://reviews.llvm.org/D10806 llvm-svn: 241051
Diffstat (limited to 'lldb/source/Plugins/UnwindAssembly/InstEmulation')
-rw-r--r--lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
index 0ce3682fb24..8f5d9269750 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -422,13 +422,17 @@ UnwindAssemblyInstEmulation::WriteMemory (EmulateInstruction *instruction,
case EmulateInstruction::eContextPushRegisterOnStack:
{
uint32_t reg_num = LLDB_INVALID_REGNUM;
- const uint32_t unwind_reg_kind = m_unwind_plan_ptr->GetRegisterKind();
+ uint32_t generic_regnum = LLDB_INVALID_REGNUM;
if (context.info_type == EmulateInstruction::eInfoTypeRegisterToRegisterPlusOffset)
+ {
+ const uint32_t unwind_reg_kind = m_unwind_plan_ptr->GetRegisterKind();
reg_num = context.info.RegisterToRegisterPlusOffset.data_reg.kinds[unwind_reg_kind];
+ generic_regnum = context.info.RegisterToRegisterPlusOffset.data_reg.kinds[eRegisterKindGeneric];
+ }
else
assert (!"unhandled case, add code to handle this!");
- if (reg_num != LLDB_INVALID_REGNUM)
+ if (reg_num != LLDB_INVALID_REGNUM && generic_regnum != LLDB_REGNUM_GENERIC_SP)
{
if (m_pushed_regs.find (reg_num) == m_pushed_regs.end())
{
@@ -570,7 +574,8 @@ UnwindAssemblyInstEmulation::WriteRegister (EmulateInstruction *instruction,
case EmulateInstruction::eContextPopRegisterOffStack:
{
const uint32_t reg_num = reg_info->kinds[m_unwind_plan_ptr->GetRegisterKind()];
- if (reg_num != LLDB_INVALID_REGNUM)
+ const uint32_t generic_regnum = reg_info->kinds[eRegisterKindGeneric];
+ if (reg_num != LLDB_INVALID_REGNUM && generic_regnum != LLDB_REGNUM_GENERIC_SP)
{
m_curr_row->SetRegisterLocationToSame (reg_num, /*must_replace*/ false);
m_curr_row_modified = true;
OpenPOWER on IntegriCloud