| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2008 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 # valgrind_test.py | 6 # valgrind_test.py |
| 7 | 7 |
| 8 """Runs an exe through Valgrind and puts the intermediate files in a | 8 """Runs an exe through Valgrind and puts the intermediate files in a |
| 9 directory. | 9 directory. |
| 10 """ | 10 """ |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 parser.add_option("", "--track_origins", action="store_true", | 493 parser.add_option("", "--track_origins", action="store_true", |
| 494 default=False, | 494 default=False, |
| 495 help="Show whence uninitialized bytes came. 30% slower.") | 495 help="Show whence uninitialized bytes came. 30% slower.") |
| 496 | 496 |
| 497 def ToolSpecificFlags(self): | 497 def ToolSpecificFlags(self): |
| 498 ret = ["--leak-check=full", "--gen-suppressions=all", "--demangle=no"] | 498 ret = ["--leak-check=full", "--gen-suppressions=all", "--demangle=no"] |
| 499 | 499 |
| 500 if self._options.show_all_leaks: | 500 if self._options.show_all_leaks: |
| 501 ret += ["--show-reachable=yes"] | 501 ret += ["--show-reachable=yes"] |
| 502 else: | 502 else: |
| 503 ret += ["--show-possible=no"] | 503 ret += ["--show-possibly-lost=no"] |
| 504 | 504 |
| 505 if self._options.track_origins: | 505 if self._options.track_origins: |
| 506 ret += ["--track-origins=yes"] | 506 ret += ["--track-origins=yes"] |
| 507 | 507 |
| 508 return ret | 508 return ret |
| 509 | 509 |
| 510 def CreateAnalyzer(self): | 510 def CreateAnalyzer(self): |
| 511 use_gdb = common.IsMac() | 511 use_gdb = common.IsMac() |
| 512 return memcheck_analyze.MemcheckAnalyzer(self._source_dir, | 512 return memcheck_analyze.MemcheckAnalyzer(self._source_dir, |
| 513 self._options.show_all_leaks, | 513 self._options.show_all_leaks, |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 platform_name = sys.platform + "(Unknown)" | 920 platform_name = sys.platform + "(Unknown)" |
| 921 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, | 921 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, |
| 922 platform_name) | 922 platform_name) |
| 923 | 923 |
| 924 def CreateTool(tool): | 924 def CreateTool(tool): |
| 925 return ToolFactory().Create(tool) | 925 return ToolFactory().Create(tool) |
| 926 | 926 |
| 927 if __name__ == '__main__': | 927 if __name__ == '__main__': |
| 928 logging.error(sys.argv[0] + " can not be run from command line") | 928 logging.error(sys.argv[0] + " can not be run from command line") |
| 929 sys.exit(1) | 929 sys.exit(1) |
| OLD | NEW |