OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 glob |
7 import json | 7 import json |
8 import os | 8 import os |
9 import pipes | 9 import pipes |
10 import platform | 10 import platform |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=False) | 304 _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=False) |
305 if configuration == 'Debug': | 305 if configuration == 'Debug': |
306 _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True) | 306 _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True) |
307 else: | 307 else: |
308 _CopyPGORuntime(target_dir, target_cpu) | 308 _CopyPGORuntime(target_dir, target_cpu) |
309 | 309 |
310 _CopyDebugger(target_dir, target_cpu) | 310 _CopyDebugger(target_dir, target_cpu) |
311 | 311 |
312 | 312 |
313 def _CopyDebugger(target_dir, target_cpu): | 313 def _CopyDebugger(target_dir, target_cpu): |
314 """Copy dbghelp.dll into the requested directory as needed. | 314 """Copy dbghelp.dll and dbgcore.dll into the requested directory as needed. |
315 | 315 |
316 target_cpu is one of 'x86' or 'x64'. | 316 target_cpu is one of 'x86' or 'x64'. |
317 | 317 |
318 dbghelp.dll is used when Chrome needs to symbolize stacks. Copying this file | 318 dbghelp.dll is used when Chrome needs to symbolize stacks. Copying this file |
319 from the SDK directory avoids using the system copy of dbghelp.dll which then | 319 from the SDK directory avoids using the system copy of dbghelp.dll which then |
320 ensures compatibility with recent debug information formats, such as VS | 320 ensures compatibility with recent debug information formats, such as VS |
321 2017 /debug:fastlink PDBs. | 321 2017 /debug:fastlink PDBs. |
| 322 |
| 323 dbgcore.dll is needed when using some functions from dbghelp.dll (like |
| 324 MinidumpWriteDump). |
322 """ | 325 """ |
323 win_sdk_dir = SetEnvironmentAndGetSDKDir() | 326 win_sdk_dir = SetEnvironmentAndGetSDKDir() |
324 if not win_sdk_dir: | 327 if not win_sdk_dir: |
325 return | 328 return |
326 | 329 |
327 debug_file = 'dbghelp.dll' | 330 debug_files = ['dbghelp.dll', 'dbgcore.dll'] |
328 full_path = os.path.join(win_sdk_dir, 'Debuggers', target_cpu, debug_file) | 331 for debug_file in debug_files: |
329 if not os.path.exists(full_path): | 332 full_path = os.path.join(win_sdk_dir, 'Debuggers', target_cpu, debug_file) |
330 raise Exception('dbghelp.dll not found in "%s"\r\nYou must install the ' | 333 if not os.path.exists(full_path): |
331 '"Debugging Tools for Windows" feature from the Windows ' | 334 raise Exception('%s not found in "%s"\r\nYou must install the ' |
332 '10 SDK.' % full_path) | 335 '"Debugging Tools for Windows" feature from the Windows ' |
333 target_path = os.path.join(target_dir, debug_file) | 336 '10 SDK.' % (debug_file, full_path)) |
334 _CopyRuntimeImpl(target_path, full_path) | 337 target_path = os.path.join(target_dir, debug_file) |
| 338 _CopyRuntimeImpl(target_path, full_path) |
335 | 339 |
336 | 340 |
337 def _GetDesiredVsToolchainHashes(): | 341 def _GetDesiredVsToolchainHashes(): |
338 """Load a list of SHA1s corresponding to the toolchains that we want installed | 342 """Load a list of SHA1s corresponding to the toolchains that we want installed |
339 to build with.""" | 343 to build with.""" |
340 env_version = GetVisualStudioVersion() | 344 env_version = GetVisualStudioVersion() |
341 if env_version == '2015': | 345 if env_version == '2015': |
342 # Update 3 final with 10.0.15063.468 SDK and no vctip.exe. | 346 # Update 3 final with 10.0.15063.468 SDK and no vctip.exe. |
343 return ['f53e4598951162bad6330f7a167486c7ae5db1e5'] | 347 return ['f53e4598951162bad6330f7a167486c7ae5db1e5'] |
344 if env_version == '2017': | 348 if env_version == '2017': |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 'copy_dlls': CopyDlls, | 444 'copy_dlls': CopyDlls, |
441 } | 445 } |
442 if len(sys.argv) < 2 or sys.argv[1] not in commands: | 446 if len(sys.argv) < 2 or sys.argv[1] not in commands: |
443 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) | 447 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) |
444 return 1 | 448 return 1 |
445 return commands[sys.argv[1]](*sys.argv[2:]) | 449 return commands[sys.argv[1]](*sys.argv[2:]) |
446 | 450 |
447 | 451 |
448 if __name__ == '__main__': | 452 if __name__ == '__main__': |
449 sys.exit(main()) | 453 sys.exit(main()) |
OLD | NEW |