gpt4 book ai didi

PLCrashReporter - 如何符号化进程中的崩溃数据?

转载 作者:行者123 更新时间:2023-12-04 19:14:08 26 4
gpt4 key购买 nike

在我们获得崩溃数据后,有没有办法对崩溃报告进行符号化?

目前,这就是我在 handleCrashReport 方法中所做的;

PLCrashReportTextFormat textFormat = PLCrashReportTextFormatiOS;

/* Decode data */

PLCrashReport *crashLog = [[PLCrashReport alloc] initWithData: data error: &error];
if (crashLog == nil) {
NSLog(@"Could not decode crash file :%@", [[error localizedDescription] UTF8String]);
} else {
NSString* report = [PLCrashReportTextFormatter stringValueForCrashReport: crashLog withTextFormat: textFormat];
NSLog(@"Crash log \n\n\n%@ \n\n\n", report);

NSString *outputPath = [documentsDirectory stringByAppendingPathComponent: @"app.crash"];
if (![report writeToFile:outputPath atomically:YES encoding:NSUTF8StringEncoding error:nil]) {
NSLog(@"Failed to write crash report");
} else {
NSLog(@"Saved crash report to: %@", outputPath);
}

}

当我在控制台上打印出来时;我明白了。
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This should crash the application.'

Thread 0 Crashed:
0 libsystem_kernel.dylib 0x93a0d9c6 0x939f5000 + 100806
1 libsystem_c.dylib 0x9c5aabdd 0x9c55b000 + 326621
2 shell 0x00082a2c 0x1000 + 530988
3 CoreFoundation 0x0263d0fc 0x253f000 + 1040636
4 libobjc.A.dylib 0x00f8ef0f 0xf89000 + 24335
5 libc++abi.dylib 0x02a028de 0x29fd000 + 22750
6 libc++abi.dylib 0x02a02946 0x29fd000 + 22854
7 libc++abi.dylib 0x02a03b3e 0x29fd000 + 27454
8 libobjc.A.dylib 0x00f8ee15 0xf89000 + 24085
9 CoreFoundation 0x02573de0 0x253f000 + 216544
10 CoreFoundation 0x02573c9b 0x253f000 + 216219
11 UIKit 0x0150ac65 0x1501000 + 40037
12 UIKit 0x0150c626 0x1501000 + 46630
13 shell 0x00002fed 0x1000 + 8173
14 shell 0x00001f95 0x1000 + 3989

Thread 1:
0 libsystem_kernel.dylib 0x93a0e90a 0x939f5000 + 104714
1 libdispatch.dylib 0x02ad2be1 0x2ad1000 + 7137

Thread 2:
0 libsystem_kernel.dylib 0x93a0bc22 0x939f5000 + 93218
1 libsystem_notify.dylib 0x97cb9cd2 0x97cb8000 + 7378
2 libsystem_notify.dylib 0x97cbdb4b 0x97cb8000 + 23371
3 libsystem_c.dylib 0x9c5e859b 0x9c55b000 + 578971
4 CoreFoundation 0x025e61c3 0x253f000 + 684483
5 CoreFoundation 0x025e5d83 0x253f000 + 683395
6 Foundation 0x00caab53 0xc34000 + 486227
7 Foundation 0x00caaac5 0xc34000 + 486085
8 shell 0x003ddbf8 0x1000 + 4049912
9 libdispatch.dylib 0x02ad2330 0x2ad1000 + 4912
10 libdispatch.dylib 0x02ad3f0c 0x2ad1000 + 12044
11 libdispatch.dylib 0x02ad3cb4 0x2ad1000 + 11444
12 libdispatch.dylib 0x02ad3402 0x2ad1000 + 9218
13 libsystem_c.dylib 0x9c5b9b24 0x9c55b000 + 387876
14 libsystem_c.dylib 0x9c5bb6fe 0x9c55b000 + 395006

如果可能的话,我想在进程中进行符号化。有任何想法吗?

非常感谢。

最佳答案

您可以符号化正在处理的崩溃报告,这需要三件事:

  • 您应该只在下一个应用程序启动时执行此操作。
  • 您需要应用程序符号成为二进制文件的一部分,这会将其大小增加 30-50%
  • 你不会得到行号。

  • 最新版本的 PLCrashReporter 能够做到这一点,但我不推荐它,而是使用 dSYM 对其进行符号化,因为它更有帮助。

    关于PLCrashReporter - 如何符号化进程中的崩溃数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11814155/

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