f49858ca4f3deeffbb84ea3be1a3b10905a4c972
[openbsd] /
1 """Test that types defined in shared libraries work correctly."""
2
3
4
5 import lldb
6 from lldbsuite.test.decorators import *
7 from lldbsuite.test.lldbtest import *
8 from lldbsuite.test import lldbutil
9
10
11 class TestRealDefinition(TestBase):
12
13     mydir = TestBase.compute_mydir(__file__)
14
15     @skipUnlessDarwin
16     def test_frame_var_after_stop_at_implementation(self):
17         """Test that we can find the implementation for an objective C type"""
18         if self.getArchitecture() == 'i386':
19             self.skipTest("requires modern objc runtime")
20         self.build()
21         self.shlib_names = ["libTestExt.dylib", "libTest.dylib"]
22         self.common_setup()
23
24         line = line_number('TestExt/TestExt.m', '// break here')
25         lldbutil.run_break_set_by_file_and_line(
26             self, 'TestExt.m', line, num_expected_locations=1, loc_exact=True)
27
28         self.runCmd("run", RUN_SUCCEEDED)
29
30         # The stop reason of the thread should be breakpoint.
31         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
32                     substrs=['stopped',
33                              'stop reason = breakpoint'])
34
35         self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
36                     substrs=[' resolved, hit count = 1'])
37
38         # This should display correctly.
39         self.expect(
40             "expr 42",
41             "A simple expression should execute correctly",
42             substrs=[
43                 "42"])
44
45     def common_setup(self):
46         exe = self.getBuildArtifact("a.out")
47         target = self.dbg.CreateTarget(exe)
48         self.registerSharedLibrariesWithTarget(target, self.shlib_names)
49
50         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)