From: lace <> Date: Fri, 4 Jan 2008 22:40:50 +0000 (+0000) Subject: GDB strace grepper of its ptraces. X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=151255554e1863cc8ab9812d40d42fcf4b00e393 GDB strace grepper of its ptraces. --- diff --git a/bin/ptracegrep b/bin/ptracegrep new file mode 100755 index 0000000..d4180fb --- /dev/null +++ b/bin/ptracegrep @@ -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'