1import lldb 2from lldbsuite.test.lldbtest import * 3from lldbsuite.test.decorators import * 4from lldbsuite.test import lldbutil 5 6 7class TestCase(TestBase): 8 @skipUnlessDarwin 9 def test_objc_self(self): 10 self.build() 11 lldbutil.run_to_source_breakpoint( 12 self, "// check self", lldb.SBFileSpec("main.m") 13 ) 14 self.expect("frame variable _ivar", startstr="(int) _ivar = 30") 15 16 @skipUnlessDarwin 17 def test_objc_self_capture_idiom(self): 18 self.build() 19 lldbutil.run_to_source_breakpoint( 20 self, "// check idiomatic self", lldb.SBFileSpec("main.m") 21 ) 22 self.expect("frame variable weakSelf", startstr="(Classic *) weakSelf = 0x") 23 self.expect("frame variable self", startstr="(Classic *) self = 0x") 24 self.expect("frame variable _ivar", startstr="(int) _ivar = 30") 25