Пример #1
0
        public static ITargetHostProcess Attach(string attachJson)
        {
            var process  = new DebugAdapterRemoteProcess();
            var attached = process.AttachProcess(attachJson);

            return(attached ? process : null);
        }
Пример #2
0
        public ITargetHostProcess LaunchAdapter(IAdapterLaunchInfo launchInfo, ITargetHostInterop targetInterop)
        {
            // ITargetHostInterop provides a convenience wrapper to start the process
            // return targetInterop.ExecuteCommandAsync(path, "");

            // If you need more control use the DebugAdapterProcess
            if (launchInfo.LaunchType == LaunchType.Attach)
            {
                return(DebugAdapterRemoteProcess.Attach(launchInfo.LaunchJson));
            }
            return(DebugAdapterProcess.Start(launchInfo.LaunchJson));
        }
Пример #3
0
        public ITargetHostProcess LaunchAdapter(IAdapterLaunchInfo launchInfo, ITargetHostInterop targetInterop)
        {
            if (launchInfo.LaunchType == LaunchType.Attach)
            {
                var debugAttachInfo = (DebugAttachInfo)_debugInfo;
                return(DebugAdapterRemoteProcess.Attach(debugAttachInfo));
            }

            var debugLaunchInfo         = (DebugLaunchInfo)_debugInfo;
            var debugPyAdapterDirectory = Path.GetDirectoryName(PythonToolsInstallPath.GetFile("debugpy\\adapter\\__init__.py"));
            var targetProcess           = new DebugAdapterProcess(_adapterHostContext, targetInterop, debugPyAdapterDirectory);

            return(targetProcess.StartProcess(debugLaunchInfo.InterpreterPathAndArguments.FirstOrDefault(), debugLaunchInfo.LaunchWebPageUrl));
        }
Пример #4
0
        public static ITargetHostProcess Attach(DebugAttachInfo debugAttachInfo)
        {
            var attachedProcess = new DebugAdapterRemoteProcess();

            return(attachedProcess.ConnectSocket(debugAttachInfo.RemoteUri) ? attachedProcess : null);
        }