28 lines · python
1"""2Test dwim-print with objc instances.3"""4 5import lldb6from lldbsuite.test.lldbtest import *7from lldbsuite.test.decorators import *8import lldbsuite.test.lldbutil as lldbutil9 10 11class TestCase(TestBase):12 @skipUnlessDarwin13 def test(self):14 self.build()15 lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.m"))16 self.expect("dwim-print parent", substrs=["_child = 0x"])17 self.expect(18 "dwim-print parent.child", patterns=[r'_name = 0x[0-9a-f]+ @"Seven"']19 )20 21 @skipUnlessDarwin22 def test_with_summary(self):23 self.build()24 lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.m"))25 self.runCmd("type summary add -s 'Parent of ${var._child._name}' 'Parent *'")26 self.expect("dwim-print parent", matching=False, substrs=["_child = 0x"])27 self.expect("dwim-print parent", substrs=['Parent of @"Seven"'])28