]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Improve filtering to get rid of suppressions, using magic incantations
authorJulian Seward <jseward@acm.org>
Sat, 2 Jul 2005 20:41:25 +0000 (20:41 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 2 Jul 2005 20:41:25 +0000 (20:41 +0000)
from Tom H and Ashley Pittman.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4088

memcheck/tests/filter_xml

index 51c4f21787bce184aa784f3fc84c2c9478cb5988..8a857c6146f06ac7431288864d3358333a99c198 100755 (executable)
@@ -6,4 +6,20 @@ sed "s/<pid>[0-9]*<\/pid>/<pid>...<\/pid>/" |
 sed "s/<ppid>[0-9]*<\/ppid>/<ppid>...<\/ppid>/" |
 sed "s/<obj>.*<\/obj>/<obj>...<\/obj>/" |
 sed "s/<line>.*<\/line>/<line>...<\/line>/" |
-sed "s/<dir>.*<\/dir>/<dir>...<\/dir>/"
+sed "s/<dir>.*<\/dir>/<dir>...<\/dir>/" |
+sed "s/<count>.*<\/count>/<count>...<\/count>/" |
+perl -0 -p -e "s/<suppcounts>.*<\/suppcounts>/<suppcounts>...<\/suppcounts>/s"
+
+# Collected wisdom re Perl magic incantation:
+#
+# From: Tom Hughes
+#
+# Two problems - one is that you need -p to force perl to loop over 
+# the input lines and apply your expression to each one and then print
+# the results.
+# 
+# The other is that as somebody else said you need to change the input
+# record separator so that it reads in the whole file as a single line
+# which you can do with the -0 switch.
+#
+# Hence -0 -p.