#!/usr/bin/env python# Copyright 2020 the V8 project authors. All rights reserved.# Use of this source code is governed by a BSD-style license that can be# found in the LICENSE file."""This program copies dbgeng.dll from the Windows SDK to the output directory,so that we can test v8windbg. (The version of dbgeng.dll in system32, whichwould be loaded otherwise, is insufficient.)Arguments:1. The directory that contains vs_toolchain.py2. The directory to copy to3. The cpu type for this build"""importsysimportosvs_toolchain_dir,target_dir,target_cpu=sys.argv[1:]sys.path.insert(0,vs_toolchain_dir)importvs_toolchaindefCopyDebuggerFile(debug_file):win_sdk_dir=vs_toolchain.SetEnvironmentAndGetSDKDir()ifnotwin_sdk_dir:returnfull_path=os.path.join(win_sdk_dir,'Debuggers',target_cpu,debug_file)ifnotos.path.exists(full_path):returntarget_path=os.path.join(target_dir,debug_file)vs_toolchain._CopyRuntimeImpl(target_path,full_path,verbose=False)# Ninja expects the file's timestamp to be newer than this script.os.utime(target_path,None)CopyDebuggerFile('dbgeng.dll')