| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """A utility script to help building Syzygy-instrumented Chrome binaries.""" | 6 """A utility script to help building Syzygy-instrumented Chrome binaries.""" |
| 7 | 7 |
| 8 import glob | 8 import glob |
| 9 import logging | 9 import logging |
| 10 import optparse | 10 import optparse |
| 11 import os | 11 import os |
| 12 import shutil | 12 import shutil |
| 13 import subprocess | 13 import subprocess |
| 14 import sys | 14 import sys |
| 15 | 15 |
| 16 | 16 |
| 17 # The default directory containing the Syzygy toolchain. | 17 # The default directory containing the Syzygy toolchain. |
| 18 _DEFAULT_SYZYGY_DIR = os.path.abspath(os.path.join( | 18 _DEFAULT_SYZYGY_DIR = os.path.abspath(os.path.join( |
| 19 os.path.dirname(__file__), '../../../../..', | 19 os.path.dirname(__file__), '../../..', |
| 20 'third_party/syzygy/binaries/exe/')) | 20 'third_party/syzygy/binaries/exe/')) |
| 21 | 21 |
| 22 # Basenames of various tools. | 22 # Basenames of various tools. |
| 23 _INSTRUMENT_EXE = 'instrument.exe' | 23 _INSTRUMENT_EXE = 'instrument.exe' |
| 24 _GENFILTER_EXE = 'genfilter.exe' | 24 _GENFILTER_EXE = 'genfilter.exe' |
| 25 | 25 |
| 26 _LOGGER = logging.getLogger() | 26 _LOGGER = logging.getLogger() |
| 27 | 27 |
| 28 | 28 |
| 29 def _Shell(*cmd, **kw): | 29 def _Shell(*cmd, **kw): |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 option_parser.error('You must provide a destination directory.') | 148 option_parser.error('You must provide a destination directory.') |
| 149 if options.filter and not options.output_filter_file: | 149 if options.filter and not options.output_filter_file: |
| 150 option_parser.error('You must provide a filter output file.') | 150 option_parser.error('You must provide a filter output file.') |
| 151 | 151 |
| 152 return options | 152 return options |
| 153 | 153 |
| 154 | 154 |
| 155 if '__main__' == __name__: | 155 if '__main__' == __name__: |
| 156 logging.basicConfig(level=logging.INFO) | 156 logging.basicConfig(level=logging.INFO) |
| 157 sys.exit(main(_ParseOptions())) | 157 sys.exit(main(_ParseOptions())) |
| OLD | NEW |