| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import collections | 5 import collections |
| 6 import datetime | 6 import datetime |
| 7 import logging | 7 import logging |
| 8 import multiprocessing | 8 import multiprocessing |
| 9 import os | 9 import os |
| 10 import posixpath | 10 import posixpath |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 sym_info = None | 279 sym_info = None |
| 280 for (line1, line2) in lines: | 280 for (line1, line2) in lines: |
| 281 prev_sym_info = sym_info | 281 prev_sym_info = sym_info |
| 282 name = line1 if not line1.startswith('?') else None | 282 name = line1 if not line1.startswith('?') else None |
| 283 source_path = None | 283 source_path = None |
| 284 source_line = None | 284 source_line = None |
| 285 m = ELFSymbolizer.Addr2Line.SYM_ADDR_RE.match(line2) | 285 m = ELFSymbolizer.Addr2Line.SYM_ADDR_RE.match(line2) |
| 286 if m: | 286 if m: |
| 287 if not m.group(1).startswith('?'): | 287 if not m.group(1).startswith('?'): |
| 288 source_path = m.group(1) | 288 source_path = m.group(1) |
| 289 source_line = int(m.group(2)) | 289 if not m.group(2).startswith('?'): |
| 290 source_line = int(m.group(2)) |
| 290 else: | 291 else: |
| 291 logging.warning('Got invalid symbol path from addr2line: %s' % line2) | 292 logging.warning('Got invalid symbol path from addr2line: %s' % line2) |
| 292 | 293 |
| 293 sym_info = ELFSymbolInfo(name, source_path, source_line) | 294 sym_info = ELFSymbolInfo(name, source_path, source_line) |
| 294 if prev_sym_info: | 295 if prev_sym_info: |
| 295 prev_sym_info.inlined_by = sym_info | 296 prev_sym_info.inlined_by = sym_info |
| 296 if not innermost_sym_info: | 297 if not innermost_sym_info: |
| 297 innermost_sym_info = sym_info | 298 innermost_sym_info = sym_info |
| 298 | 299 |
| 299 self._symbolizer.callback(innermost_sym_info, callback_arg) | 300 self._symbolizer.callback(innermost_sym_info, callback_arg) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 self.name = name | 374 self.name = name |
| 374 self.source_path = source_path | 375 self.source_path = source_path |
| 375 self.source_line = source_line | 376 self.source_line = source_line |
| 376 # In the case of |inlines|=True, the |inlined_by| points to the outer | 377 # In the case of |inlines|=True, the |inlined_by| points to the outer |
| 377 # function inlining the current one (and so on, to form a chain). | 378 # function inlining the current one (and so on, to form a chain). |
| 378 self.inlined_by = None | 379 self.inlined_by = None |
| 379 | 380 |
| 380 def __str__(self): | 381 def __str__(self): |
| 381 return '%s [%s:%d]' % ( | 382 return '%s [%s:%d]' % ( |
| 382 self.name or '??', self.source_path or '??', self.source_line or 0) | 383 self.name or '??', self.source_path or '??', self.source_line or 0) |
| OLD | NEW |