GDB strace grepper of its ptraces.
authorlace <>
Fri, 4 Jan 2008 22:40:50 +0000 (22:40 +0000)
committerlace <>
Fri, 4 Jan 2008 22:40:50 +0000 (22:40 +0000)
bin/ptracegrep [new file with mode: 0755]

diff --git a/bin/ptracegrep b/bin/ptracegrep
new file mode 100755 (executable)
index 0000000..d4180fb
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/sh
+# $Id$
+
+PID=$(sed -n 's/^ptrace *([^,]*, *\([0-9]*\),.*$/\1/p' "$1"|sort|uniq -c|sort -nr|head -n1|awk '{print $2}')
+echo >&2 "PID=$PID"
+grep $PID $1 \
+       | grep -v '^\(\(open\|read\) *(\|ptrace *( *PTRACE_\(PEEK\|POKE\)\)' \
+       | sed -e 's/\<'$PID'\>/PID/g' -e 's/0x[0-9a-f]\{5,\}/HEX/g'