Skip to content

Instantly share code, notes, and snippets.

@Elv13
Created May 6, 2014 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Elv13/76aac9356171de13e352 to your computer and use it in GitHub Desktop.
Save Elv13/76aac9356171de13e352 to your computer and use it in GitHub Desktop.
#!/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