无法在控制台(调试区域)中使用po命令 [英] Unable to use po command in console (debug area)

查看:86
本文介绍了无法在控制台(调试区域)中使用po命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然我开始随机收到此消息(但很多时候)

Suddenly I have started to get this message randomly ( but pretty much often)

表达式产生的错误:警告: /var/folders/53/0z4yfqt16tvbcn0z7f2385n80000gn/T/expr3-d271e2..swift:3:9: 警告:从未初始化变量'$ __ lldb_error_result' 用过的;考虑将赋值替换为"_"或将其删除 var $ __ lldb_error_result = __lldb_tmp_error ~~~~ ^ ~~~~~~~~~~~~~~~~~~~ _

expression produced error: warning: /var/folders/53/0z4yfqt16tvbcn0z7f2385n80000gn/T/expr3-d271e2..swift:3:9: warning: initialization of variable '$__lldb_error_result' was never used; consider replacing with assignment to '_' or removing it var $__lldb_error_result = __lldb_tmp_error ~~~~^~~~~~~~~~~~~~~~~~~~ _

当我尝试在控制台中键入以下内容时:

when I try to type something like this in console:

po myObject

因此,控制台仅在上面打印消息,而不是给我一些有用的信息……如何解决此问题以及导致该问题的原因?

So, the console prints only message above, rather than it gives me something useful... How to fix this, and what caused it?

推荐答案

lldb在Xcode 10.2中已更改. Apple建议使用"p"或更新的"v"来查看变量的值.

lldb has changed in Xcode 10.2. Apple recommends use of 'p' or more recently 'v' to view the values of variables.

摘自 Xcode 10.2发行说明

LLDB调试器具有一个新的命令别名v,用于框架变量"命令,以在当前堆栈框架中打印变量.因为v绕过了表达式求值器,所以v可以快很多,应该优先于p或po. (40066460)

The LLDB debugger has a new command alias, v, for the "frame variable" command to print variables in the current stack frame. Because it bypasses the expression evaluator, v can be a lot faster and should be preferred over p or po. (40066460)

LLDB教程部分中,也对此有很好的信息. >检查堆栈框架状态.

frame variable命令还将对变量执行对象打印"操作(当前,我们仅使用对象的"description"方法支持ObjC打印.通过将-o标志传递给frame变量将其打开:

The frame variable command will also perform "object printing" operations on variables (currently we only support ObjC printing, using the object's "description" method. Turn this on by passing the -o flag to frame variable:

(lldb) frame variable -o self 
(SKTGraphicView *) self = 0x0000000100208b40 
<SKTGraphicView: 0x100208b40>

这篇关于无法在控制台(调试区域)中使用po命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆