ios - LLDB 从库中打印出 NSException 名称或类

标签 ios xcode debugging lldb

在 Xcode 中,我使用“所有 Objective-C 异常”断点,但我想跳过一些特定的 NSException。 我在 this 中找到文章介绍了有关如何跳过某些特定 NSException 名称的所有信息,它非常适合我放入代码中的所有 @try{} @catch

不幸的是,我被迫使用一个大量使用 @try @catch 作为对象之间通信方式的库,当应用程序在断点处停止时,我无法知道确切的 NSException 名称。

这是代码停止的地方:

eax = 0x0d3c73f0
ebx = 0x00a675a8  @"databaseName"
ecx = 0x00b61d01  
edx = 0x00b61d01  
edi = 0x00a655a8  @"MessagingClientLib: initInstance must be called prior to getInstanceRuntimeException: Application ID is required"
esi = 0x000039d1  iDCP`-[UIView(FrameMucking) setOrigin:] + 65 at UIView+FrameMocking.h:103
ebp = 0xbfffc928
esp = 0xbfffc91c
ss = 0x00000023
eflags = 0x00000286
eip = 0x03a738b9  libobjc.A.dylib`objc_exception_throw
cs = 0x0000001b
ds = 0x00000023
es = 0x00000023
fs = 0x00000000
gs = 0x0000000f

有什么建议吗?

最佳答案

选择 objc_exception_throw 的堆栈帧,然后输入此命令:

(lldb) po *(id *)($esp + 4) // reason
(lldb) po *(id *)($esp + 12) // name

关于ios - LLDB 从库中打印出 NSException 名称或类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23932959/

相关文章:

java - 使用 eclipse 远程调试 jnlp 应用程序

swift - 我在 Swift 中对地址(罕见)进行地理编码时出错

.net - 调试Azure部署(无法浏览)

ios - 尝试构建 DisplayCandy 时,终端给我这个错误

ios - CocoaLibSpotify - 接收远程控制事件并设置正在播放信息

ios - 忽略文件 SDWebImage.framework,缺少所需的体系结构 x86_64

ios - 错误信息 : [MC] Reading from public effective user settings & [MC] System group container for systemgroup. com.apple.configurationprofiles 路径是

ios - Xcode 上的多个 UIwebView

ios - 自定义 iOS ChartBar

ios - 使用 Storyboard从 xib 或其他场景添加 subview