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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 'of these substrings will be stripped. E.g.: "Release/../../".') | 240 'of these substrings will be stripped. E.g.: "Release/../../".') |
241 parser.add_argument('--executable-path', | 241 parser.add_argument('--executable-path', |
242 help='Path to program executable. Used on OSX swarming bots to locate ' | 242 help='Path to program executable. Used on OSX swarming bots to locate ' |
243 'dSYM bundles for associated frameworks and bundles.') | 243 'dSYM bundles for associated frameworks and bundles.') |
244 args = parser.parse_args() | 244 args = parser.parse_args() |
245 | 245 |
246 disable_buffering() | 246 disable_buffering() |
247 set_symbolizer_path() | 247 set_symbolizer_path() |
248 asan_symbolize.demangle = True | 248 asan_symbolize.demangle = True |
249 asan_symbolize.fix_filename_patterns = args.strip_path_prefix | 249 asan_symbolize.fix_filename_patterns = args.strip_path_prefix |
| 250 # Most source paths for Chromium binaries start with |
| 251 # /path/to/src/out/Release/../../ |
| 252 asan_symbolize.fix_filename_patterns.append('Release/../../') |
250 binary_name_filter = None | 253 binary_name_filter = None |
251 if os.uname()[0] == 'Darwin': | 254 if os.uname()[0] == 'Darwin': |
252 binary_name_filter = make_chrome_osx_binary_name_filter( | 255 binary_name_filter = make_chrome_osx_binary_name_filter( |
253 chrome_product_dir_path(args.executable_path)) | 256 chrome_product_dir_path(args.executable_path)) |
254 loop = asan_symbolize.SymbolizationLoop( | 257 loop = asan_symbolize.SymbolizationLoop( |
255 binary_name_filter=binary_name_filter, | 258 binary_name_filter=binary_name_filter, |
256 dsym_hint_producer=chrome_dsym_hints) | 259 dsym_hint_producer=chrome_dsym_hints) |
257 | 260 |
258 if args.test_summary_json_file: | 261 if args.test_summary_json_file: |
259 symbolize_snippets_in_json(args.test_summary_json_file, loop) | 262 symbolize_snippets_in_json(args.test_summary_json_file, loop) |
260 else: | 263 else: |
261 # Process stdin. | 264 # Process stdin. |
262 asan_symbolize.logfile = sys.stdin | 265 asan_symbolize.logfile = sys.stdin |
263 loop.process_logfile() | 266 loop.process_logfile() |
264 | 267 |
265 if __name__ == '__main__': | 268 if __name__ == '__main__': |
266 main() | 269 main() |
OLD | NEW |