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 # 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 logging | 10 import logging |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 elif frame[SRC_FILE_DIR] != "": | 317 elif frame[SRC_FILE_DIR] != "": |
318 output += (" (" + frame[SRC_FILE_DIR] + "/" + frame[SRC_FILE_NAME] + | 318 output += (" (" + frame[SRC_FILE_DIR] + "/" + frame[SRC_FILE_NAME] + |
319 ":" + frame[SRC_LINE] + ")") | 319 ":" + frame[SRC_LINE] + ")") |
320 else: | 320 else: |
321 output += " (" + frame[OBJECT_FILE] + ")" | 321 output += " (" + frame[OBJECT_FILE] + ")" |
322 output += "\n" | 322 output += "\n" |
323 | 323 |
324 # TODO(dank): stop synthesizing suppressions once everyone has | 324 # TODO(dank): stop synthesizing suppressions once everyone has |
325 # valgrind-3.5 and we can rely on xml | 325 # valgrind-3.5 and we can rely on xml |
326 if (self._suppression == None): | 326 if (self._suppression == None): |
327 output += "Ssuppression:\n" | 327 output += "Suppression:\n" |
328 for frame in backtrace[1]: | 328 for frame in backtrace[1]: |
329 output += " fun:" + (frame[FUNCTION_NAME] or "*") + "\n" | 329 output += " fun:" + (frame[FUNCTION_NAME] or "*") + "\n" |
330 | 330 |
331 if (self._suppression != None): | 331 if (self._suppression != None): |
332 output += "Suppression:" | 332 output += "Suppression:" |
333 output += self._suppression | 333 output += self._suppression |
334 | 334 |
335 return output | 335 return output |
336 | 336 |
337 def UniqueString(self): | 337 def UniqueString(self): |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 parser.error("no filename specified") | 488 parser.error("no filename specified") |
489 filenames = args | 489 filenames = args |
490 | 490 |
491 analyzer = MemcheckAnalyze(options.source_dir, filenames, use_gdb=True) | 491 analyzer = MemcheckAnalyze(options.source_dir, filenames, use_gdb=True) |
492 retcode = analyzer.Report() | 492 retcode = analyzer.Report() |
493 | 493 |
494 sys.exit(retcode) | 494 sys.exit(retcode) |
495 | 495 |
496 if __name__ == "__main__": | 496 if __name__ == "__main__": |
497 _main() | 497 _main() |
OLD | NEW |