gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 02:55:41 25 4
gpt4 key购买 nike

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

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

这是代码停止的地方:

eax = 0x0d3c73f0ebx = 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:103ebp = 0xbfffc928esp = 0xbfffc91css = 0x00000023eflags = 0x00000286eip = 0x03a738b9  libobjc.A.dylib`objc_exception_throwcs = 0x0000001bds = 0x00000023es = 0x00000023fs = 0x00000000gs = 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com