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_interface(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")
17 lldbutil
.run_to_source_breakpoint(
19 "// Set breakpoint where Bar is an interface",
20 lldb
.SBFileSpec("Foo.m", False),
23 # Break inside the foo function which takes a bar_ptr argument.
24 self
.expect('breakpoint set -p "// Set breakpoint in main"')
25 self
.runCmd("continue", RUN_SUCCEEDED
)
28 lldbutil
.check_breakpoint(self
, bpno
=1, expected_hit_count
=1)
30 self
.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
32 # This should display correctly.
34 "frame variable foo->_bar->_hidden_ivar",
35 VARIABLES_DISPLAYED_CORRECTLY
,
36 substrs
=["(NSString *)", "foo->_bar->_hidden_ivar = 0x"],
39 def test_frame_var_after_stop_at_implementation(self
):
40 """Test that we can find the implementation for an objective C type"""
41 if self
.getArchitecture() == "i386":
42 self
.skipTest("requires modern objc runtime")
45 lldbutil
.run_to_source_breakpoint(
47 "// Set breakpoint where Bar is an implementation",
48 lldb
.SBFileSpec("Bar.m", False),
51 self
.expect('breakpoint set -p "// Set breakpoint in main"')
52 self
.runCmd("continue", RUN_SUCCEEDED
)
55 lldbutil
.check_breakpoint(self
, bpno
=1, expected_hit_count
=1)
57 self
.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
59 # This should display correctly.
61 "frame variable foo->_bar->_hidden_ivar",
62 VARIABLES_DISPLAYED_CORRECTLY
,
63 substrs
=["(NSString *)", "foo->_bar->_hidden_ivar = 0x"],