Provides services to compilers for instrumenting code with tracebacks.
Beispiel #1
0
 private TracePipeline(DebugContext debugContext)
 {
     _debugContext = debugContext;
     _traceFrame = new ThreadLocal<DebugFrame>();
     debugContext.DebugCallback = this;
     debugContext.DebugMode = DebugMode.FullyEnabled;
 }
Beispiel #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");
        }
Beispiel #4
0
 internal DebugThread(DebugContext debugContext)
 {
     _debugContext = debugContext;
     _threadId = ThreadingUtils.GetCurrentThreadId();
 }
Beispiel #5
0
 internal DefaultDebugThread(DebugContext debugContext)
     : base(debugContext)
 {
     _frames = new List<FrameRuntimeVariablesPair>();
 }
Beispiel #6
0
 internal DebugThread(DebugContext debugContext) {
     _debugContext = debugContext;
     _managedThread = Thread.CurrentThread;
 }
Beispiel #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));
            }
        }