Skip to content

Instantly share code, notes, and snippets.

@rednaxelafx
Created May 3, 2012 08:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rednaxelafx/2584416 to your computer and use it in GitHub Desktop.
Save rednaxelafx/2584416 to your computer and use it in GitHub Desktop.
quick and dirty shell script to decode HotSpot native stack trace
#!/bin/sh
if [[ -f $1 && -f $2 ]]
then
for line in `cat $1 | grep -Po '(?<=V \[libjvm\.so\+)0x[\da-f]+(?=\])'`
do
echo `objdump -C -d --start-address=$line $2 | egrep '>:$' -m 1`
done
else
echo 'usage: <path to hs_err file> <path to libjvm.so>'
fi
@rednaxelafx
Copy link
Author

BTW, if this script doesn't work out of the box (e.g. on Ubuntu), try changing the first line to /bin/bash instead of /bin/sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment