[Lldb-commits] [lldb] r245690 - Fix assertion failure caused by r245546

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 21 03:49:10 PDT 2015


Author: tberghammer
Date: Fri Aug 21 05:49:09 2015
New Revision: 245690

URL: http://llvm.org/viewvc/llvm-project?rev=245690&view=rev
Log:
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).

Modified:
    lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
    lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp

Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=245690&r1=245689&r2=245690&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Fri Aug 21 05:49:09 2015
@@ -10321,8 +10321,7 @@ EmulateInstructionARM::EmulateLDRDImmedi
             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;

Modified: lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp?rev=245690&r1=245689&r2=245690&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp Fri Aug 21 05:49:09 2015
@@ -580,17 +580,32 @@ UnwindAssemblyInstEmulation::WriteRegist
                     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!");
                     }
                 }
             }




More information about the lldb-commits mailing list