| 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 # tsan_analyze.py | 6 # tsan_analyze.py |
| 7 | 7 |
| 8 ''' Given a ThreadSanitizer output file, parses errors and uniques them.''' | 8 ''' Given a ThreadSanitizer output file, parses errors and uniques them.''' |
| 9 | 9 |
| 10 import gdb_helper | 10 import gdb_helper |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 TSAN_ASSERTION = "Assertion failed: " | 60 TSAN_ASSERTION = "Assertion failed: " |
| 61 | 61 |
| 62 def __init__(self, source_dir, use_gdb=False): | 62 def __init__(self, source_dir, use_gdb=False): |
| 63 '''Reads in a set of files. | 63 '''Reads in a set of files. |
| 64 | 64 |
| 65 Args: | 65 Args: |
| 66 source_dir: Path to top of source tree for this build | 66 source_dir: Path to top of source tree for this build |
| 67 ''' | 67 ''' |
| 68 | 68 |
| 69 self._use_gdb = use_gdb | 69 self._use_gdb = use_gdb |
| 70 self._cur_testcase = None |
| 70 | 71 |
| 71 def ReadLine(self): | 72 def ReadLine(self): |
| 72 self.line_ = self.cur_fd_.readline() | 73 self.line_ = self.cur_fd_.readline() |
| 73 self.stack_trace_line_ = None | 74 self.stack_trace_line_ = None |
| 74 if not self._use_gdb: | 75 if not self._use_gdb: |
| 75 return | 76 return |
| 76 global TheAddressTable | 77 global TheAddressTable |
| 77 match = TsanAnalyzer.LOAD_LIB_RE.match(self.line_) | 78 match = TsanAnalyzer.LOAD_LIB_RE.match(self.line_) |
| 78 if match: | 79 if match: |
| 79 binary, ip = match.groups() | 80 binary, ip = match.groups() |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 parser.error("no filename specified") | 268 parser.error("no filename specified") |
| 268 filenames = args | 269 filenames = args |
| 269 | 270 |
| 270 logging.getLogger().setLevel(logging.INFO) | 271 logging.getLogger().setLevel(logging.INFO) |
| 271 analyzer = TsanAnalyzer(options.source_dir, use_gdb=True) | 272 analyzer = TsanAnalyzer(options.source_dir, use_gdb=True) |
| 272 return analyzer.Report(filenames, None) | 273 return analyzer.Report(filenames, None) |
| 273 | 274 |
| 274 | 275 |
| 275 if __name__ == '__main__': | 276 if __name__ == '__main__': |
| 276 sys.exit(main()) | 277 sys.exit(main()) |
| OLD | NEW |