private CorDebugProcess GetProcess(IDebugProgramNode2 programNode) { AD_PROCESS_ID[] pids = new AD_PROCESS_ID[1]; programNode.GetHostPid(pids); return(GetProcess(pids[0])); }
/// <summary> /// Registers a program that can be debugged with the port it is running on. /// </summary> int IDebugPortNotify2.AddProgramNode(IDebugProgramNode2 pProgramNode) { DLog.Debug(DContext.VSDebuggerComCall, "IDebugPortNotify2.AddProgramNode"); IDebugProcess2 proc; var pid = new AD_PROCESS_ID[1]; ErrorHandler.ThrowOnFailure(pProgramNode.GetHostPid(pid)); ErrorHandler.ThrowOnFailure(((IDebugPort2)this).GetProcess(pid[0], out proc)); // Our implementation conflates ProgramNode and Program, // perhaps erroneously. var program = (IDebugProgram2)pProgramNode; SendEvent(null, this, proc, null, new ProcessCreateEvent()); SendEvent(null, this, proc, program, new ProgramCreateEvent()); return(VSConstants.S_OK); }
private CorDebugProcess GetProcess( IDebugProgramNode2 programNode ) { AD_PROCESS_ID[] pids = new AD_PROCESS_ID[1]; programNode.GetHostPid( pids ); return GetProcess( pids[0] ); }
/// <summary> /// Registers a program that can be debugged with the port it is running on. /// </summary> int IDebugPortNotify2.AddProgramNode(IDebugProgramNode2 pProgramNode) { DLog.Debug(DContext.VSDebuggerComCall, "IDebugPortNotify2.AddProgramNode"); IDebugProcess2 proc; var pid = new AD_PROCESS_ID[1]; ErrorHandler.ThrowOnFailure(pProgramNode.GetHostPid(pid)); ErrorHandler.ThrowOnFailure(((IDebugPort2)this).GetProcess(pid[0], out proc)); // Our implementation conflates ProgramNode and Program, // perhaps erroneously. var program = (IDebugProgram2)pProgramNode; SendEvent(null, this, proc, null, new ProcessCreateEvent()); SendEvent(null, this, proc, program, new ProgramCreateEvent()); return VSConstants.S_OK; }