Provides services to compilers for instrumenting code with tracebacks.
示例#1
0
 private TracePipeline(DebugContext debugContext)
 {
     _debugContext = debugContext;
     _traceFrame = new ThreadLocal<DebugFrame>();
     debugContext.DebugCallback = this;
     debugContext.DebugMode = DebugMode.FullyEnabled;
 }
示例#2
0
        public static ITracePipeline CreateInstance(DebugContext debugContext) {
            ContractUtils.RequiresNotNull(debugContext, "debugContext");

            if (debugContext.DebugCallback != null)
                throw new InvalidOperationException(ErrorStrings.DebugContextAlreadyConnectedToTracePipeline);

            return new TracePipeline(debugContext);
        }
        internal DebuggableLambdaBuilder(DebugContext debugContext, DebugLambdaInfo lambdaInfo) {
            _debugContext = debugContext;
            _lambdaInfo = lambdaInfo;

            _alias = _lambdaInfo.LambdaAlias;
            _debugContextExpression = AstUtils.Constant(debugContext);

            // Variables
            _verifiedLocals = new List<MSAst.ParameterExpression>();
            _verifiedLocalNames = new Dictionary<string, object>();
            _pendingLocals = new List<MSAst.ParameterExpression>();
            _variableInfos = new List<VariableInfo>();
            _pendingToVariableInfosMap = new Dictionary<MSAst.ParameterExpression, VariableInfo>();
            _pendingToVerifiedLocalsMap = new Dictionary<MSAst.ParameterExpression, MSAst.ParameterExpression>();

            // DebugMode expression that's used by the transformed code to see what the current debug mode is
            _globalDebugMode = Ast.Property(_debugContextExpression, "Mode");
        }
示例#4
0
 internal DebugThread(DebugContext debugContext)
 {
     _debugContext = debugContext;
     _threadId = ThreadingUtils.GetCurrentThreadId();
 }
示例#5
0
 internal DefaultDebugThread(DebugContext debugContext)
     : base(debugContext)
 {
     _frames = new List<FrameRuntimeVariablesPair>();
 }
示例#6
0
 internal DebugThread(DebugContext debugContext) {
     _debugContext = debugContext;
     _managedThread = Thread.CurrentThread;
 }
示例#7
0
        internal void EnsureDebugContext()
        {
            if (_debugContext == null || _tracePipeline == null)
            {
                lock (this)
                {
                    if (_debugContext == null)
                    {
                        _debugContext = DebugContext.CreateInstance();
                        _tracePipeline = Microsoft.Scripting.Debugging.TracePipeline.CreateInstance(_debugContext);
                    }
                }
            }

            if (_tracebackListeners == null)
            {
                _tracebackListeners = new Stack<TotemTracebackListener>();
                // push the default listener
                _tracebackListeners.Push(new TotemTracebackListener(this));
            }
        }