1

我在客户端机器上创建了用于构建的 dSYM 文件。客户端在构建中崩溃了,现在我试图通过终端中的简单以下命令使用 symbolicatecrash 去符号化:

symbolicatecrash myapp_iPod-Touch.crash myapp.app.dSYM > test.txt

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

Can't understand the output from otool

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

然后我也尝试了其他一些选项:以下是另一个选项,但没有奏效:

symbolicatecrash.sh -A -v [crashlog-filename] MyApp.dSYM

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

帮助我的最佳选择是 atos 命令来获取崩溃的确切代码行号,但我希望系统的符号崩溃来创建转储。

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

4

1 回答 1

0

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

#!/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}"
于 2011-09-30T08:47:46.367 回答