def main(): parser = argparse.ArgumentParser(description='Symbolize sanitizer reports.') parser.add_argument('--test-summary-json-file', help='Path to a JSON file produced by the test launcher. The script will ' 'ignore stdandard input and instead symbolize the output stnippets ' 'inside the JSON file. The result will be written back to the JSON ' 'file.') parser.add_argument('strip_path_prefix', nargs='*', help='When printing source file names, the longest prefix ending in one ' 'of these substrings will be stripped. E.g.: "Release/../../".') parser.add_argument('--executable-path', help='Path to program executable. Used on OSX swarming bots to locate ' 'dSYM bundles for associated frameworks and bundles.') args = parser.parse_args() disable_buffering() set_symbolizer_path() asan_symbolize.demangle = True asan_symbolize.fix_filename_patterns = args.strip_path_prefix binary_name_filter = None if os.uname()[0] == 'Darwin': binary_name_filter = make_chrome_osx_binary_name_filter( chrome_product_dir_path(args.executable_path)) loop = asan_symbolize.SymbolizationLoop( binary_name_filter=binary_name_filter, dsym_hint_producer=chrome_dsym_hints) if args.test_summary_json_file: symbolize_snippets_in_json(args.test_summary_json_file, loop) else: # Process stdin. asan_symbolize.logfile = sys.stdin loop.process_logfile()
def main(): parser = argparse.ArgumentParser( description='Symbolize sanitizer reports.') parser.add_argument( '--test-summary-json-file', help= 'Path to a JSON file produced by the test launcher. The script will ' 'ignore stdandard input and instead symbolize the output stnippets ' 'inside the JSON file. The result will be written back to the JSON ' 'file.') parser.add_argument( 'strip_path_prefix', nargs='*', help='When printing source file names, the longest prefix ending in one ' 'of these substrings will be stripped. E.g.: "Release/../../".') args = parser.parse_args() disable_buffering() set_symbolizer_path() asan_symbolize.demangle = True asan_symbolize.fix_filename_patterns = args.strip_path_prefix loop = asan_symbolize.SymbolizationLoop( dsym_hint_producer=chrome_dsym_hints) if args.test_summary_json_file: symbolize_snippets_in_json(args.test_summary_json_file, loop) else: # Process stdin. asan_symbolize.logfile = sys.stdin loop.process_logfile()
def main(): disable_buffering() set_symbolizer_path() asan_symbolize.demangle = True asan_symbolize.fix_filename_patterns = sys.argv[1:] asan_symbolize.logfile = sys.stdin loop = asan_symbolize.SymbolizationLoop() loop.process_logfile()
def _run(in_stream, out_stream, symbolize): """ Demangle lines from |in_stream| and write to |out_stream|. """ if symbolize: asan_symbolize.demangle = True loop = asan_symbolize.SymbolizationLoop( binary_name_filter=asan_symbolize.fix_filename) while self._continue: line = in_stream.readline() if not line: return line = line.rstrip() if not isinstance(line, str): try: line = line.decode('utf-8') except: out_stream.buffer.write(line) continue if symbolize: line = ''.join(loop.process_line(line)) print(line, file=out_stream)
def main(): disable_buffering() loop = asan_symbolize.SymbolizationLoop(binary_name_filter=fix_filename) loop.process_stdin()
def main(): loop = asan_symbolize.SymbolizationLoop(binary_name_filter=fix_filename) loop.process_stdin()