diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-08-20 09:09:01 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-08-20 09:09:01 +0000 |
commit | 6c727b4e70e97f64028d3301fa11f50040149ec1 (patch) | |
tree | f436ee8af336c2afb785dc4853523ab9461b3622 /source/Plugins/UnwindAssembly/InstEmulation | |
parent | 101511676406c47a58e587deafb81fbf4e2c079b (diff) | |
download | lldb-6c727b4e70e97f64028d3301fa11f50040149ec1.tar.gz |
Improve instruction emulation based stack unwinding
On ARM there is no difference petween a pop and a load instruction so
a register can be loaded multiple times during the function. Add check
to threat the load as a restore only if it do the restore from the
same location where the register was saved.
Differential revision: http://reviews.llvm.org/D11947
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@245546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Plugins/UnwindAssembly/InstEmulation')
-rw-r--r-- | source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp index 5c016d04e..a7e98be9e 100644 --- a/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp +++ b/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp @@ -580,8 +580,17 @@ UnwindAssemblyInstEmulation::WriteRegister (EmulateInstruction *instruction, 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; + if (context.info_type == EmulateInstruction::eInfoTypeAddress) + { + if (m_pushed_regs.find (reg_num) != m_pushed_regs.end () && + context.info.address == m_pushed_regs[reg_num]) + { + m_curr_row->SetRegisterLocationToSame (reg_num, /*must_replace*/ false); + m_curr_row_modified = true; + } + } + else + assert (!"unhandled case, add code to handle this!"); } } } |