diff options
| author | Tamas Berghammer <tberghammer@google.com> | 2015-08-21 10:49:09 +0000 |
|---|---|---|
| committer | Tamas Berghammer <tberghammer@google.com> | 2015-08-21 10:49:09 +0000 |
| commit | f5d3e66bf5794480a6df6684a4c88738616b72ee (patch) | |
| tree | 7c4a7a9dfa263a11ac6e8c0056dc85151aef8635 /lldb/source | |
| parent | eab960c46f3d71cc3c6614be7e538c727996fcaa (diff) | |
| download | bcm5719-llvm-f5d3e66bf5794480a6df6684a4c88738616b72ee.tar.gz bcm5719-llvm-f5d3e66bf5794480a6df6684a4c88738616b72ee.zip | |
Fix assertion failure caused by r245546
Change the way EmulateInstruction::eContextPopRegisterOffStack handled
in UnwindAssemblyInstEmulation::WriteRegister to accomodate for
additional cases when eContextPopRegisterOffStack (pop PC/FLAGS).
llvm-svn: 245690
Diffstat (limited to 'lldb/source')
| -rw-r--r-- | lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp | 3 | ||||
| -rw-r--r-- | lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp | 33 |
2 files changed, 25 insertions, 11 deletions
diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp index 638a88c95e7..2e9d479e641 100644 --- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -10321,8 +10321,7 @@ EmulateInstructionARM::EmulateLDRDImmediate (const uint32_t opcode, const ARMEnc return false; //R[t2] = MemA[address+4,4]; - - context.SetRegisterPlusOffset (base_reg, (address + 4) - Rn); + context.SetAddress(address + 4); data = MemARead (context, address + 4, addr_byte_size, 0, &success); if (!success) return false; diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp index a7e98be9ea2..2dfd80d7e53 100644 --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp @@ -580,17 +580,32 @@ 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) { - if (context.info_type == EmulateInstruction::eInfoTypeAddress) + switch (context.info_type) { - 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; - } + case 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, + false /*must_replace*/); + m_curr_row_modified = true; + } + break; + case EmulateInstruction::eInfoTypeISA: + assert((generic_regnum == LLDB_REGNUM_GENERIC_PC || + generic_regnum == LLDB_REGNUM_GENERIC_FLAGS) && + "eInfoTypeISA used for poping a register other the the PC/FLAGS"); + if (generic_regnum != LLDB_REGNUM_GENERIC_FLAGS) + { + m_curr_row->SetRegisterLocationToSame(reg_num, + false /*must_replace*/); + m_curr_row_modified = true; + } + break; + default: + assert(false && "unhandled case, add code to handle this!"); + break; } - else - assert (!"unhandled case, add code to handle this!"); } } } |

