OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 from third_party import asan_symbolize | 7 from third_party import asan_symbolize |
8 | 8 |
9 import argparse | 9 import argparse |
10 import base64 | 10 import base64 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 parser.add_argument('strip_path_prefix', nargs='*', | 239 parser.add_argument('strip_path_prefix', nargs='*', |
240 help='When printing source file names, the longest prefix ending in one ' | 240 help='When printing source file names, the longest prefix ending in one ' |
241 'of these substrings will be stripped. E.g.: "Release/../../".') | 241 'of these substrings will be stripped. E.g.: "Release/../../".') |
242 parser.add_argument('--executable-path', | 242 parser.add_argument('--executable-path', |
243 help='Path to program executable. Used on OSX swarming bots to locate ' | 243 help='Path to program executable. Used on OSX swarming bots to locate ' |
244 'dSYM bundles for associated frameworks and bundles.') | 244 'dSYM bundles for associated frameworks and bundles.') |
245 args = parser.parse_args() | 245 args = parser.parse_args() |
246 | 246 |
247 disable_buffering() | 247 disable_buffering() |
248 set_symbolizer_path() | 248 set_symbolizer_path() |
| 249 # Disallow fallback to addr2line/atos if llvm-symbolizer is not present. Those |
| 250 # are slow and we don't want to use them ever. |
| 251 asan_symbolize.allow_system_symbolizer = False |
249 asan_symbolize.demangle = True | 252 asan_symbolize.demangle = True |
250 asan_symbolize.fix_filename_patterns = args.strip_path_prefix | 253 asan_symbolize.fix_filename_patterns = args.strip_path_prefix |
251 # Most source paths for Chromium binaries start with | 254 # Most source paths for Chromium binaries start with |
252 # /path/to/src/out/Release/../../ | 255 # /path/to/src/out/Release/../../ |
253 asan_symbolize.fix_filename_patterns.append('Release/../../') | 256 asan_symbolize.fix_filename_patterns.append('Release/../../') |
254 binary_name_filter = None | 257 binary_name_filter = None |
255 if platform.uname()[0] == 'Darwin': | 258 if platform.uname()[0] == 'Darwin': |
256 binary_name_filter = make_chrome_osx_binary_name_filter( | 259 binary_name_filter = make_chrome_osx_binary_name_filter( |
257 chrome_product_dir_path(args.executable_path)) | 260 chrome_product_dir_path(args.executable_path)) |
258 loop = asan_symbolize.SymbolizationLoop( | 261 loop = asan_symbolize.SymbolizationLoop( |
259 binary_name_filter=binary_name_filter, | 262 binary_name_filter=binary_name_filter, |
260 dsym_hint_producer=chrome_dsym_hints) | 263 dsym_hint_producer=chrome_dsym_hints) |
261 | 264 |
262 if args.test_summary_json_file: | 265 if args.test_summary_json_file: |
263 symbolize_snippets_in_json(args.test_summary_json_file, loop) | 266 symbolize_snippets_in_json(args.test_summary_json_file, loop) |
264 else: | 267 else: |
265 # Process stdin. | 268 # Process stdin. |
266 asan_symbolize.logfile = sys.stdin | 269 asan_symbolize.logfile = sys.stdin |
267 loop.process_logfile() | 270 loop.process_logfile() |
268 | 271 |
269 if __name__ == '__main__': | 272 if __name__ == '__main__': |
270 main() | 273 main() |
OLD | NEW |