Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public void NotifyBreakpointHit(Breakpoint breakpoint)
 {
     BreakAllProcesses = false;
     DebugEvent.Send(new BreakpointEvent(this, BoundBreakpointsEnum.Create(breakpoint)));
 }
Exemplo n.º 5
0
 public void NotifyBreakpointSet(Breakpoint breakpoint)
 {
     DebugEvent.Send(new BreakpointBoundEvent(breakpoint));
 }
Exemplo n.º 6
0
 void IDebuggerEventSink.NotifyBreak()
 {
     BreakAllProcesses = false;
     DebugEvent.Send(new StepCompleteEvent(this));
 }
Exemplo n.º 7
0
 public void OutputWriteLine(string msg)
 {
     DebugEvent.Send(new OutputStringEvent(this, msg + "\r\n"));
 }
Exemplo n.º 8
0
 public static void Send(DebugEvent debugEvent)
 {
     debugEvent.Send();
 }