gpt4 book ai didi

ios - UnCaughtException 处理程序 : decode backtrace symbol

转载 作者:可可西里 更新时间:2023-11-01 05:44:22 44 4
gpt4 key购买 nike

我正在尝试获取回溯符号,如下所示的 Xcode 列表

*** First throw call stack:
(
0 CoreFoundation 0x018865e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x016098b6 objc_exception_throw + 44
2 CoreFoundation 0x01923903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0187690b ___forwarding___ + 1019
4 CoreFoundation 0x018764ee _CF_forwarding_prep_0 + 14
5 Foundation 0x0124036c __NSFireDelayedPerform + 372
6 CoreFoundation 0x01844c46 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
7 CoreFoundation 0x0184462d __CFRunLoopDoTimer + 1181
8 CoreFoundation 0x0182c698 __CFRunLoopRun + 1816
9 CoreFoundation 0x0182bb33 CFRunLoopRunSpecific + 467
10 CoreFoundation 0x0182b94b CFRunLoopRunInMode + 123
11 GraphicsServices 0x02c249d7 GSEventRunModal + 192
12 GraphicsServices 0x02c247fe GSEventRun + 104
13 UIKit 0x0037c94b UIApplicationMain + 1225
14 CrashHandler 0x000088ad main + 141
15 libdyld.dylib 0x06244725 start + 0
16 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

我正在尝试从 NSException 中提取符号,如下代码所示。并且只有更少的信息可用。

-(void)handleException:(NSException*)exception
{

[exception callStackSymbols]//I've written this into file.

}

我得到如下输出

*** First throw call stack: (
0 CoreFoundation 0x326bd2bb <redacted> + 186
1 libobjc.A.dylib 0x3a33b97f objc_exception_throw + 30
2 CoreFoundation 0x326c0e07 <redacted> + 170
3 CoreFoundation 0x326bf531 <redacted> + 392
4 CoreFoundation 0x32616f68 _CF_forwarding_prep_0 + 24
5 Foundation 0x32fcb277 <redacted> + 450
6 CoreFoundation 0x326925df <redacted> + 14
7 CoreFoundation 0x32692291 <redacted> + 272
8 CoreFoundation 0x32690f01 <redacted> + 1232
9 CoreFoundation 0x32603ebd CFRunLoopRunSpecific + 356
10 CoreFoundation 0x32603d49 CFRunLoopRunInMode + 104
11 GraphicsServices 0x361b62eb GSEventRunModal + 74
12 UIKit 0x34519301 UIApplicationMain + 1120
13 CrashHandler 0x0007f421 main + 116
14 libdyld.dylib 0x3a772b20 <redacted> + 0
)

如何解码<redacted>象征?

引用与理解:

我引用了 SO post1 , SO post2但它需要 dSYM文件,我们必须像 testflight 一样手动解码。没有 dSYM 文件,怎么办?

最佳答案

符号化是将内存地址转换为包含以下全部或部分元素的符号的过程:

  • class name
  • method name
  • file name
  • line number

当在设备上使用应用程序符号作为应用程序二进制文件的一部分进行符号化时,只有 class namemethod name可以检索。无法获得 file nameline number这样。

使用应用程序 dSYM 进行符号化时,只要在构建应用程序时所有信息可用,就可以获得所有数据。例如。使用第三方静态库时,这些调用可能会丢失文件名和行号。

<redacted>当在设备上符号化系统框架地址时,符号只能显示系统调用。 class name的原因和/或 method name不显示是 iOS 内存优化。可以在此处找到对此的解释:https://devforums.apple.com/thread/171264要符号化这些地址,您需要具有 iOS 版本的 iOS 符号和用于在符号化报告的计算机上创建堆栈跟踪的 CPU 体系结构。

可以将这些符号作为 Xcode 的一部分获取,或者将特定 iOS 版本和 CPU 架构的设备连接到 Xcode,然后 Xcode 将获取这些符号。请注意,例如对于没有更新 SDK 的 iOS 错误修复版本,获取符号的唯一方法是使用设备。

计算机上的符号可以使用 Xcode 管理器或手动使用 symbolciatecrash.pl 完成在终端中手 Action 为 Xcode 一部分的脚本。

要使用 Xcode 或脚本进行符号化,您需要一份完整的崩溃报告,其中包含比您发布的堆栈跟踪信息更多的信息。

使用atos要手动符号化报告的帧地址,您还需要帧引用的每个二进制文件的加载地址,例如来自 Foundation , CoreFoundation , UIKit .显示的堆栈跟踪不提供此信息。 StackOverflow 上有多个帖子如何使用 atos手动。

关于ios - UnCaughtException 处理程序 : decode backtrace symbol,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23534058/

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