4439607d91cfca3713ef00b1fde51d6cf83b27b3
[openbsd] /
1 """
2 Test that we can hit breakpoints in global constructors
3 """
4
5
6
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
11
12
13 class TestBreakpointInGlobalConstructors(TestBase):
14
15     mydir = TestBase.compute_mydir(__file__)
16     NO_DEBUG_INFO_TESTCASE = True
17
18     @expectedFailureNetBSD
19     def test(self):
20         self.build()
21         self.line_foo = line_number('foo.cpp', '// !BR_foo')
22         self.line_main = line_number('main.cpp', '// !BR_main')
23
24         target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
25         self.assertTrue(target, VALID_TARGET)
26
27         env= self.registerSharedLibrariesWithTarget(target, ["foo"])
28
29         bp_main = lldbutil.run_break_set_by_file_and_line(
30             self, 'main.cpp', self.line_main)
31
32         bp_foo = lldbutil.run_break_set_by_file_and_line(
33             self, 'foo.cpp', self.line_foo, num_expected_locations=-2)
34
35         process = target.LaunchSimple(
36             None, env, self.get_process_working_directory())
37
38         self.assertIsNotNone(
39             lldbutil.get_one_thread_stopped_at_breakpoint_id(
40                 self.process(), bp_foo))
41
42         self.runCmd("continue")
43
44         self.assertIsNotNone(
45             lldbutil.get_one_thread_stopped_at_breakpoint_id(
46                 self.process(), bp_main))