internal ICorDebugFrame GetFrameAt(FrameID frameID) { process.AssertPaused(); ICorDebugChainEnum corChainEnum = CorThread.EnumerateChains(); if (frameID.ChainIndex >= corChainEnum.Count) { throw new ArgumentException("Chain index too big", "chainIndex"); } corChainEnum.Skip(corChainEnum.Count - frameID.ChainIndex - 1); ICorDebugChain corChain = corChainEnum.Next(); if (corChain.IsManaged == 0) { throw new ArgumentException("Chain is not managed", "chainIndex"); } ICorDebugFrameEnum corFrameEnum = corChain.EnumerateFrames(); if (frameID.FrameIndex >= corFrameEnum.Count) { throw new ArgumentException("Frame index too big", "frameIndex"); } corFrameEnum.Skip(corFrameEnum.Count - frameID.FrameIndex - 1); return(corFrameEnum.Next()); }
public static ICorDebugChain Next(this ICorDebugChainEnum corChainEnum) { ICorDebugChain[] corChains = new ICorDebugChain[] { null }; uint chainsFetched = corChainEnum.Next(1, corChains); return(corChains[0]); }
int ICorDebugThread.GetActiveChain(out ICorDebugChain ppChain) { Debug.Assert(!IsVirtualThread); ppChain = this.GetLastCorDebugThread().Chain; return(Utility.COM_HResults.S_OK); }
/// <summary> /// Get callback, run on worker thread. /// </summary> /// <returns>An array of the callstack</returns> public List <CorFrame> GetFrameList() { ICorDebugChain ch = null; cothread.GetActiveChain(out ch); CorChain chain = new CorChain(ch, options); List <CorFrame> frameList = new List <CorFrame>(); CorFrame corFrame = chain.ActiveFrame; for (int i = 0; i < 20; i++) { frameList.Add(corFrame); ICorDebugFrame caller; corFrame.GetFrame().GetCaller(out caller); if (null == caller) { break; } corFrame = new CorFrame(caller, options); } return(frameList); }
int ICorDebugChain.GetPrevious(out ICorDebugChain ppChain) { CorDebugThread thread = m_thread.NextThread; ppChain = (thread != null) ? thread.Chain : null; return(COM_HResults.S_OK); }
int ICorDebugChain.GetNext(out ICorDebugChain ppChain) { //Chains are attached from top of the stack to the bottom. //This corresponds to the last virtual thread stack to the first CorDebugThread thread = m_thread.PreviousThread; ppChain = (thread != null) ? thread.Chain : null; return(COM_HResults.S_OK); }
// // IEnumerator interface // public bool MoveNext() { ICorDebugChain[] a = new ICorDebugChain[1]; uint c = 0; int r = m_enum.Next ((uint)a.Length, a, out c); if (r==0 && c==1) // S_OK && we got 1 new element m_chain = new CorChain (a[0]); else m_chain = null; return m_chain != null; }
public static IEnumerable<ICorDebugChain> GetEnumerator(this ICorDebugChainEnum corEnum) { corEnum.Reset(); while (true) { ICorDebugChain[] corChains = new ICorDebugChain[EnumerateBufferSize]; uint fetched = corEnum.Next(EnumerateBufferSize, corChains); if (fetched == 0) yield break; for(int i = 0; i < fetched; i++) yield return corChains[i]; } }
// // IEnumerator interface // #region IEnumerator Members public bool MoveNext() { var a = new ICorDebugChain[1]; uint c = 0; int r = m_enum.Next((uint)a.Length, a, out c); if (r == 0 && c == 1) // S_OK && we got 1 new element { m_chain = new CorChain(a[0]); } else { m_chain = null; } return(m_chain != null); }
public static IEnumerable <ICorDebugChain> GetEnumerator(this ICorDebugChainEnum corEnum) { corEnum.Reset(); while (true) { ICorDebugChain[] corChains = new ICorDebugChain[EnumerateBufferSize]; uint fetched = corEnum.Next(EnumerateBufferSize, corChains); if (fetched == 0) { yield break; } for (int i = 0; i < fetched; i++) { yield return(corChains[i]); } } }
// // IEnumerator interface // public bool MoveNext() { #if I_DONT_WANT_TO ICorDebugChain[] a = new ICorDebugChain[1]; uint c = 0; int r = m_enum.Next(a.Length, a, ref c); if (r == 0 && c == 1) // S_OK && we got 1 new element { m_chain = new Chain(a[0]); } else { m_chain = null; } return(m_chain != null); #else return(false); #endif }
internal StackFrame GetStackFrameAt(uint chainIndex, uint frameIndex) { process.AssertPaused(); ICorDebugChainEnum corChainEnum = CorThread.EnumerateChains(); if (chainIndex >= corChainEnum.GetCount()) { throw new DebuggerException("The requested chain index is too big"); } corChainEnum.Skip(corChainEnum.GetCount() - chainIndex - 1); ICorDebugChain corChain = corChainEnum.Next(); if (corChain.IsManaged() == 0) { throw new DebuggerException("The requested chain is not managed"); } ICorDebugFrameEnum corFrameEnum = corChain.EnumerateFrames(); if (frameIndex >= corFrameEnum.GetCount()) { throw new DebuggerException("The requested frame index is too big"); } corFrameEnum.Skip(corFrameEnum.GetCount() - frameIndex - 1); ICorDebugFrame corFrame = corFrameEnum.Next(); if (!(corFrame is ICorDebugILFrame)) { throw new DebuggerException("The rquested frame is not IL frame"); } StackFrame stackFrame = new StackFrame(this, (ICorDebugILFrame)corFrame, chainIndex, frameIndex); return(stackFrame); }
internal RuntimeChain(RuntimeThread thread, ICorDebugChain comChain) { _comChain = comChain; Thread = thread; }
int ICorDebugChain.GetCaller(out ICorDebugChain ppChain) { ppChain = null; return(COM_HResults.S_OK); }
public static ICorDebugChain Next(this ICorDebugChainEnum corChainEnum) { ICorDebugChain[] corChains = new ICorDebugChain[] { null }; uint chainsFetched = corChainEnum.Next(1, corChains); return corChains[0]; }
internal RuntimeChain (RuntimeThread thread, ICorDebugChain comChain) { _comChain = comChain; Thread = thread; }
int ICorDebugInternalFrame.GetChain(out ICorDebugChain ppChain) { return(ICorDebugFrame.GetChain(out ppChain)); }
//ICorDebugNative is needed for CPDE to back the IP up to the beginning //of a sequence point when the user intercepts an exception. #region ICorDebugNativeFrame Members int ICorDebugNativeFrame.GetChain(out ICorDebugChain ppChain) { return(((ICorDebugFrame)this).GetChain(out ppChain)); }
public static uint Next(this ICorDebugChainEnum instance, uint celt, ICorDebugChain[] chains) { uint pceltFetched; instance.__Next(celt, chains, out pceltFetched); return pceltFetched; }
int ICorDebugChain. GetCaller( out ICorDebugChain ppChain ) { ppChain = null; return Utility.COM_HResults.S_OK; }
int ICorDebugInternalFrame.GetChain( out ICorDebugChain ppChain ) { return this.ICorDebugFrame.GetChain( out ppChain ); }
//ICorDebugNative is needed for CPDE to back the IP up to the beginning //of a sequence point when the user intercepts an exception. #region ICorDebugNativeFrame Members int ICorDebugNativeFrame.GetChain(out ICorDebugChain ppChain) { return ((ICorDebugFrame)this).GetChain(out ppChain); }
int ICorDebugFrame.GetChain (out ICorDebugChain ppChain) { ppChain = (ICorDebugChain)m_chain; return Utility.COM_HResults.S_OK; }
int ICorDebugChain. GetNext( out ICorDebugChain ppChain ) { //Chains are attached from top of the stack to the bottom. //This corresponds to the last virtual thread stack to the first CorDebugThread thread = m_thread.PreviousThread; ppChain = (thread != null) ? thread.Chain : null; return Utility.COM_HResults.S_OK; }
int ICorDebugThread.GetActiveChain(out ICorDebugChain ppChain) { Debug.Assert(!IsVirtualThread); ppChain = this.GetLastCorDebugThread().Chain; return Utility.COM_HResults.S_OK; }
internal CorChain(ICorDebugChain chain) : base(chain) { m_chain = chain; }
int ICorDebugChain. GetPrevious( out ICorDebugChain ppChain ) { CorDebugThread thread = m_thread.NextThread; ppChain = (thread != null) ? thread.Chain : null; return Utility.COM_HResults.S_OK; }
int ICorDebugChain.GetCallee(out ICorDebugChain ppChain) { ppChain = null; return(Utility.COM_HResults.S_OK); }
int ICorDebugFrame.GetChain(out ICorDebugChain ppChain) { ppChain = (ICorDebugChain)_chain; return(COM_HResults.S_OK); }
internal CorChain(ICorDebugChain chain) : base(chain) { m_chain = chain; }
internal CorChain(ICorDebugChain chain, CorDebuggerOptions options) : base(chain, options) { m_chain = chain; }