ios - Unable to use po command in console (debug area)
问题描述
Suddenly I have started to get this message randomly ( but pretty much often)
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 has changed in Xcode 10.2. Apple recommends use of 'p' or more recently 'v' to view the values of variables.
from the Xcode 10.2 Release Notes
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)
There is also good information on this in the LLDB Tutorial in the section named Examining Stack Frame State.
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>
推荐阅读
- postgresql - 为 where 子句中传递的每条记录获取 1 0r 0
- python - 无法使用 Python 脚本执行 SQL 系统过程
- oracle - 如何解决:ORA-02019:找不到远程数据库的连接描述?
- c++ - 在 c++ Visual Studio 中遇到 strcat 和 strcpy 的问题
- c# - 当“应用程序所有者”是管理员而不是登录用户时,如何使用 C# 在 Windows 服务器中登录用户?
- postgresql - Postgres,从表A中选择所有记录并在条件下与B的可能现有记录左连接?
- cadence-workflow - 在断开连接的系统中跟踪
- rethinkdb - 按作者和在 unix 时间戳之间过滤数据库条目
- azure - 带有事件中心输出的门户上的 Azure 函数
- javascript - 如何通过 axios 调用具有基本身份验证的远程服务器?