加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – 如何在XCode 4.6中获取异常详细信息?

发布时间:2020-12-15 01:46:18 所属栏目:百科 来源:网络整理
导读:我曾经从模拟器中运行的应用程序中获取异常详细信息,如下所示: po $eax 自从我升级到XCode 4.6后,它就停止了工作;我总是得到这个错误: error: warning: couldn't get object pointer (substituting NULL):Couldn't find '_cmd' with appropriate type in s
我曾经从模拟器中运行的应用程序中获取异常详细信息,如下所示:

po $eax

自从我升级到XCode 4.6后,它就停止了工作;我总是得到这个错误:

error: warning: couldn't get object pointer (substituting NULL):
Couldn't find '_cmd' with appropriate type in scope
Couldn't materialize struct: Couldn't read eax (materialize)
Errored out in Execute,couldn't PrepareToExecuteJITExpression

我见过人们推荐使用这个:

register read eax

但这给了我这个错误:

eax          = error: unavailable

如何在XCode 4.6中获取异常详细信息?

解决方法

如果在objc_exception_throw中断,则在调用可能抛出异常的任何库之前,所选的堆栈帧是代码中的最后一帧.此时lldb不允许您访问某些寄存器(有关可能的解释,请参阅 this answer).

要获取异常详细信息,您必须选择objc_exception_throw堆栈帧:

现在po $eax(如果你在OS X 64位上运行po $rax,在iPhone / iPad上运行po $r0,在arm64上运行po $x0)应该给你异常细节.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读