[Lldb-commits] [PATCH] D32168: [LLDB][MIPS] Fix TestStepOverBreakpoint.py failure

Nitesh Jain via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 18 08:55:33 PDT 2017


nitesh.jain created this revision.
Herald added a subscriber: arichardson.

In case of MIPS, we never add breakpoint in the delay slot. Hence while doing stepping, the delay slot instruction will be skipped.


https://reviews.llvm.org/D32168

Files:
  packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py


Index: packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
+++ packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
@@ -62,12 +62,19 @@
         instructions = function.GetInstructions(self.target)
         addr_1 = self.breakpoint1.GetLocationAtIndex(0).GetAddress()
         addr_4 = self.breakpoint4.GetLocationAtIndex(0).GetAddress()
+        delay_slot = 0
+        addr_1_load_address = addr_1.GetLoadAddress(self.target)
+        addr_4_load_address = addr_4.GetLoadAddress(self.target)
         for i in range(instructions.GetSize()) :
             addr = instructions.GetInstructionAtIndex(i).GetAddress()
+            addr_load_address = addr.GetLoadAddress(self.target)
             if (addr == addr_1) : index_1 = i
-            if (addr == addr_4) : index_4 = i 
+            if (addr == addr_4) : index_4 = i
+            if (addr_1_load_address <= addr_load_address <= addr_4_load_address):
+                if (instructions.GetInstructionAtIndex(i).HasDelaySlot()) :
+                    delay_slot = delay_slot + 1
 
-        steps_expected = index_4 - index_1
+        steps_expected = index_4 - index_1 - delay_slot
         step_count = 0
         # Step from breakpoint_1 to breakpoint_4
         while True:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32168.95575.patch
Type: text/x-patch
Size: 1512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170418/630606aa/attachment.bin>


More information about the lldb-commits mailing list