2 Test lldb-vscode setBreakpoints request
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
11 import lldbvscode_testcase
14 class TestVSCode_setExceptionBreakpoints(
15 lldbvscode_testcase.VSCodeTestCaseBase):
17 mydir = TestBase.compute_mydir(__file__)
20 @expectedFailureNetBSD
21 def test_functionality(self):
22 '''Tests setting and clearing exception breakpoints.
23 This packet is a bit tricky on the debug adaptor side since there
24 is no "clear exception breakpoints" packet. Exception breakpoints
25 are set by sending a "setExceptionBreakpoints" packet with zero or
26 more exception filters. If exception breakpoints have been set
27 before, any exising breakpoints must remain set, and any new
28 breakpoints must be created, and any breakpoints that were in
29 previous requests and are not in the current request must be
30 removed. This exception tests this setting and clearing and makes
31 sure things happen correctly. It doesn't test hitting breakpoints
32 and the functionality of each breakpoint, like 'conditions' and
33 x'hitCondition' settings.
35 # Visual Studio Code Debug Adaptors have no way to specify the file
36 # without launching or attaching to a process, so we must start a
37 # process in order to be able to set breakpoints.
38 program = self.getBuildArtifact("a.out")
39 self.build_and_launch(program)
41 filters = ['cpp_throw', 'cpp_catch']
42 response = self.vscode.request_setExceptionBreakpoints(filters)
44 self.assertTrue(response['success'])
46 self.continue_to_exception_breakpoint('C++ Throw')
47 self.continue_to_exception_breakpoint('C++ Catch')