diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:26:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:26:05 +0000 |
commit | 14f1b3e8826ce43b978db93a62d1166055db5394 (patch) | |
tree | 0a00ad8d3498783fe0193f3b656bca17c4c8697d /packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints | |
parent | 4ee8c119c71a06dcad1e0fecc8c675e480e59337 (diff) |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints')
2 files changed, 39 insertions, 26 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py index 9442a076e2a3e..9b116a0a0a24a 100644 --- a/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py @@ -5,18 +5,21 @@ Test address breakpoints set with shared library of SBAddress work correctly. from __future__ import print_function - -import os, time +import os +import time import re import lldb import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest import * + class AddressBreakpointTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - def test_address_breakpoints (self): + NO_DEBUG_INFO_TESTCASE = True + + def test_address_breakpoints(self): """Test address breakpoints set with shared library of SBAddress work correctly.""" self.build() self.address_breakpoints() @@ -34,9 +37,10 @@ class AddressBreakpointTestCase(TestBase): self.assertTrue(target, VALID_TARGET) # Now create a breakpoint on main.c by name 'c'. - breakpoint = target.BreakpointCreateBySourceRegex("Set a breakpoint here", lldb.SBFileSpec("main.c")) + breakpoint = target.BreakpointCreateBySourceRegex( + "Set a breakpoint here", lldb.SBFileSpec("main.c")) self.assertTrue(breakpoint and - breakpoint.GetNumLocations() == 1, + breakpoint.GetNumLocations() >= 1, VALID_BREAKPOINT) # Get the breakpoint location from breakpoint after we verified that, @@ -48,7 +52,7 @@ class AddressBreakpointTestCase(TestBase): # Next get the address from the location, and create an address breakpoint using # that address: - + address = location.GetAddress() target.BreakpointDelete(breakpoint.GetID()) @@ -61,16 +65,18 @@ class AddressBreakpointTestCase(TestBase): flags = launch_info.GetLaunchFlags() flags &= ~lldb.eLaunchFlagDisableASLR launch_info.SetLaunchFlags(flags) - + error = lldb.SBError() - process = target.Launch (launch_info, error) + process = target.Launch(launch_info, error) self.assertTrue(process, PROCESS_IS_VALID) # Did we hit our breakpoint? - from lldbsuite.test.lldbutil import get_threads_stopped_at_breakpoint - threads = get_threads_stopped_at_breakpoint (process, breakpoint) - self.assertTrue(len(threads) == 1, "There should be a thread stopped at our breakpoint") + from lldbsuite.test.lldbutil import get_threads_stopped_at_breakpoint + threads = get_threads_stopped_at_breakpoint(process, breakpoint) + self.assertTrue( + len(threads) == 1, + "There should be a thread stopped at our breakpoint") # The hit count for the breakpoint should be 1. self.assertTrue(breakpoint.GetHitCount() == 1) @@ -82,10 +88,12 @@ class AddressBreakpointTestCase(TestBase): launch_info.SetLaunchFlags(flags) process = target.Launch(launch_info, error) - self.assertTrue (process, PROCESS_IS_VALID) + self.assertTrue(process, PROCESS_IS_VALID) - thread = get_threads_stopped_at_breakpoint (process, breakpoint) - self.assertTrue(len(threads) == 1, "There should be a thread stopped at our breakpoint") + thread = get_threads_stopped_at_breakpoint(process, breakpoint) + self.assertTrue( + len(threads) == 1, + "There should be a thread stopped at our breakpoint") # The hit count for the breakpoint should now be 2. self.assertTrue(breakpoint.GetHitCount() == 2) diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py index 73b3ef5eae283..ca05356f96964 100644 --- a/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py @@ -5,18 +5,21 @@ Test that breakpoints set on a bad address say they are bad. from __future__ import print_function - -import os, time +import os +import time import re import lldb import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest import * + class BadAddressBreakpointTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - def test_bad_address_breakpoints (self): + NO_DEBUG_INFO_TESTCASE = True + + def test_bad_address_breakpoints(self): """Test that breakpoints set on a bad address say they are bad.""" self.build() self.address_breakpoints() @@ -34,7 +37,8 @@ class BadAddressBreakpointTestCase(TestBase): self.assertTrue(target, VALID_TARGET) # Now create a breakpoint on main.c by name 'c'. - breakpoint = target.BreakpointCreateBySourceRegex("Set a breakpoint here", lldb.SBFileSpec("main.c")) + breakpoint = target.BreakpointCreateBySourceRegex( + "Set a breakpoint here", lldb.SBFileSpec("main.c")) self.assertTrue(breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT) @@ -47,16 +51,18 @@ class BadAddressBreakpointTestCase(TestBase): VALID_BREAKPOINT_LOCATION) launch_info = lldb.SBLaunchInfo(None) - + error = lldb.SBError() - process = target.Launch (launch_info, error) + process = target.Launch(launch_info, error) self.assertTrue(process, PROCESS_IS_VALID) # Did we hit our breakpoint? - from lldbsuite.test.lldbutil import get_threads_stopped_at_breakpoint - threads = get_threads_stopped_at_breakpoint (process, breakpoint) - self.assertTrue(len(threads) == 1, "There should be a thread stopped at our breakpoint") + from lldbsuite.test.lldbutil import get_threads_stopped_at_breakpoint + threads = get_threads_stopped_at_breakpoint(process, breakpoint) + self.assertTrue( + len(threads) == 1, + "There should be a thread stopped at our breakpoint") # The hit count for the breakpoint should be 1. self.assertTrue(breakpoint.GetHitCount() == 1) @@ -72,6 +78,5 @@ class BadAddressBreakpointTestCase(TestBase): for bp_loc in bkpt: self.assertTrue(bp_loc.IsResolved() == False) else: - self.fail("Could not find an illegal address at which to set a bad breakpoint.") - - + self.fail( + "Could not find an illegal address at which to set a bad breakpoint.") |