1 """Test that types defined in shared libraries work correctly."""
5 from lldbsuite
.test
.decorators
import *
6 from lldbsuite
.test
.lldbtest
import *
7 from lldbsuite
.test
import lldbutil
10 class TestRealDefinition(TestBase
):
11 def test_frame_var_after_stop_at_implementation(self
):
12 """Test that we can find the implementation for an objective C type"""
13 if self
.getArchitecture() == "i386":
14 self
.skipTest("requires modern objc runtime")
16 self
.shlib_names
= ["libTestExt.dylib", "libTest.dylib"]
19 line
= line_number("TestExt/TestExt.m", "// break here")
20 lldbutil
.run_break_set_by_file_and_line(
21 self
, "TestExt.m", line
, num_expected_locations
=1, loc_exact
=True
24 self
.runCmd("run", RUN_SUCCEEDED
)
26 # The stop reason of the thread should be breakpoint.
29 STOPPED_DUE_TO_BREAKPOINT
,
30 substrs
=["stopped", "stop reason = breakpoint"],
33 lldbutil
.check_breakpoint(self
, bpno
=1, expected_hit_count
=1)
35 # This should display correctly.
37 "expr 42", "A simple expression should execute correctly", substrs
=["42"]
40 def common_setup(self
):
41 exe
= self
.getBuildArtifact("a.out")
42 target
= self
.dbg
.CreateTarget(exe
)
43 self
.registerSharedLibrariesWithTarget(target
, self
.shlib_names
)
45 self
.runCmd("file " + exe
, CURRENT_EXECUTABLE_SET
)