internal void BreakpointHit(AD7PendingBreakpoint breakpoint, AD7Thread thread) { var iid = new Guid(AD7BreakpointEvent.IID); _eventCallback.Event(_engine, _engine.RemoteProcess, _engine, thread, new AD7BreakpointEvent(breakpoint), ref iid, AD7StoppingEvent.Attributes); }
internal void ThreadStarted(AD7Thread thread) { var iid = new Guid(AD7ThreadCreateEvent.IID); _eventCallback.Event(_engine, _engine.RemoteProcess, _engine, thread, new AD7ThreadCreateEvent(), ref iid, AD7StoppingEvent.Attributes); }
internal void StartDebugging() { if (_vm != null) { return; } _vm = VirtualMachineManager.Connect(new IPEndPoint(_ipAddress, 11000)); _vm.EnableEvents(EventType.AssemblyLoad, EventType.ThreadStart, EventType.ThreadDeath, EventType.AssemblyUnload, EventType.UserBreak, EventType.Exception, EventType.UserLog, EventType.KeepAlive, EventType.TypeLoad); EventSet set = _vm.GetNextEventSet(); if (set.Events.OfType <VMStartEvent>().Any()) { //TODO: review by techcap _mainThread = new AD7Thread(_engine, new DebuggedThread(set.Events[0].Thread, _engine)); _engine.Callback.ThreadStarted(_mainThread); Task.Factory.StartNew(ReceiveThread, TaskCreationOptions.LongRunning); } else { throw new Exception("Didnt get VMStart-Event!"); } }
public int Continue(IDebugThread2 pThread) { // VS Code currently isn't providing a thread Id in certain cases. Work around this by handling null values. AD7Thread thread = pThread as AD7Thread; _dispatcher.Queue(() => DebuggedProcess.Continue(thread?.GetDebuggedThread())); return(VSConstants.S_OK); }
public DebuggedThread(ThreadMirror thread, AD7Engine engine) { Thread = thread; Id = thread.TID; Name = ""; TargetId = thread.TID; AD7Thread ad7Thread = new AD7Thread(engine, this); Client = ad7Thread; }
internal void Step(AD7Thread thread, enum_STEPKIND sk, enum_STEPUNIT stepUnit) { if (!isStepping) { if (currentStepRequest == null) { currentStepRequest = _vm.CreateStepRequest(thread.ThreadMirror); } else { currentStepRequest.Disable(); } isStepping = true; if (stepUnit == enum_STEPUNIT.STEP_LINE || stepUnit == enum_STEPUNIT.STEP_STATEMENT) { switch (sk) { case enum_STEPKIND.STEP_INTO: currentStepRequest.Depth = StepDepth.Into; break; case enum_STEPKIND.STEP_OUT: currentStepRequest.Depth = StepDepth.Out; break; case enum_STEPKIND.STEP_OVER: currentStepRequest.Depth = StepDepth.Over; break; default: return; } } else if (stepUnit == enum_STEPUNIT.STEP_INSTRUCTION) { //TODO: by techcap } else { throw new NotImplementedException(); } currentStepRequest.Size = StepSize.Line; currentStepRequest.Enable(); } _vm.Resume(); }
public AD7StackFrame(AD7Engine engine, AD7Thread thread, Mono.Debugger.Soft.StackFrame threadContext) { Debug.Assert(threadContext != null, "ThreadContext is null"); Engine = engine; this.Thread = thread; this.ThreadContext = threadContext; _textPosition = RoslynHelper.GetStatementRange(ThreadContext.FileName, ThreadContext.LineNumber, ThreadContext.ColumnNumber); _functionName = threadContext.Method.Name; //if(threadContext.IsNativeTransition) //{ //} if (_textPosition != null) { docContext = new AD7DocumentContext(_textPosition); } this.LocalVariables = threadContext.GetVisibleVariables().Select(x => new MonoProperty(threadContext, x)).ToList(); }
internal void StartDebugging() { if (_vm != null) return; _vm = VirtualMachineManager.Connect(new IPEndPoint(_ipAddress, 11000)); _vm.EnableEvents(EventType.AssemblyLoad, EventType.ThreadStart, EventType.ThreadDeath, EventType.AssemblyUnload, EventType.UserBreak, EventType.Exception, EventType.UserLog, EventType.KeepAlive, EventType.TypeLoad); EventSet set = _vm.GetNextEventSet(); if (set.Events.OfType<VMStartEvent>().Any()) { //TODO: review by techcap _mainThread = new AD7Thread(_engine, new DebuggedThread(set.Events[0].Thread, _engine)); _engine.Callback.ThreadStarted(_mainThread); Task.Factory.StartNew(ReceiveThread, TaskCreationOptions.LongRunning); } else throw new Exception("Didnt get VMStart-Event!"); }
internal void Step(AD7Thread thread, enum_STEPKIND sk, enum_STEPUNIT stepUnit) { if (!isStepping) { if (currentStepRequest == null) currentStepRequest = _vm.CreateStepRequest(thread.ThreadMirror); else { currentStepRequest.Disable(); } isStepping = true; if (stepUnit == enum_STEPUNIT.STEP_LINE || stepUnit == enum_STEPUNIT.STEP_STATEMENT) { switch (sk) { case enum_STEPKIND.STEP_INTO: currentStepRequest.Depth = StepDepth.Into; break; case enum_STEPKIND.STEP_OUT: currentStepRequest.Depth = StepDepth.Out; break; case enum_STEPKIND.STEP_OVER: currentStepRequest.Depth = StepDepth.Over; break; default: return; } } else if (stepUnit == enum_STEPUNIT.STEP_INSTRUCTION) { //TODO: by techcap } else throw new NotImplementedException(); currentStepRequest.Size = StepSize.Line; currentStepRequest.Enable(); } _vm.Resume(); }
//internal void Resume() //{ // _vm.Resume(); //} /// <summary> /// For Run /// </summary> /// <param name="debuggedMonoThread"></param> internal void Execute(AD7Thread debuggedMonoThread) { _vm.Resume(); }
internal void StepCompleted(AD7Thread thread) { var iid = new Guid(AD7StepCompleteEvent.IID); _eventCallback.Event(_engine, _engine.RemoteProcess, _engine, thread, new AD7StepCompleteEvent(), ref iid, AD7StoppingEvent.Attributes); }