From dbda2d11c04d9d690d8010bda4a89ed23f109fd7 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 21 Jul 2010 13:57:03 +0000 Subject: [Core] move format-suppressions.py to tools directory --- tools/format-suppressions.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tools/format-suppressions.py (limited to 'tools') diff --git a/tools/format-suppressions.py b/tools/format-suppressions.py new file mode 100644 index 00000000..cc9d2fbd --- /dev/null +++ b/tools/format-suppressions.py @@ -0,0 +1,43 @@ +import re + +valgrind_log = open('log','r').read() + +inblock = False +l = 0 +i = 0 +keep = dict() + +limit_re = r'type' + +for line in valgrind_log.splitlines(): + if line.startswith('{'): + inblock = True + block = [] + continue + if line.startswith('}'): + inblock = False + l = 0 + i += 1 + ok = False + name = "" + for x in block[2:]: + name = name + x + if re.search(limit_re, x): + ok = True + break + if ok: + keep[name] = block + continue + if inblock: + block.append(line) +i = 43 +for x in keep: + block = keep[x] + print "{" + print " suppression", i + for x in block[1:]: + print x + if re.search(limit_re, x): + break + print '}' + i += 1 -- cgit