IsInterpretedFrame() public static method

public static IsInterpretedFrame ( MethodBase method ) : bool
method System.Reflection.MethodBase
return bool
コード例 #1
0
ファイル: InterpretedFrame.cs プロジェクト: jmfrank63/dlr
        /// <summary>
        /// A single interpreted frame might be represented by multiple subsequent Interpreter.Run CLR frames.
        /// This method filters out the duplicate CLR frames.
        /// </summary>
        public static IEnumerable <StackFrame> GroupStackFrames(IEnumerable <StackFrame> stackTrace)
        {
            bool inInterpretedFrame = false;

            foreach (StackFrame frame in stackTrace)
            {
                MethodBase method = frame.GetMethod();

                // mono sets the method to null for dynamic methods
                // IsInterpretedFrame doesn't allow null methods
                if (method == null)
                {
                    continue;
                }

                if (InterpretedFrame.IsInterpretedFrame(method))
                {
                    if (inInterpretedFrame)
                    {
                        continue;
                    }
                    inInterpretedFrame = true;
                }
                else
                {
                    inInterpretedFrame = false;
                }
                yield return(frame);
            }
        }
コード例 #2
0
        /// <summary>
        /// A single interpreted frame might be represented by multiple subsequent Interpreter.Run CLR frames.
        /// This method filters out the duplicate CLR frames.
        /// </summary>
        public static IEnumerable <StackFrame> GroupStackFrames(IEnumerable <StackFrame> stackTrace)
        {
            bool inInterpretedFrame = false;

            foreach (StackFrame frame in stackTrace)
            {
                if (InterpretedFrame.IsInterpretedFrame(frame.GetMethod()))
                {
                    if (inInterpretedFrame)
                    {
                        continue;
                    }
                    inInterpretedFrame = true;
                }
                else
                {
                    inInterpretedFrame = false;
                }
                yield return(frame);
            }
        }