// EnumThreads is called by the debugger when it needs to enumerate the threads in the program. public int EnumThreads(out IEnumDebugThreads2 ppEnum) { DebugWriteCommand("EnumThreads"); AssertMainThread(); var threadObjects = new AD7Thread[_threads.Count]; int i = 0; foreach (var keyValue in _threads) { var adThread = keyValue.Value; Debug.Assert(adThread != null); threadObjects[i++] = adThread; } ppEnum = new AD7ThreadEnum(threadObjects); return VSConstants.S_OK; }
private void OnDebuggerOutput(object sender, OutputEventArgs e) { AD7Thread thread = null; if (e.Thread != null && !_threads.TryGetValue(e.Thread, out thread)) { _threads[e.Thread] = thread = new AD7Thread(this, e.Thread); } // thread can be null for an output string event because it is not // a stopping event. Send(new AD7DebugOutputStringEvent2(e.Output), AD7DebugOutputStringEvent2.IID, thread); }
private void SendThreadCreate(AD7Thread ad7Thread) { Send(new AD7ThreadCreateEvent(), AD7ThreadCreateEvent.IID, ad7Thread); }
private void OnAsyncBreakComplete(object sender, ThreadEventArgs e) { AD7Thread thread; if (!_threads.TryGetValue(e.Thread, out thread)) { _threads[e.Thread] = thread = new AD7Thread(this, e.Thread); } Send(new AD7AsyncBreakCompleteEvent(), AD7AsyncBreakCompleteEvent.IID, thread); }
private void OnThreadCreated(object sender, ThreadEventArgs e) { LiveLogger.WriteLine("Thread created: " + e.Thread.Id); lock (_syncLock) { var newThread = new AD7Thread(this, e.Thread); // Treat first thread created as main thread // Should only be one for Node Debug.Assert(_mainThread == null); if (_mainThread == null) { _mainThread = newThread; } _threads.Add(e.Thread, newThread); if (_loadComplete) { SendThreadCreate(newThread); } } }
public AD7StackFrame(AD7Engine engine, AD7Thread thread, NodeStackFrame stackFrame) { this._engine = engine; this._thread = thread; this._stackFrame = stackFrame; }
public AD7StackFrame(AD7Engine engine, AD7Thread thread, NodeStackFrame stackFrame) { _engine = engine; _thread = thread; _stackFrame = stackFrame; }