首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SymbolicateCrash没有创建正确的去符号文件

SymbolicateCrash没有创建正确的去符号文件
EN

Stack Overflow用户
提问于 2011-09-29 15:05:53
回答 1查看 881关注 0票数 1

我已经在客户机上创建了用于构建的dSYM文件。客户端在构建时崩溃,现在我正试图通过终端中简单的以下命令使用symbolicatecrash来解开符号:

代码语言:javascript
复制
symbolicatecrash myapp_iPod-Touch.crash myapp.app.dSYM > test.txt

但是它没有创建任何有意义的去符号化文件。它在终端中给出了以下错误:

代码语言:javascript
复制
Can't understand the output from otool

然后我在下面的链接中找到了一个解决方案:iPhone SDK 3.0 and symbolicatecrash not getting along?,但它仍然没有将确切的内存位置解符号化到导致崩溃的确切代码行。

然后我也尝试了其他一些选项:下面是另一个选项,但不起作用:

代码语言:javascript
复制
symbolicatecrash.sh -A -v [crashlog-filename] MyApp.dSYM

参考:http://apptech.next-munich.com/2010/01/symbolicatecrash.html

对我有帮助的最佳选择是使用atos命令来获取崩溃的确切代码行号,但我想要系统的symbolicatecrash来创建转储。

注意:当我在我的机器中创建构建,并在我的机器中解锁(我的机器创建的)构建的崩溃日志时,它创建了非常好的转储文件(显示确切的内存位置与负责崩溃的代码行)。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-09-30 16:47:46

如果你有崩溃的DSYM文件,那么你可以使用这个文件:

代码语言:javascript
复制
#!/bin/bash

if [[ $# < 2 ]]
then
echo "Usage: $0 [-arch <arch> (defaults to whatever is specified in the crashlog-   file] <dSYM-file> <crashlog-file>"
exit 1
fi

#Get the architecture either from the params or from the crashlog itself
ARCH_PARAMS=''
if [[ "${1}" == '-arch' ]]
then
ARCH_PARAMS="-arch ${2}"
shift 2
else
ARCHITECTURE=$(cat "${2}" | grep -A1 "Binary Images:" | grep 0x | sed -E -n 's/.*(armv[6-9]).*/\1/p')
if [ -n "${ARCHITECTURE}" ]
then
    ARCH_PARAMS="-arch ${ARCHITECTURE}"
else
    echo "Couldn't determine architecture based on the crashlog. Please specify it by calling $0 -arch <arch> <dSYM-file> <crashlog-file>"
    exit
fi
fi
echo "Assuming architecture:" ${ARCHITECTURE}

#Store the other params
SYMBOL_FILE="${1}"
CRASHLOG="${2}"

#Get the identifier out of the crashlog
IDENTIFIER=$(cat "${CRASHLOG}" | egrep -o "^Identifier:[[:space:]]*.*$" | sed 's/^Identifier:[[:space:]]*\(.*\)$/\1/')
echo "Identifier:" $IDENTIFIER
echo
echo

#Iterate through the crashlog files, find the ones that belong to the $IDENTIFIER, sed the address out of those files, symbolicate them with atos and finally replace them back into those line again. Print all other lines untouched.
while read line
do
SYMBOL=$(echo $line | sed -E -n "s/.*(${IDENTIFIER}[[:space:]]*)(0x[[:alnum:]]*).*/\2/p" | atos -o "${SYMBOL_FILE}/Contents/Resources/DWARF/${IDENTIFIER}"     ${ARCH_PARAMS})
if [ -n "$SYMBOL" ]
then
    echo $line | sed -E "s/(${IDENTIFIER}[[:space:]]*)(0x[[:alnum:]]*)(.*)/\1\2 ${SYMBOL}/"
else
    echo $line
fi
done < "${CRASHLOG}"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7593665

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档