// ExecuteOnThread is called when the SDM wants execution to continue and have // stepping state cleared. public int ExecuteOnThread(IDebugThread2 pThread) { AD7Thread thread = (AD7Thread)pThread; try { _pollThread.RunOperation(() => _debuggedProcess.Execute(thread.GetDebuggedThread())); } catch (InvalidCoreDumpOperationException) { return(AD7_HRESULT.E_CRASHDUMP_UNSUPPORTED); } return(VSConstants.S_OK); }
// This method is deprecated. Use the IDebugProcess3::Step method instead. public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step) { AD7Thread thread = (AD7Thread)pThread; try { _debuggedProcess.WorkerThread.RunOperation(() => _debuggedProcess.Step(thread.GetDebuggedThread().Id, sk, Step)); } catch (InvalidCoreDumpOperationException) { return(AD7_HRESULT.E_CRASHDUMP_UNSUPPORTED); } return(VSConstants.S_OK); }
// EnumThreads is called by the debugger when it needs to enumerate the threads in the program. public int EnumThreads(out IEnumDebugThreads2 ppEnum) { DebuggedThread[] threads = null; DebuggedProcess.WorkerThread.RunOperation(async() => threads = await DebuggedProcess.ThreadCache.GetThreads()); AD7Thread[] threadObjects = new AD7Thread[threads.Length]; for (int i = 0; i < threads.Length; i++) { Debug.Assert(threads[i].Client != null); threadObjects[i] = (AD7Thread)threads[i].Client; } ppEnum = new AD7ThreadEnum(threadObjects); return(VSConstants.S_OK); }
public AD7StackFrame(AD7Engine engine, AD7Thread thread, ThreadContext threadContext) { Debug.Assert(threadContext != null, "ThreadContext is null"); Engine = engine; Thread = thread; ThreadContext = threadContext; _textPosition = threadContext.TextPosition; _functionName = threadContext.Function; if (_textPosition != null) { _documentCxt = new AD7DocumentContext(_textPosition, _codeCxt); if (_codeCxt != null) { _codeCxt.SetDocumentContext(_documentCxt); } } }