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 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 | 64 |
65 def _InstrumentBinary(syzygy_dir, mode, executable, symbol, dst_dir, | 65 def _InstrumentBinary(syzygy_dir, mode, executable, symbol, dst_dir, |
66 filter_file): | 66 filter_file): |
67 """Instruments the executable found in input_dir, and writes the resultant | 67 """Instruments the executable found in input_dir, and writes the resultant |
68 instrumented executable and symbol files to dst_dir. | 68 instrumented executable and symbol files to dst_dir. |
69 """ | 69 """ |
70 cmd = [os.path.abspath(os.path.join(syzygy_dir, _INSTRUMENT_EXE)), | 70 cmd = [os.path.abspath(os.path.join(syzygy_dir, _INSTRUMENT_EXE)), |
71 '--overwrite', | 71 '--overwrite', |
72 '--mode=%s' % mode, | 72 '--mode=%s' % mode, |
| 73 '--debug-friendly', |
73 '--input-image=%s' % executable, | 74 '--input-image=%s' % executable, |
74 '--input-pdb=%s' % symbol, | 75 '--input-pdb=%s' % symbol, |
75 '--output-image=%s' % os.path.abspath( | 76 '--output-image=%s' % os.path.abspath( |
76 os.path.join(dst_dir, os.path.basename(executable))), | 77 os.path.join(dst_dir, os.path.basename(executable))), |
77 '--output-pdb=%s' % os.path.abspath( | 78 '--output-pdb=%s' % os.path.abspath( |
78 os.path.join(dst_dir, os.path.basename(symbol)))] | 79 os.path.join(dst_dir, os.path.basename(symbol)))] |
79 | 80 |
80 # If a filter was specified then pass it on to the instrumenter. | 81 # If a filter was specified then pass it on to the instrumenter. |
81 if filter_file: | 82 if filter_file: |
82 cmd.append('--filter=%s' % os.path.abspath(filter_file)) | 83 cmd.append('--filter=%s' % os.path.abspath(filter_file)) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 options.agent_dll = os.path.abspath(os.path.join(options.syzygy_dir, | 167 options.agent_dll = os.path.abspath(os.path.join(options.syzygy_dir, |
167 _DEFAULT_AGENT_DLLS[options.mode])) | 168 _DEFAULT_AGENT_DLLS[options.mode])) |
168 _LOGGER.info('Using default agent DLL: %s' % options.agent_dll) | 169 _LOGGER.info('Using default agent DLL: %s' % options.agent_dll) |
169 | 170 |
170 return options | 171 return options |
171 | 172 |
172 | 173 |
173 if '__main__' == __name__: | 174 if '__main__' == __name__: |
174 logging.basicConfig(level=logging.INFO) | 175 logging.basicConfig(level=logging.INFO) |
175 sys.exit(main(_ParseOptions())) | 176 sys.exit(main(_ParseOptions())) |
OLD | NEW |