| 1 |
""" |
| 2 |
Test dwim-print with objc instances. |
| 3 |
""" |
| 4 |
|
| 5 |
import lldb |
| 6 |
from lldbsuite.test.lldbtest import * |
| 7 |
from lldbsuite.test.decorators import * |
| 8 |
import lldbsuite.test.lldbutil as lldbutil |
| 9 |
|
| 10 |
|
| 11 |
class TestCase(TestBase): |
| 12 |
@skipUnlessDarwin |
| 13 |
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 |
@skipUnlessDarwin |
| 22 |
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"']) |