当前位置: 首页>>代码示例>>C#>>正文


C# IDebugProcess2.GetPort方法代码示例

本文整理汇总了C#中IDebugProcess2.GetPort方法的典型用法代码示例。如果您正苦于以下问题:C# IDebugProcess2.GetPort方法的具体用法?C# IDebugProcess2.GetPort怎么用?C# IDebugProcess2.GetPort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDebugProcess2的用法示例。


在下文中一共展示了IDebugProcess2.GetPort方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: catch

        // Resume a process launched by IDebugEngineLaunch2.LaunchSuspended
        int IDebugEngineLaunch2.ResumeProcess(IDebugProcess2 process)
        {
            Debug.Assert(_pollThread != null);
            Debug.Assert(_engineCallback != null);
            Debug.Assert(_debuggedProcess != null);
            Debug.Assert(_ad7ProgramId == Guid.Empty);

            try
            {
                AD_PROCESS_ID processId = EngineUtils.GetProcessId(process);

                if (!EngineUtils.ProcIdEquals(processId, _debuggedProcess.Id))
                {
                    return Constants.S_FALSE;
                }

                // Send a program node to the SDM. This will cause the SDM to turn around and call IDebugEngine2.Attach
                // which will complete the hookup with AD7
                IDebugPort2 port;
                EngineUtils.RequireOk(process.GetPort(out port));

                IDebugDefaultPort2 defaultPort = (IDebugDefaultPort2)port;

                IDebugPortNotify2 portNotify;
                EngineUtils.RequireOk(defaultPort.GetPortNotify(out portNotify));

                EngineUtils.RequireOk(portNotify.AddProgramNode(new AD7ProgramNode(_debuggedProcess.Id)));

                if (_ad7ProgramId == Guid.Empty)
                {
                    Debug.Fail("Unexpected problem -- IDebugEngine2.Attach wasn't called");
                    return Constants.E_FAIL;
                }

                // NOTE: We wait for the program create event to be continued before we really resume the process

                return Constants.S_OK;
            }
            catch (MIException e)
            {
                return e.HResult;
            }
            catch (Exception e) when (ExceptionHelper.BeforeCatch(e, Logger, reportOnlyCorrupting: true))
            {
                return EngineUtils.UnexpectedException(e);
            }
        }
开发者ID:wesrupert,项目名称:MIEngine,代码行数:48,代码来源:AD7Engine.cs

示例2: Command

        // Resume a process launched by IDebugEngineLaunch2.LaunchSuspended
        int IDebugEngineLaunch2.ResumeProcess(IDebugProcess2 process)
        {
            IDebugPort2 port;
            EngineUtils.RequireOk(process.GetPort(out port));

            IDebugDefaultPort2 defaultPort = (IDebugDefaultPort2)port;

            IDebugPortNotify2 portNotify;
            EngineUtils.RequireOk(defaultPort.GetPortNotify(out portNotify));

            EngineUtils.RequireOk(portNotify.AddProgramNode(new AD7ProgramNode((int)pi.dwProcessId)));

            if (this.m_ad7ProgramId == Guid.Empty)
            {
                Debug.Fail("Attaching failed");
                return VSConstants.E_FAIL;
            }

            this._programCreateContinued.WaitOne();
            this.writeCommandQueue.Enqueue(new Command(CommandKind.DebuggerEnvironmentReady));

            NativeMethods.ResumeThread(threadHandle);
            return 0;
        }
开发者ID:e42s,项目名称:VSLua,代码行数:25,代码来源:AD7Engine.cs

示例3:

        // This function is used to terminate a process that the SampleEngine launched
        // The debugger will call IDebugEngineLaunch2::CanTerminateProcess before calling this method.
        int IDebugEngineLaunch2.TerminateProcess(IDebugProcess2 process)
        {
            Log.Debug("Engine: TerminateProcess");
            _events.ProgramDestroyed(_node);

            IDebugPort2 port;
            process.GetPort(out port);

            var defaultPort = (IDebugDefaultPort2)port;
            IDebugPortNotify2 notify;

            defaultPort.GetPortNotify(out notify);

            notify.RemoveProgramNode(_node);

            Debugger.Stop();

            return VSConstants.S_OK;
        }
开发者ID:vairam-svs,项目名称:poshtools,代码行数:21,代码来源:Engine.cs

示例4: ResumeProcess

        public int ResumeProcess(IDebugProcess2 pProcess)
        {
            DebugHelper.TraceEnteringMethod();
            IDebugPort2 port;
            pProcess.GetPort(out port);
            Guid id;
            pProcess.GetProcessId(out id);
            var defaultPort = (IDebugDefaultPort2) port;
            IDebugPortNotify2 notify;
            defaultPort.GetPortNotify(out notify);

            int result = notify.AddProgramNode(new AD7ProgramNode(DebuggedProcess, id));

            return VSConstants.S_OK;
        }
开发者ID:Staticlabs,项目名称:MonoRemoteDebugger,代码行数:15,代码来源:AD7Engine.cs

示例5: ResumeProcess

        /// <summary>
        /// Resumes process execution.
        /// </summary>
        /// <param name="pProcess">An IDebugProcess2 object that represents the process to be resumed.</param>
        /// <returns>
        /// If successful, returns S_OK; otherwise returns an error code.
        /// </returns>
        public override int ResumeProcess( IDebugProcess2 pProcess )
        {
            Logger.Debug( string.Empty );
            var process = pProcess as PowerShellProcess;
            if ( process == null )
            {
                return VSConstants.E_UNEXPECTED;
            }

            IDebugPort2 port;
            pProcess.GetPort( out port );

            var defaultPort = (IDebugDefaultPort2) port;

            IDebugPortNotify2 portNotify;
            defaultPort.GetPortNotify( out portNotify );

            portNotify.AddProgramNode( Program );

            return VSConstants.S_OK;
        }
开发者ID:IntelliTect,项目名称:PowerStudio,代码行数:28,代码来源:PowerShellDebugEngine.cs

示例6: catch

        /// <summary>
        /// Resume a process launched by IDebugEngineLaunch2.LaunchSuspended. (http://msdn.microsoft.com/en-us/library/bb146261.aspx)
        /// </summary>
        /// <param name="process"> An IDebugProcess2 object that represents the process to be resumed. </param>
        /// <returns> An IDebugProcess2 object that represents the process to be resumed. </returns>
        int IDebugEngineLaunch2.ResumeProcess(IDebugProcess2 process)
        {
            Debug.Assert(m_engineCallback != null);

            try
            {
                var xProcess = process as AD7Process;
                if (xProcess == null)
                {
                    return VSConstants.E_INVALIDARG;
                }

                // Send a program node to the SDM. This will cause the SDM to turn around and call IDebugEngine2.Attach
                // which will complete the hookup with AD7
                IDebugPort2 port = null;
                EngineUtils.RequireOk(process.GetPort(out port));

                IDebugDefaultPort2 defaultPort = (IDebugDefaultPort2)port;

                IDebugPortNotify2 portNotify = null;
                EngineUtils.RequireOk(defaultPort.GetPortNotify(out portNotify));

                EngineUtils.RequireOk(portNotify.AddProgramNode(m_progNode));

                Callback.OnModuleLoad(m_module);

                Callback.OnThreadStart(currentThread());
            }
            catch (Exception e)
            {
                return EngineUtils.UnexpectedException(e);
            }
            return VSConstants.S_OK;
        }
开发者ID:blackberry,项目名称:VSPlugin,代码行数:39,代码来源:AD7Engine.cs

示例7: catch

        // Resume a process launched by IDebugEngineLaunch2.LaunchSuspended
        int IDebugEngineLaunch2.ResumeProcess(IDebugProcess2 process)
        {
            //Debug.Assert(Worker.MainThreadId == Worker.CurrentThreadId);
            Debug.Assert(m_pollThread != null);
            Debug.Assert(m_engineCallback != null);
            Debug.Assert(m_debuggedProcess != null);
            Debug.Assert(m_ad7ProgramId == Guid.Empty);

            try {
                var processId = EngineUtils.GetProcessId(process);

                if (processId != m_debuggedProcess.Id) {
                    return Constants.S_FALSE;
                }

                // Send a program node to the SDM. This will cause the SDM to turn around and call IDebugEngine2.Attach
                // which will complete the hookup with AD7
                IDebugPort2 port;
                EngineUtils.RequireOk(process.GetPort(out port));

                var defaultPort = (IDebugDefaultPort2)port;

                IDebugPortNotify2 portNotify;
                EngineUtils.RequireOk(defaultPort.GetPortNotify(out portNotify));

                EngineUtils.RequireOk(portNotify.AddProgramNode(new AD7ProgramNode(m_debuggedProcess.Id)));

                if (m_ad7ProgramId == Guid.Empty) {
                    Debug.Fail("Unexpected problem -- IDebugEngine2.Attach wasn't called");
                    return Constants.E_FAIL;
                }

                // Resume the threads in the debuggee process
                m_pollThread.RunOperation(() => m_debuggedProcess.ResumeFromLaunch());

                return Constants.S_OK;
            } catch (Exception e) {
                return EngineUtils.UnexpectedException(e);
            }
        }
开发者ID:bagobor,项目名称:NodeVsDebugger,代码行数:41,代码来源:AD7Engine.cs

示例8: catch

        // Resume a process launched by IDebugEngineLaunch2.LaunchSuspended
        int IDebugEngineLaunch2.ResumeProcess(IDebugProcess2 process)
        {
            Debug.Assert(m_engineCallback != null);

            try
            {
                var xProcess = process as AD7Process;
                if (xProcess == null)
                {
                    return VSConstants.E_INVALIDARG;
                }

                // Send a program node to the SDM. This will cause the SDM to turn around and call IDebugEngine2.Attach
                // which will complete the hookup with AD7
                IDebugPort2 port = null;
                EngineUtils.RequireOk(process.GetPort(out port));

                IDebugDefaultPort2 defaultPort = (IDebugDefaultPort2)port;

                IDebugPortNotify2 portNotify = null;
                EngineUtils.RequireOk(defaultPort.GetPortNotify(out portNotify));

                //EngineUtils.RequireOk(portNotify.AddProgramNode(new AD7ProgramNode(m_debuggedProcess.Id))); //Copy AD7ProgramNode from Cosmos
                EngineUtils.RequireOk(portNotify.AddProgramNode(m_progNode)); //Copy AD7ProgramNode from Cosmos

                Callback.OnModuleLoad(m_module);
                //Callback.OnSymbolSearch(m_module, xProcess.mISO.Replace("iso", "pdb"), enum_MODULE_INFO_FLAGS.MIF_SYMBOLS_LOADED); // from Cosmos

                // Important!
                //
                // This call triggers setting of breakpoints that exist before run.
                // So it must be called before we resume the process.
                // If not called VS will call it after our 3 startup events, but thats too late.
                // This line was commented out in earlier Cosmos builds and caused problems with
                // breakpoints and timing.
                Callback.OnThreadStart(currentThread());

                m_process.ResumeFromLaunch();
            }
            catch (Exception e)
            {
                return EngineUtils.UnexpectedException(e);
            }
            return VSConstants.S_OK;
        }
开发者ID:hkopparru,项目名称:VSPlugin,代码行数:46,代码来源:AD7Engine.cs

示例9:

    int IDebugEngineLaunch2.TerminateProcess(IDebugProcess2 pProcess)
    {
      _node.Debugger.DoEndProgram();
      Debug.WriteLine("AD7Engine TerminateProcess");

      IDebugPort2 port;
      pProcess.GetPort(out port);

      var defaultPort = (IDebugDefaultPort2)port;
      IDebugPortNotify2 notify;

      defaultPort.GetPortNotify(out notify);

      notify.RemoveProgramNode(_node);
      
      return VSConstants.S_OK;
    }
开发者ID:eeeee,项目名称:mysql-connector-net,代码行数:17,代码来源:AD7Engine.cs


注:本文中的IDebugProcess2.GetPort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。