a script to decode stack traces.
This commit is contained in:
18
commands/scripts/unstack.sh
Normal file
18
commands/scripts/unstack.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 1 ]
|
||||
then echo "Usage: $0 <executable> [0x... [0x... ] ]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
executable=$1
|
||||
shift
|
||||
|
||||
while [ $# -gt 0 ]
|
||||
do dec="`printf %d $1`"
|
||||
nm -d -n $executable | grep ' [Tt] ' | awk '
|
||||
{ if($1 > '$dec') { printf "%s+0x%x\n", name, '$dec'-offset; exit }
|
||||
name=$3; offset=$1
|
||||
}'
|
||||
shift
|
||||
done
|
||||
Reference in New Issue
Block a user