Skip to content

Instantly share code, notes, and snippets.

@rgov
Created January 12, 2012 21:32
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 rgov/1603271 to your computer and use it in GitHub Desktop.
Save rgov/1603271 to your computer and use it in GitHub Desktop.
#!/bin/bash
ps -Ac -o pid=,command= | grep -v 'launchd' | while read line; do
PID=$(echo $line | cut -f 1 -d ' ')
CMD=$(echo $line | cut -f 2- -d ' ')
cat <<EOF > /tmp/gdbscript
attach $PID
sharedlibrary update
info sharedlibrary
detach
EOF
gdb -batch -n -x /tmp/gdbscript > /tmp/gdboutput 2>/dev/null
fgrep 'WebKit.framework' /tmp/gdboutput > /dev/null && echo "$CMD matches."
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment