2011-09-29 69 views
1

我有在客戶端機器上創建的生成的dSYM文件。客戶有在建崩潰,現在我想通過簡單以下命令使用symbolicatecrash的終端去符號:SymbolicateCrash沒有創建正確的解除符號文件

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

,但它不產生任何有意義的去symboled文件。和它給在終端的follwoing錯誤:

Can't understand the output from otool 

後來我發現在以下鏈接解決方案: iPhone SDK 3.0 and symbolicatecrash not getting along? 但它仍然不是去symbolicating確切的內存位置,負責碰撞確切的代碼行。

然後我嘗試了一些其他的選擇太: 以下是另一種選擇,但沒有奏效:

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

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

,幫助我最好的選擇是ATOS命令來獲取崩潰的確切的代碼行號,但我想要系統的象徵性倉庫創建轉儲。注意:當我在我的機器上創建構建並在我的機器上創建desymbolicate(我的機器)構建的崩潰日誌時,它會創建完美的轉儲文件(顯示的確切內存位置VS負責崩潰的代碼行)。

回答

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}" 
+0

這些都是我在desybolicator寫,然後在終端上運行的線路? – UPT

+0

這是您可以使用的另一個符號化腳本。只需將它複製到像symbolicate.sh這樣的文件中,設置其權限以便它是可執行文件,然後使用第5行中給出的參數從命令行調用它。 – rage