xcode 如何使用atos手动符号化崩溃日志

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13970959/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:22:16  来源:igfitidea点击:

How to manually symbolicate a crash log with atos

xcodeterminalmemory-addresssymbolicatecrashcrash-log

提问by Fitzy

After searching all over the internet to find a way to symbolicate my crash logs I received from Apple, I finally figured out how to use the atos command in terminal to symbolicate the crash logs. I have the dSYM file, the .app file and the crash logs in the same folder, and using atos -arch armv7 -o APPNAMEI have been able to enter memory addresses, and sometimes (but quite rarely) a method name has come up. To be perfectly honest, I don't have much experience with terminal, or crash logs. Attempting to symbolicate the crash logs from Xcode's organiser has unfortunately done absolutely nothing, and trying to use the symbolicatecrashfile within Xcode's package contents has also failed. So here I am, left with the only other option I know of.

在互联网上搜索以找到一种方法来符号化我从 Apple 收到的崩溃日志后,我终于想出了如何在终端中使用 atos 命令来符号化崩溃日志。我在同一个文件夹中有 dSYM 文件、.app 文件和崩溃日志,并且使用atos -arch armv7 -o APPNAME我已经能够输入内存地址,有时(但很少)会出现方法名称。老实说,我对终端或崩溃日志没有太多经验。不幸的是,尝试符号化来自 Xcode 组织者的崩溃日志完全没有做任何事情,并且尝试symbolicatecrash在 Xcode 的包内容中使用该文件也失败了。所以我在这里,剩下我所知道的唯一其他选择。

Now, my question is this: how does one go about making heads or tails of these memory addresses? Which addresses must I enter to arrive at the point at which the app crashed? I am 90% of the way there, I just don't know which addresses will give me valuable information or which are useless. Attached here is a picture of a crash log:

现在,我的问题是:如何处理这些内存地址的正面或反面?我必须输入哪些地址才能到达应用程序崩溃的点?我已经完成了 90% 的工作,我只是不知道哪些地址会给我提供有价值的信息,哪些地址没有用。附上一张崩溃日志的图片:

enter image description here

在此处输入图片说明

Any help is greatly appreciated.

任何帮助是极大的赞赏。

回答by Matt Hudson

My guess is that you saw the Stackoverflow question with the atos information in it (like I did), but are not calculating the address correctly to put into atos. See here:

我的猜测是您看到了 Stackoverflow 问题,其中包含 atos 信息(就像我所做的那样),但没有正确计算地址以放入 atos。看这里:

iOS crash reports: atos not working as expected

iOS 崩溃报告:atos 未按预期工作

symbol address = slide + stack address - load address

符号地址 = 幻灯片 + 堆栈地址 - 加载地址

Use otool to get your slide address (usually 0x001000)

使用otool获取你的幻灯片地址(通常是0x001000)

otool -arch ARCHITECTURE -l "APP_BUNDLE/APP_EXECUTABLE" | grep -B 3 -A 8 -m 2 "__TEXT"

Scroll to the bottom of your crash log to get your stack address from the binary images section (first address in the list under Binary Images).

滚动到崩溃日志的底部以从二进制图像部分获取​​堆栈地址(二进制图像下列表中的第一个地址)。

Then add it up using the HEX calculator that comes with your mac (use programmer view). Lastly subtract your load address from the stack trace in your crash log (in your case it looks like 0x00012efe).

然后使用 Mac 随附的 HEX 计算器(使用程序员视图)将其加起来。最后从崩溃日志中的堆栈跟踪中减去您的加载地址(在您的情况下它看起来像 0x00012efe)。

Put this in atos to get the line that causes the crash:

将其放入 atos 以获取导致崩溃的行:

atos -arch armv7 -o YOURAPP.app'/'yourapp' 0xADDRESSFROMABOVE

回答by IdoT

You can try and use my script to achieve this: https://github.com/IdoTene/MacosSymbolicateCrash/blob/master/symbolicate.py

您可以尝试使用我的脚本来实现此目的:https: //github.com/IdoTene/MacosSymbolicateCrash/blob/master/symbolicate.py

It encapsulates the atoscommand

它封装了atos命令

Or the updated version: https://github.com/samrayner/MacosSymbolicateCrash/blob/master/symbolicate.py.

或更新版本:https: //github.com/samrayner/MacosSymbolicateCrash/blob/master/symbolicate.py