感谢上面的所有答案,< em > unsafeBitCast 也可以很好地与 Xcode 8.3.2/Swift 3/macOS/Cocoa Application 一起工作。
记住当前实例的地址
(lldb) p tabView.controlTint
(NSControlTint) $R10 = defaultControlTint
(lldb) p self
(LearningStoryboard.NSTabViewController) $R11 = 0x00006080000e2280 {
.....
稍后,检查他们
(lldb) p unsafeBitCast(0x00006080000e2280, to: NSTabViewController.self).tabView.controlTint
(NSControlTint) $R20 = graphiteControlTint
(lldb) p $R11.tabView.controlTint
(NSControlTint) $R21 = graphiteControlTint
如果发生这种事
(lldb) p unsafeBitCast(0x00006080000e2280, to: NSTabViewController.self).tabView.controlTint
error: use of undeclared identifier 'to'
(lldb) p $R11.tabView.controlTint
error: use of undeclared identifier '$R11'
确保选择 Swift 源代码的堆栈框架而不是汇编框架。
It is likely to happen when the application was paused by clicking a 暂停 button or stopped with an exception. By choosing a stack frame accordingly, let lldb infer a proper programing language.