40 lines · python
1import lldb2from lldbsuite.test.decorators import *3from lldbsuite.test.lldbtest import *4from lldbsuite.test import lldbutil5 6 7class TestIvarInFrameworkBase(TestBase):8 """9 Tests whether LLDB's data inspection commands can correctly retrieve10 information about ivars from the Objective-C runtime.11 In this test-case we have a base class type for which we don't have access12 to the debug-info of the implementation (mimicking the scenario of subclassing13 a type from a system framework). LLDB won't be able to see the backing ivar for14 'fooProp' from just debug-info, but it will fall back on the runtime to get the15 necessary information.16 """17 18 def test_frame_var(self):19 self.build()20 lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.m"))21 self.expect("frame variable *bar", substrs=["_fooProp = 10", "_barProp = 15"])22 23 def test_expr(self):24 self.build()25 lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.m"))26 self.expect_expr(27 "*bar",28 result_type="Bar",29 result_children=[30 ValueCheck(31 name="Foo",32 children=[33 ValueCheck(name="NSObject"),34 ValueCheck(name="_fooProp", value="10"),35 ],36 ),37 ValueCheck(name="_barProp", value="15"),38 ],39 )40