public int EnumThreads(out IEnumDebugThreads2 ppEnum) { // EnumThreads is called by the debugger when it needs to enumerate the threads in the program. ppEnum = new AD7ThreadEnum(new[] { mThread }); return(VSConstants.S_OK); }
int Microsoft.VisualStudio.Debugger.Interop.IDebugProgram2.EnumThreads(out IEnumDebugThreads2 ppEnum) { // CorDebugProcess.Microsoft.VisualStudio.Debugger.Interop.IDebugProgram2.EnumThreads is not implemented //If we need to implement this, must return a copy without any VirtualThreads ppEnum = null; return(COM_HResults.S_OK); }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { var threads = debugged.Threads.Values.ToArray(); ppEnum = new AD7ThreadEnum(threads as IDebugThread2[]); return(Constants.S_OK); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public int EnumThreads (out IEnumDebugThreads2 ppEnum) { // // Enumerates the threads that are running in this program. // LoggingUtils.PrintFunction (); try { List<IDebugThread2> threads = new List<IDebugThread2> (); threads.AddRange (m_debugThreads.Values); ppEnum = new DebuggeeThread.Enumerator (threads); if (ppEnum == null) { throw new InvalidOperationException (); } return Constants.S_OK; } catch (Exception e) { LoggingUtils.HandleException (e); ppEnum = null; return Constants.E_FAIL; } }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { var xEnum = new AD7ThreadEnum(new IDebugThread2[] { mThread }); ppEnum = xEnum; return(VSConstants.S_OK); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public int EnumThreads(out IEnumDebugThreads2 ppEnum) { // // Enumerates the threads that are running in this program. // LoggingUtils.PrintFunction(); try { if (AttachedEngine == null) { throw new InvalidOperationException(); } List <IDebugThread2> threads = new List <IDebugThread2> (); uint count; { LoggingUtils.RequireOk(AttachedEngine.NativeDebugger.NativeProgram.EnumThreads(out ppEnum)); LoggingUtils.RequireOk(ppEnum.GetCount(out count)); IDebugThread2 [] threadArray = new IDebugThread2 [count]; LoggingUtils.RequireOk(ppEnum.Next(count, threadArray, ref count)); threads.AddRange(threadArray); } { LoggingUtils.RequireOk(AttachedEngine.JavaDebugger.JavaProgram.EnumThreads(out ppEnum)); LoggingUtils.RequireOk(ppEnum.GetCount(out count)); IDebugThread2 [] threadArray = new IDebugThread2 [count]; LoggingUtils.RequireOk(ppEnum.Next(count, threadArray, ref count)); } ppEnum = new DebuggeeThread.Enumerator(threads); if (ppEnum == null) { throw new InvalidOperationException(); } return(Constants.S_OK); } catch (Exception e) { LoggingUtils.HandleException(e); ppEnum = null; return(Constants.E_FAIL); } }
// Token: 0x06000179 RID: 377 RVA: 0x00006020 File Offset: 0x00004220 public int EnumThreads(out IEnumDebugThreads2 ppEnum) { ThreadInfo[] threads = this.Session.GetProcesses()[0].GetThreads(); ppEnum = new AD7ThreadEnum(from t in this.thread_hash.Values where threads.Any((ThreadInfo th) => th.Id == t.ID) select t); return(0); }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { DebugHelper.TraceEnteringMethod(); var threads = DebuggedProcess.GetThreads(); ppEnum = new AD7ThreadEnum(threads); return(VSConstants.S_OK); }
/// <summary> /// EnumThreads is called by the debugger when it needs to enumerate the threads in the program. /// </summary> /// <param name="ppEnum"></param> /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns> public int EnumThreads(out IEnumDebugThreads2 ppEnum) { ppEnum = new MonoThreadEnumerator(_threadManager.All .ToArray() .OfType <IDebugThread2>() .ToArray()); return(S_OK); }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { lock (_threads) { ppEnum = new EnumDebugThreads(_threads.Values); } 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) { var threadObjects = new AD7Thread[1]; AD7Thread adThread = _threads.Item2; Debug.Assert(adThread != null); threadObjects[0] = adThread; ppEnum = new AD7ThreadEnum(threadObjects); return(VSConstants.S_OK); }
void AssertEnumThreads(List <IDebugThread> mockThreads, IEnumDebugThreads2 enumThreads) { var numberThreads = mockThreads.Count; Assert.NotNull(enumThreads); uint fetched = 0; IDebugThread2[] debugthreads = new IDebugThread2[numberThreads]; enumThreads.Next((uint)numberThreads, debugthreads, ref fetched); Assert.AreEqual(numberThreads, fetched); for (int i = 0; i < numberThreads; i++) { Assert.AreEqual(mockThreads[i], debugthreads[i]); } }
int IDebugProgram2.EnumThreads(out IEnumDebugThreads2 ppEnum) { var threads = ThreadManager.All.ToArray(); var threadObjects = new MonoThread[threads.Length]; for (int i = 0; i < threads.Length; i++) { threadObjects[i] = threads[i]; } ppEnum = new MonoThreadEnum(threadObjects); 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 Microsoft.MIDebugEngine.AD7ThreadEnum(threadObjects); return(Constants.S_OK); }
// EnumThreads is called by the debugger when it needs to enumerate the threads in the program. public int EnumThreads(out IEnumDebugThreads2 ppEnum) { //Debug.Assert(Worker.MainThreadId == Worker.CurrentThreadId); DebuggedThread[] threads = debuggedProcess.GetThreads(); DebuggedThread[] threadObjects = new DebuggedThread[threads.Length]; for (int i = 0; i < threads.Length; i++) { Debug.Assert(threads[i] != null); threadObjects[i] = threads[i]; } ppEnum = new VisualSquirrel.Debugger.Engine.AD7ThreadEnum(threadObjects); return(EngineConstants.S_OK); }
// EnumThreads is called by the debugger when it needs to enumerate the threads in the program. public int EnumThreads(out IEnumDebugThreads2 ppEnum) { Debug.Assert(Worker.MainThreadId == Worker.CurrentThreadId); DebuggedThread[] threads = m_debuggedProcess.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 Microsoft.VisualStudio.Debugger.SampleEngine.AD7ThreadEnum(threadObjects); return(Constants.S_OK); }
// EnumThreads is called by the debugger when it needs to enumerate the threads in the program. public int EnumThreads(out IEnumDebugThreads2 ppEnum) { AssertMainThread(); AD7Thread[] threadObjects = new AD7Thread[_threads.Count]; int i = 0; foreach (var keyValue in _threads) { var thread = keyValue.Key; var adThread = keyValue.Value; Debug.Assert(adThread != null); threadObjects[i++] = adThread; } ppEnum = new AD7ThreadEnum(threadObjects); return(VSConstants.S_OK); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public int EnumThreads(out IEnumDebugThreads2 ppEnum) { // // Enumerates the threads running in the process. // LoggingUtils.PrintFunction(); try { LoggingUtils.RequireOk(DebuggeeProgram.EnumThreads(out ppEnum)); return(Constants.S_OK); } catch (Exception e) { LoggingUtils.HandleException(e); ppEnum = null; return(Constants.E_FAIL); } }
public int EnumThreads(out IEnumDebugThreads2 threadsEnum) { lock (_threadCache) { var remoteThreads = GetRemoteThreads(); // If we fail to get the list of threads, return the current cache instead. If we // send a ThreadCreateEvent, and then fail to return that thread on the next // EnumThreads call, that thread will be lost forever. if (remoteThreads.Count == 0) { threadsEnum = _threadEnumFactory.Create(_threadCache.Values); return(VSConstants.S_OK); } // Update the thread cache, and remove any stale entries. var deadIds = _threadCache.Keys.ToList(); foreach (var remoteThread in remoteThreads) { var currentThread = GetDebugThread(remoteThread); uint threadId; currentThread.GetThreadId(out threadId); deadIds.Remove(threadId); } foreach (var threadId in deadIds) { IDebugThread thread; if (_threadCache.TryGetValue(threadId, out thread)) { _debugEngineHandler.SendEvent(new ThreadDestroyEvent(0), Self, thread); _threadCache.Remove(threadId); } } threadsEnum = _threadEnumFactory.Create(_threadCache.Values); } 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) { if (_mixedMode) { ppEnum = null; return VSConstants.E_NOTIMPL; } AssertMainThread(); AD7Thread[] threadObjects = new AD7Thread[_threads.Count]; int i = 0; foreach (var keyValue in _threads) { var thread = keyValue.Key; var adThread = keyValue.Value; Debug.Assert(adThread != null); threadObjects[i++] = adThread; } ppEnum = new AD7ThreadEnum(threadObjects); return VSConstants.S_OK; }
int IDebugProgram3.EnumThreads(out IEnumDebugThreads2 ppEnum) { throw new NotImplementedException(); }
// EnumThreads is called by the debugger when it needs to enumerate the threads in the program. public int EnumThreads(out IEnumDebugThreads2 ppEnum) { ppEnum = null; return VSConstants.E_NOTIMPL; }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { throw new NotImplementedException(); }
/// <summary> /// Retrieves a list of all the threads running in all programs in the process. Not implemented. /// (http://msdn.microsoft.com/en-us/library/bb144981.aspx) /// </summary> /// <param name="ppEnum"> Returns an IEnumDebugThreads2 object that contains a list of all threads in all programs in the /// process. </param> /// <returns> VSConstants.S_OK. </returns> public int EnumThreads(out IEnumDebugThreads2 ppEnum) { ppEnum = null; return(VSConstants.S_OK); }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { DebugHelper.TraceEnteringMethod(); ppEnum = null; return VSConstants.E_NOTIMPL; }
// 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; }
/// <summary> /// Enumerate all threads. /// </summary> public int EnumThreads(out IEnumDebugThreads2 ppEnum) { DLog.Debug(DContext.VSDebuggerComCall, "IDebugProgram2.EnumThreads"); ppEnum = new ThreadEnum(ThreadManager.Threads.Cast<IDebugThread2>().ToArray()); return VSConstants.S_OK; }
int IEnumDebugThreads2.Clone(out IEnumDebugThreads2 ppEnum) { Debug.WriteLine("AD7ProgramNode: Entering Clone"); throw new NotImplementedException(); }
public int Detach() { _enumDebugPrograms = null; _enumDebugThreads = null; _port = null; _callback = null; _engine = null; m_program = null; return VSConstants.S_OK; }
/// <summary> /// Retrieves a list of the threads that are running in the program. (http://msdn.microsoft.com/en-us/library/bb145110.aspx) /// </summary> /// <param name="ppEnum"> Returns an IEnumDebugThreads2 object that contains a list of the threads. </param> /// <returns> If successful, returns S_OK; otherwise, returns an error code. </returns> public int EnumThreads(out IEnumDebugThreads2 ppEnum) { AD7Thread[] listThreads = null; int currentThread = 0; if (m_state != DE_STATE.RUN_MODE) currentThread = GetListOfThreads(out listThreads); // the following code seems to be weird but I had to update each field of this.m_process._threads because, when using // "this.m_process._threads = listThreads;" without having a new thread, VS starts to duplicate the existing threads // and, as a consequence, the call stack entries too. if ((currentThread == -1) || (listThreads == null)) { ppEnum = null; if (currentThread == 0) return VSConstants.S_OK; else return VSConstants.S_FALSE; } if (listThreads.Length != this.m_threads.Length) { foreach (AD7Thread t in this.m_threads) { AD7ThreadDestroyEvent.Send(this, 0, t); } this.m_threads = null; this.m_threads = new AD7Thread[listThreads.Length]; this.m_threads = listThreads; this._currentThreadIndex = currentThread; foreach (AD7Thread t in this.m_threads) { m_engineCallback.OnThreadStart(t); } ppEnum = new AD7ThreadEnum(this.m_threads); } else { if (this._currentThreadIndex != currentThread) { this._currentThreadIndex = currentThread; } for (int i = 0; i < listThreads.Length; i++) { if (this.m_threads[i]._engine != listThreads[i]._engine) { this.m_threads[i]._engine = listThreads[i]._engine; } if (this.m_threads[i]._threadDisplayName != listThreads[i]._threadDisplayName) { this.m_threads[i]._threadDisplayName = listThreads[i]._threadDisplayName; } if (this.m_threads[i]._id != listThreads[i]._id) { this.m_threads[i]._id = listThreads[i]._id; } if (this.m_threads[i]._state != listThreads[i]._state) { this.m_threads[i]._state = listThreads[i]._state; } if (this.m_threads[i]._targetID != listThreads[i]._targetID) { this.m_threads[i]._targetID = listThreads[i]._targetID; } if (this.m_threads[i]._priority != listThreads[i]._priority) { this.m_threads[i]._priority = listThreads[i]._priority; } if (this.m_threads[i]._line != listThreads[i]._line) { this.m_threads[i]._line = listThreads[i]._line; } if (this.m_threads[i]._filename != listThreads[i]._filename) { if (listThreads[i]._filename == "") this.m_threads[i]._filename = ""; else this.m_threads[i]._filename = listThreads[i]._filename; } this.m_threads[i].__stackFrames = listThreads[i].__stackFrames; this.m_threads[i]._suspendCount = listThreads[i]._suspendCount; } ppEnum = new AD7ThreadEnum(this.m_threads); } return VSConstants.S_OK; }
/// <summary> /// Enumerate all threads /// </summary> public int EnumThreads(out IEnumDebugThreads2 ppEnum) { DLog.Debug(DContext.VSDebuggerComCall, "IDebugProcess2.EnumThreads"); return ((IDebugProgram2)program).EnumThreads(out ppEnum); }
int IDebugProgram3.EnumThreads(out IEnumDebugThreads2 ppEnum) { return IDebugProgram2.EnumThreads(out ppEnum); }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { ppEnum = new AD7ThreadEnum(new IDebugThread2[] { this }); return(VSConstants.S_OK); }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { Log.Debug("Process: EnumThreads"); ppEnum = null; return VSConstants.S_OK; }
int Microsoft.VisualStudio.Debugger.Interop.IDebugProgram2.EnumThreads(out IEnumDebugThreads2 ppEnum) { // CorDebugProcess.Microsoft.VisualStudio.Debugger.Interop.IDebugProgram2.EnumThreads is not implemented //If we need to implement this, must return a copy without any VirtualThreads ppEnum = null; return Utility.COM_HResults.S_OK; }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { ppEnum = null; return(VSConstants.E_NOTIMPL); }
int IDebugProgram2.EnumThreads(out IEnumDebugThreads2 ppEnum) { ThrowIfDisposed(); ppEnum = new AD7ThreadEnum(new[] { MainThread }); return VSConstants.S_OK; }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { Debug.WriteLine("AD7Process: EnumThreads"); ppEnum = null; return VSConstants.E_NOTIMPL; }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { Log.Debug("ScriptProgramNode: Entering EnumThreads"); ppEnum = this; 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 Microsoft.MIDebugEngine.AD7ThreadEnum(threadObjects); return Constants.S_OK; }
/// <summary> /// Retrieves a list of all the threads running in the process. /// </summary> /// <param name="ppEnum">Returns an IEnumDebugThreads2 object that contains a list of all threads in all programs in the process.</param> /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns> /// <remarks> /// This method enumerates the threads running in each program and then combines them into a process view of the threads. A single thread may run in multiple programs; this method enumerates that thread only once. /// /// This method presents a list of the process's threads without duplicates. Otherwise, to enumerate the threads running in a particular program, use the IDebugProgram2::EnumThreads method. /// </remarks> public virtual int EnumThreads( out IEnumDebugThreads2 ppEnum ) { Logger.Debug( string.Empty ); ppEnum = null; return VSConstants.E_NOTIMPL; }
int IDebugProgram2.EnumThreads(out IEnumDebugThreads2 ppEnum) { throw new NotImplementedException(); }
// EnumThreads is called by the debugger when it needs to enumerate the threads in the program. public int EnumThreads(out IEnumDebugThreads2 ppEnum) { var threadObjects = new AD7Thread[1]; AD7Thread adThread = _threads.Item2; Debug.Assert(adThread != null); threadObjects[0] = adThread; ppEnum = new AD7ThreadEnum(threadObjects); return VSConstants.S_OK; }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { Debug.WriteLine("AD7Process: EnumThreads"); ppEnum = null; return(VSConstants.E_NOTIMPL); }
// EnumThreads is called by the debugger when it needs to enumerate the threads in the program. public int EnumThreads(out IEnumDebugThreads2 ppEnum) { //Debug.Assert(Worker.MainThreadId == Worker.CurrentThreadId); ppEnum = new AD7ThreadEnum(m_debuggedProcess.GetThreads().Select(t => { Debug.Assert(t.Client != null); return t.Client; })); return Constants.S_OK; }
/// <summary> /// Enumerate all threads. /// </summary> public int EnumThreads(out IEnumDebugThreads2 ppEnum) { DLog.Debug(DContext.VSDebuggerComCall, "IDebugProgram2.EnumThreads"); ppEnum = new ThreadEnum(ThreadManager.Threads.Cast <IDebugThread2>().ToArray()); return(VSConstants.S_OK); }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { Log.Debug("ScriptProgramNode: Entering EnumThreads"); ppEnum = this; return VSConstants.S_OK; }
public int /*IDebugProgram3*/ EnumThreads(out IEnumDebugThreads2 ppEnum) { ppEnum = ThreadEnum.Create(this); return(VSConstants.S_OK); }
/// <summary> /// Retrieves a list of the threads that are running in the program. (http://msdn.microsoft.com/en-us/library/bb145110.aspx) /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top. /// </summary> /// <param name="ppEnum"> Returns an IEnumDebugThreads2 object that contains a list of the threads. </param> /// <returns> If successful, returns S_OK; otherwise, returns an error code. </returns> public int EnumThreads(out IEnumDebugThreads2 ppEnum) { ppEnum = null; return VSConstants.S_OK; }
int IDebugProgram2.EnumThreads(out IEnumDebugThreads2 ppEnum) { Debug.WriteLine("AD7ProgramNode: Entering EnumThreads"); ppEnum = this; return VSConstants.S_OK; }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { var xEnum = new AD7ThreadEnum(new IDebugThread2[] { mThread }); ppEnum = xEnum; return VSConstants.S_OK; }
public int EnumThreads(out IEnumDebugThreads2 ppEnum) { lock (_threads) { ppEnum = new EnumDebugThreads(_threads.Values); } return VSConstants.S_OK; }
int IDebugProgram2.EnumThreads(out IEnumDebugThreads2 ppEnum) { ThrowIfDisposed(); ppEnum = new AD7ThreadEnum(new[] { MainThread }); return(VSConstants.S_OK); }
int IDebugProgram3.EnumThreads(out IEnumDebugThreads2 ppEnum) { return(IDebugProgram2.EnumThreads(out ppEnum)); }
// EnumThreads is called by the debugger when it needs to enumerate the threads in the program. public int EnumThreads(out IEnumDebugThreads2 ppEnum) { Debug.Assert(Worker.MainThreadId == Worker.CurrentThreadId); DebuggedThread[] threads = m_debuggedProcess.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 Microsoft.VisualStudio.Debugger.SampleEngine.AD7ThreadEnum(threadObjects); return Constants.S_OK; }