FrameInfo GetFrameInfo (int frameIndex, EvaluationOptions options, bool ignoreEvalStatus)
		{
			FrameInfo finfo;

			if (frameInfo.TryGetValue (frameIndex, out finfo))
				return finfo;
			
			if (!ignoreEvalStatus && Adaptor.IsEvaluating)
				return null;
			
			var ctx = GetEvaluationContext (frameIndex, options);
			if (ctx == null)
				return null;
			
			finfo = new FrameInfo ();
			finfo.Context = ctx;
			finfo.LocalVariables.AddRange (ctx.Evaluator.GetLocalVariables (ctx));
			finfo.Parameters.AddRange (ctx.Evaluator.GetParameters (ctx));
			finfo.This = ctx.Evaluator.GetThisReference (ctx);

			var exp = ctx.Evaluator.GetCurrentException (ctx);
			if (exp != null)
				finfo.Exception = new ExceptionInfoSource (ctx, exp);

			frameInfo[frameIndex] = finfo;

			return finfo;
		}
Ejemplo n.º 2
0
        FrameInfo GetFrameInfo(int frameIndex, EvaluationOptions options, bool ignoreEvalStatus)
        {
            FrameInfo finfo;

            if (frameInfo.TryGetValue (frameIndex, out finfo))
                return finfo;

            if (!ignoreEvalStatus && Adaptor.IsEvaluating)
                return null;

            var ctx = GetEvaluationContext (frameIndex, options);
            if (ctx == null)
                return null;

            finfo = new FrameInfo ();
            finfo.Context = ctx;
            //Don't try to optimize lines below with lazy loading, you won't gain anything(in communication with runtime)
            finfo.LocalVariables.AddRange (ctx.Evaluator.GetLocalVariables (ctx));
            finfo.Parameters.AddRange (ctx.Evaluator.GetParameters (ctx));
            finfo.This = ctx.Evaluator.GetThisReference (ctx);

            var exp = ctx.Evaluator.GetCurrentException (ctx);
            if (exp != null)
                finfo.Exception = new ExceptionInfoSource (ctx, exp);

            frameInfo[frameIndex] = finfo;

            return finfo;
        }