开发者

SymbolicateCrash is not creating proper de-symbol file

开发者 https://www.devze.com 2023-04-09 09:59 出处:网络
I have the dSYM file for build created on client\'s machine. Client got a crash in build and now I am trying to de-symbol by use of the symbolicatecrash by the simple following command in terminal:

I have the dSYM file for build created on client's machine. Client got a crash in build and now I am trying to de-symbol by use of the symbolicatecrash by the simple following command in terminal:

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

but it's not creating any meaningful de-symboled file. and it's giving the follwoing error in terminal:

Can't understand the output from otool

then I found a solution in following link: iPhone SDK 3.0 and symbolicatecrash not getting along? but still it's not de-symbolicating 开发者_JAVA百科the exact memory location to exact code line responsible for crash.

Then I tried some other options too: Following is the other option but didn't work:

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

For reference: http://apptech.next-munich.com/2010/01/symbolicatecrash.html

The best option that helped me is atos command to get the exact code line number of the crash but I want the systematic symbolicatecrash to create the dump.

NOTE: When I create build in my machine and desymbolicate (the my machine created) build's crash log in my machine it creates perfectly good dump file (show's exact memory location VS code line responsible for crash).


If you have the DSYM file for the crash then you can use this one:

#!/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

精彩评论

暂无评论...
验证码 换一张
取 消