[Lldb-commits] [lldb] r256147 - Fix emulation of the thumb str instruction

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 21 04:06:54 PST 2015


Author: tberghammer
Date: Mon Dec 21 06:06:36 2015
New Revision: 256147

URL: http://llvm.org/viewvc/llvm-project?rev=256147&view=rev
Log:
Fix emulation of the thumb str instruction

Modified:
    lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.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=256147&r1=256146&r2=256147&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Mon Dec 21 06:06:36 2015
@@ -4781,7 +4781,11 @@ EmulateInstructionARM::EmulateSTRThumb (
             address = base_address;
                   
         EmulateInstruction::Context context;
-        context.type = eContextRegisterStore;
+        if (n == 13)
+            context.type = eContextPushRegisterOnStack;
+        else
+            context.type = eContextRegisterStore;
+
         RegisterInfo base_reg;
         GetRegisterInfo (eRegisterKindDWARF, dwarf_r0 + n, base_reg);
                   
@@ -4809,8 +4813,12 @@ EmulateInstructionARM::EmulateSTRThumb (
         // if wback then R[n] = offset_addr;
         if (wback)
         {
-            context.type = eContextRegisterLoad;
+            if (n == 13)
+                context.type = eContextAdjustStackPointer;
+            else
+                context.type = eContextAdjustBaseRegister;
             context.SetAddress (offset_addr);
+
             if (!WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_r0 + n, offset_addr))
                 return false;
         }




More information about the lldb-commits mailing list