diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py')
-rw-r--r-- | packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py index b1e0d3deeae7..255b6f7fa292 100644 --- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py @@ -1,10 +1,11 @@ """ -Test specific to MIPS +Test specific to MIPS """ from __future__ import print_function -import os, time +import os +import time import re import unittest2 import lldb @@ -12,6 +13,7 @@ from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class AvoidBreakpointInDelaySlotAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -21,8 +23,8 @@ class AvoidBreakpointInDelaySlotAPITestCase(TestBase): self.build() exe = os.path.join(os.getcwd(), "a.out") self.expect("file " + exe, - patterns = [ "Current executable set to .*a.out.*" ]) - + patterns=["Current executable set to .*a.out.*"]) + # Create a target by the debugger. target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) @@ -33,7 +35,8 @@ class AvoidBreakpointInDelaySlotAPITestCase(TestBase): VALID_BREAKPOINT) # Now launch the process, and do not stop at entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) self.assertTrue(process, PROCESS_IS_VALID) list = target.FindFunctions('foo', lldb.eFunctionNameTypeAuto) @@ -44,7 +47,7 @@ class AvoidBreakpointInDelaySlotAPITestCase(TestBase): self.assertTrue(function) self.function(function, target) - def function (self, function, target): + def function(self, function, target): """Iterate over instructions in function and place a breakpoint on delay slot instruction""" # Get the list of all instructions in the function insts = function.GetInstructions(target) @@ -56,7 +59,7 @@ class AvoidBreakpointInDelaySlotAPITestCase(TestBase): branchinstaddress = inst.GetAddress().GetLoadAddress(target) # Get next instruction i.e delay slot instruction. - delayinst = insts.GetInstructionAtIndex(i+1) + delayinst = insts.GetInstructionAtIndex(i + 1) delayinstaddr = delayinst.GetAddress().GetLoadAddress(target) # Set breakpoint on delay slot instruction @@ -71,9 +74,10 @@ class AvoidBreakpointInDelaySlotAPITestCase(TestBase): # Get the address where breakpoint is actually set. bpaddr = location.GetLoadAddress() - - # Breakpoint address should be adjusted to the address of branch instruction. - self.assertTrue(branchinstaddress == bpaddr) + + # Breakpoint address should be adjusted to the address of + # branch instruction. + self.assertTrue(branchinstaddress == bpaddr) i += 1 else: i += 1 |