| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 import glob |
| 6 import hashlib | 7 import hashlib |
| 7 import os | 8 import os |
| 8 import shutil | 9 import shutil |
| 9 import sys | 10 import sys |
| 10 | 11 |
| 11 script_dir = os.path.dirname(os.path.realpath(__file__)) | 12 script_dir = os.path.dirname(os.path.realpath(__file__)) |
| 12 src_build_dir = os.path.abspath(os.path.join(script_dir, os.pardir)) | 13 src_build_dir = os.path.abspath(os.path.join(script_dir, os.pardir)) |
| 13 sys.path.insert(0, src_build_dir) | 14 sys.path.insert(0, src_build_dir) |
| 14 | 15 |
| 15 import vs_toolchain | 16 import vs_toolchain |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 print 'copy_cdb_to_output.py: unknown target_arch %s' % target_arch | 71 print 'copy_cdb_to_output.py: unknown target_arch %s' % target_arch |
| 71 sys.exit(1) | 72 sys.exit(1) |
| 72 # We need to copy multiple files, so cache the computed source directory. | 73 # We need to copy multiple files, so cache the computed source directory. |
| 73 src_dir = os.path.join(win_sdk_dir, 'Debuggers', src_arch) | 74 src_dir = os.path.join(win_sdk_dir, 'Debuggers', src_arch) |
| 74 # We need to copy some helper DLLs to get access to the !uniqstack | 75 # We need to copy some helper DLLs to get access to the !uniqstack |
| 75 # command to dump all threads' stacks. | 76 # command to dump all threads' stacks. |
| 76 src_winext_dir = os.path.join(src_dir, 'winext') | 77 src_winext_dir = os.path.join(src_dir, 'winext') |
| 77 dst_winext_dir = os.path.join(output_dir, 'winext') | 78 dst_winext_dir = os.path.join(output_dir, 'winext') |
| 78 src_winxp_dir = os.path.join(src_dir, 'winxp') | 79 src_winxp_dir = os.path.join(src_dir, 'winxp') |
| 79 dst_winxp_dir = os.path.join(output_dir, 'winxp') | 80 dst_winxp_dir = os.path.join(output_dir, 'winxp') |
| 81 src_crt_dir = os.path.join(win_sdk_dir, r'Redist\ucrt\DLLs', src_arch) |
| 80 _ConditionalMkdir(dst_winext_dir) | 82 _ConditionalMkdir(dst_winext_dir) |
| 81 _ConditionalMkdir(dst_winxp_dir) | 83 _ConditionalMkdir(dst_winxp_dir) |
| 82 # Note that the outputs from the "copy_cdb_to_output" target need to | 84 # Note that the outputs from the "copy_cdb_to_output" target need to |
| 83 # be kept in sync with this list. | 85 # be kept in sync with this list. |
| 84 _CopyImpl('cdb.exe', output_dir, src_dir) | 86 _CopyImpl('cdb.exe', output_dir, src_dir) |
| 85 _CopyImpl('dbgeng.dll', output_dir, src_dir) | 87 _CopyImpl('dbgeng.dll', output_dir, src_dir) |
| 86 _CopyImpl('dbghelp.dll', output_dir, src_dir) | 88 _CopyImpl('dbghelp.dll', output_dir, src_dir) |
| 87 _CopyImpl('dbgmodel.dll', output_dir, src_dir) | 89 _CopyImpl('dbgmodel.dll', output_dir, src_dir) |
| 88 _CopyImpl('ext.dll', dst_winext_dir, src_winext_dir) | 90 _CopyImpl('ext.dll', dst_winext_dir, src_winext_dir) |
| 89 _CopyImpl('uext.dll', dst_winext_dir, src_winext_dir) | 91 _CopyImpl('uext.dll', dst_winext_dir, src_winext_dir) |
| 90 _CopyImpl('exts.dll', dst_winxp_dir, src_winxp_dir) | 92 _CopyImpl('exts.dll', dst_winxp_dir, src_winxp_dir) |
| 91 _CopyImpl('ntsdexts.dll', dst_winxp_dir, src_winxp_dir) | 93 _CopyImpl('ntsdexts.dll', dst_winxp_dir, src_winxp_dir) |
| 94 for dll_path in glob.glob(os.path.join(src_crt_dir, 'api-ms-win-*.dll')): |
| 95 _CopyImpl(os.path.split(dll_path)[1], output_dir, src_crt_dir) |
| 96 _CopyImpl('ucrtbase.dll', output_dir, src_crt_dir) |
| 92 return 0 | 97 return 0 |
| 93 | 98 |
| 94 | 99 |
| 95 def main(): | 100 def main(): |
| 96 if len(sys.argv) < 2: | 101 if len(sys.argv) < 2: |
| 97 print >>sys.stderr, 'Usage: copy_cdb_to_output.py <output_dir> ' + \ | 102 print >>sys.stderr, 'Usage: copy_cdb_to_output.py <output_dir> ' + \ |
| 98 '<target_arch>' | 103 '<target_arch>' |
| 99 return 1 | 104 return 1 |
| 100 return _CopyCDBToOutput(sys.argv[1], sys.argv[2]) | 105 return _CopyCDBToOutput(sys.argv[1], sys.argv[2]) |
| 101 | 106 |
| 102 | 107 |
| 103 if __name__ == '__main__': | 108 if __name__ == '__main__': |
| 104 sys.exit(main()) | 109 sys.exit(main()) |
| OLD | NEW |