int IDebugEngine2.Attach( IDebugProgram2[] rgpPrograms, IDebugProgramNode2[] rgpProgramNodes, uint celtPrograms, IDebugEventCallback2 pCallback, enum_ATTACH_REASON dwReason) { var program = rgpProgramNodes[0] as Program; if (program == null) { return(VSConstants.E_FAIL); } Callback = pCallback; DebugEvent.Send(new EngineCreateEvent(this)); if (rgpPrograms[0].GetProgramId(out Guid pguidProgramId) != VSConstants.S_OK) { return(VSConstants.E_FAIL); } program.ProgramId = pguidProgramId; DebugEvent.Send(new ProgramCreateEvent(program)); DebugEvent.Send(new ThreadCreateEvent(program)); DebugEvent.Send(new LoadCompleteEvent(program)); DebugEvent.Send(new EntryPointEvent(program)); program.OutputWriteLine("Connecting to the QML runtime..."); return(VSConstants.S_OK); }
int IDebugExpression2.EvaluateAsync( enum_EVALFLAGS dwFlags, IDebugEventCallback2 pExprCallback) { _ = Task.Run(() => { var value = Debugger.Evaluate(StackFrame.FrameNumber, ExpressionString); if (value != null) { value.Name = ExpressionString; } Program.Refresh(); DebugEvent.Send(new ExpressionEvaluationCompleteEvent( pExprCallback, this, Property.Create(StackFrame, 0, value))); }); return(VSConstants.S_OK); }
int IDebugEngineLaunch2.TerminateProcess(IDebugProcess2 pProcess) { if (pProcess.GetProcessId(out Guid procId) != VSConstants.S_OK) { return(VSConstants.E_FAIL); } if (!programs.TryGetValue(procId, out Program program)) { return(VSConstants.S_FALSE); } programs.Remove(procId); DebugEvent.Send(new ThreadDestroyEvent(program, 0)); DebugEvent.Send(new ProgramDestroyEvent(program, 0)); return(VSConstants.S_OK); }
public void NotifyBreakpointHit(Breakpoint breakpoint) { BreakAllProcesses = false; DebugEvent.Send(new BreakpointEvent(this, BoundBreakpointsEnum.Create(breakpoint))); }
public void NotifyBreakpointSet(Breakpoint breakpoint) { DebugEvent.Send(new BreakpointBoundEvent(breakpoint)); }
void IDebuggerEventSink.NotifyBreak() { BreakAllProcesses = false; DebugEvent.Send(new StepCompleteEvent(this)); }
public void OutputWriteLine(string msg) { DebugEvent.Send(new OutputStringEvent(this, msg + "\r\n")); }
public static void Send(DebugEvent debugEvent) { debugEvent.Send(); }