OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # memcheck_analyze.py | 6 # memcheck_analyze.py |
7 | 7 |
8 ''' Given a valgrind XML file, parses errors and uniques them.''' | 8 ''' Given a valgrind XML file, parses errors and uniques them.''' |
9 | 9 |
10 import gdb_helper | 10 import gdb_helper |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 output += " (" + frame[OBJECT_FILE] + ")" | 260 output += " (" + frame[OBJECT_FILE] + ")" |
261 output += "\n" | 261 output += "\n" |
262 | 262 |
263 assert self._suppression != None, "Your Valgrind doesn't generate " \ | 263 assert self._suppression != None, "Your Valgrind doesn't generate " \ |
264 "suppressions - is it too old?" | 264 "suppressions - is it too old?" |
265 | 265 |
266 if self._testcase: | 266 if self._testcase: |
267 output += "The report came from the `%s` test.\n" % self._testcase | 267 output += "The report came from the `%s` test.\n" % self._testcase |
268 output += "Suppression (error hash=#%016X#):\n" % self.ErrorHash() | 268 output += "Suppression (error hash=#%016X#):\n" % self.ErrorHash() |
269 output += (" For more info on using suppressions see " | 269 output += (" For more info on using suppressions see " |
270 "http://dev.chromium.org/developers/how-tos/using-valgrind#TOC-Su
ppressing-Errors") | 270 "http://dev.chromium.org/developers/tree-sheriffs/sheriff-details
-chromium/memory-sheriff#TOC-Suppressing-memory-reports") |
271 | 271 |
272 # Widen suppression slightly to make portable between mac and linux | 272 # Widen suppression slightly to make portable between mac and linux |
273 # TODO(timurrrr): Oops, these transformations should happen | 273 # TODO(timurrrr): Oops, these transformations should happen |
274 # BEFORE calculating the hash! | 274 # BEFORE calculating the hash! |
275 supp = self._suppression; | 275 supp = self._suppression; |
276 supp = supp.replace("fun:_Znwj", "fun:_Znw*") | 276 supp = supp.replace("fun:_Znwj", "fun:_Znw*") |
277 supp = supp.replace("fun:_Znwm", "fun:_Znw*") | 277 supp = supp.replace("fun:_Znwm", "fun:_Znw*") |
278 supp = supp.replace("fun:_Znaj", "fun:_Zna*") | 278 supp = supp.replace("fun:_Znaj", "fun:_Zna*") |
279 supp = supp.replace("fun:_Znam", "fun:_Zna*") | 279 supp = supp.replace("fun:_Znam", "fun:_Zna*") |
280 | 280 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 if len(args) == 0: | 615 if len(args) == 0: |
616 parser.error("no filename specified") | 616 parser.error("no filename specified") |
617 filenames = args | 617 filenames = args |
618 | 618 |
619 analyzer = MemcheckAnalyzer(options.source_dir, use_gdb=True) | 619 analyzer = MemcheckAnalyzer(options.source_dir, use_gdb=True) |
620 return analyzer.Report(filenames, None) | 620 return analyzer.Report(filenames, None) |
621 | 621 |
622 | 622 |
623 if __name__ == "__main__": | 623 if __name__ == "__main__": |
624 sys.exit(_main()) | 624 sys.exit(_main()) |
OLD | NEW |