Created
May 6, 2014 19:48
-
-
Save Elv13/76aac9356171de13e352 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $1 == "" ]; then | |
echo Usage: euc2bt /path/to/stacktrace | |
exit 1 | |
fi | |
for line in $(cat $1 | awk -F' → ' '{for (i=1;i<=NF;i++) { print $(i)}}');do | |
FILE=$(echo $line | cut -f1 -d'+') | |
ADDR=0x$(echo $line | cut -f2 -d'+') | |
echo LINE ${line}: | |
addr2line -e $(echo $line | cut -f1 -d'+') -a 0x$(echo $line | cut -f2 -d'+') | |
gdb $FILE -ex "info symbol $ADDR" -ex quit 2> /dev/null -quiet -silent | tail -n1 | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment