OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 key=lambda (k,v): (v,k)): | 536 key=lambda (k,v): (v,k)): |
537 print "%7d %s" % (count, name) | 537 print "%7d %s" % (count, name) |
538 if name in remaining_sanity_supp and remaining_sanity_supp[name] == count: | 538 if name in remaining_sanity_supp and remaining_sanity_supp[name] == count: |
539 del remaining_sanity_supp[name] | 539 del remaining_sanity_supp[name] |
540 if len(remaining_sanity_supp) == 0: | 540 if len(remaining_sanity_supp) == 0: |
541 is_sane = True | 541 is_sane = True |
542 print "-----------------------------------------------------" | 542 print "-----------------------------------------------------" |
543 sys.stdout.flush() | 543 sys.stdout.flush() |
544 | 544 |
545 retcode = 0 | 545 retcode = 0 |
546 if self._errors: | 546 if cur_report_errors: |
547 logging.error("FAIL! There were %s errors: " % len(self._errors)) | 547 logging.error("FAIL! There were %s errors: " % len(cur_report_errors)) |
548 | 548 |
549 if TheAddressTable != None: | 549 if TheAddressTable != None: |
550 TheAddressTable.ResolveAll() | 550 TheAddressTable.ResolveAll() |
551 | 551 |
552 for error in cur_report_errors: | 552 for error in cur_report_errors: |
553 logging.error(error) | 553 logging.error(error) |
554 | 554 |
555 retcode = -1 | 555 retcode = -1 |
556 | 556 |
557 # Report tool's insanity even if there were errors. | 557 # Report tool's insanity even if there were errors. |
(...skipping 24 matching lines...) Expand all Loading... |
582 parser.error("no filename specified") | 582 parser.error("no filename specified") |
583 filenames = args | 583 filenames = args |
584 | 584 |
585 analyzer = MemcheckAnalyzer(options.source_dir, use_gdb=True) | 585 analyzer = MemcheckAnalyzer(options.source_dir, use_gdb=True) |
586 retcode = analyzer.Report(filenames) | 586 retcode = analyzer.Report(filenames) |
587 | 587 |
588 sys.exit(retcode) | 588 sys.exit(retcode) |
589 | 589 |
590 if __name__ == "__main__": | 590 if __name__ == "__main__": |
591 _main() | 591 _main() |
OLD | NEW |