2 Test that breakpoints set on a bad address say they are bad.
8 import lldbsuite.test.lldbutil as lldbutil
9 from lldbsuite.test.lldbtest import *
12 class BadAddressBreakpointTestCase(TestBase):
14 mydir = TestBase.compute_mydir(__file__)
16 NO_DEBUG_INFO_TESTCASE = True
18 def test_bad_address_breakpoints(self):
19 """Test that breakpoints set on a bad address say they are bad."""
21 self.address_breakpoints()
23 def address_breakpoints(self):
24 """Test that breakpoints set on a bad address say they are bad."""
25 target, process, thread, bkpt = \
26 lldbutil.run_to_source_breakpoint(self,
27 "Set a breakpoint here",
28 lldb.SBFileSpec("main.c"))
30 # Now see if we can read from 0. If I can't do that, I don't
31 # have a good way to know what an illegal address is...
32 error = lldb.SBError()
34 ptr = process.ReadPointerFromMemory(0x0, error)
36 if not error.Success():
37 bkpt = target.BreakpointCreateByAddress(0x0)
39 self.assertTrue(bp_loc.IsResolved() == False)
42 "Could not find an illegal address at which to set a bad breakpoint.")