2 Test that you can set breakpoint and hit the C++ language exception breakpoint
5 from __future__ import print_function
12 from lldbsuite.test.decorators import *
13 from lldbsuite.test.lldbtest import *
14 from lldbsuite.test import lldbutil
17 class TestCPPExceptionBreakpoint (TestBase):
19 mydir = TestBase.compute_mydir(__file__)
22 @add_test_categories(['pyapi'])
23 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24538")
24 def test_cpp_exception_breakpoint(self):
25 """Test setting and hitting the C++ exception breakpoint."""
27 self.do_cpp_exception_bkpt()
31 self.main_source = "main.c"
32 self.main_source_spec = lldb.SBFileSpec(self.main_source)
34 def do_cpp_exception_bkpt(self):
35 exe = os.path.join(os.getcwd(), "a.out")
36 error = lldb.SBError()
38 self.target = self.dbg.CreateTarget(exe)
39 self.assertTrue(self.target, VALID_TARGET)
41 exception_bkpt = self.target.BreakpointCreateForException(
42 lldb.eLanguageTypeC_plus_plus, False, True)
44 exception_bkpt.IsValid(),
45 "Created exception breakpoint.")
47 process = self.target.LaunchSimple(
48 None, None, self.get_process_working_directory())
49 self.assertTrue(process, PROCESS_IS_VALID)
51 thread_list = lldbutil.get_threads_stopped_at_breakpoint(
52 process, exception_bkpt)
53 self.assertTrue(len(thread_list) == 1,
54 "One thread stopped at the exception breakpoint.")