[libc][NFC] Remove extra ; in exhaustive_test.h. (#124216)
[llvm-project.git] / lldb / test / API / lang / cpp / break-on-initializers / TestBreakOnCPP11Initializers.py
blobd044216fe6e52db061c9f8b6c9a76073399993e4
1 """
2 When using C++11 in place member initialization, show that we
3 can set and hit breakpoints on initialization lines. This is a
4 little bit tricky because we try not to move file and line breakpoints
5 across function boundaries but these lines are outside the source range
6 of the constructor.
7 """
10 import lldb
11 import lldbsuite.test.lldbutil as lldbutil
12 from lldbsuite.test.lldbtest import *
15 class TestCase(TestBase):
16 def test_breakpoints_on_initializers(self):
17 """Show we can set breakpoints on initializers appearing both before
18 and after the constructor body, and hit them."""
19 self.build()
20 self.main_source_file = lldb.SBFileSpec("main.cpp")
21 self.first_initializer_line = line_number(
22 "main.cpp", "Set the before constructor breakpoint here"
24 self.second_initializer_line = line_number(
25 "main.cpp", "Set the after constructor breakpoint here"
28 (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
29 self, " Set a breakpoint here to get started", self.main_source_file
32 # Now set breakpoints on the two initializer lines we found in the test startup:
33 bkpt1 = target.BreakpointCreateByLocation(
34 self.main_source_file, self.first_initializer_line
36 self.assertEqual(bkpt1.GetNumLocations(), 1)
37 bkpt2 = target.BreakpointCreateByLocation(
38 self.main_source_file, self.second_initializer_line
40 self.assertEqual(bkpt2.GetNumLocations(), 1)
42 # Now continue, we should stop at the two breakpoints above, first the one before, then
43 # the one after.
44 self.assertEqual(
45 len(lldbutil.continue_to_breakpoint(process, bkpt1)),
47 "Hit first breakpoint",
49 self.assertEqual(
50 len(lldbutil.continue_to_breakpoint(process, bkpt2)),
52 "Hit second breakpoint",