为什么有时当我尝试像这样在控制台中打印时:
po trip.id
我得到:
error: <EXPR>:1:11: error: use of undeclared type '$__lldb_context'
extension $__lldb_context {
^~~~~~~~~~~~~~~
<EXPR>:16:5: error: use of unresolved identifier '$__lldb_injected_self'
$__lldb_injected_self.$__lldb_wrapped_expr_79(
^~~~~~~~~~~~~~~~~~~~~
或
error: <EXPR>:1:11: error: cannot find type '$__lldb_context' in scope
extension $__lldb_context {
^~~~~~~~~~~~~~~
有什么办法可以解决吗?
最佳答案
为了让表达式像被注入(inject)到当前选定的帧中一样运行,我们需要构造一个具有适当的 self 参数的上下文(例如,某种类扩展),并评估表达式中的代码那个上下文。显然,您尝试打印“trip.id”的上下文是调试器无法重建的上下文。如果您可以使用 http://bugreporter.apple.com 提交错误报告这一点,我们可以弄清楚如何支持这一点。
如果您没有使用 Xcode 8.0,您可以尝试一下,修复了一堆此类错误。
lldb 有另一个命令,“frame variable”,它提供对局部变量的快速访问。它不能运行函数调用等,但由于它不那么雄心勃勃,所以有时更健壮。你可能会尝试这样的事情:
(lldb) frame variable -O trip.id
关于swift - LLDB 输出错误 : use of undeclared type '$__lldb_context' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39769254/