コード例 #1
0
        public override void InitializeContext(DbgEvaluationContext context, DbgCodeLocation location, CancellationToken cancellationToken)
        {
            Debug.Assert(context.Runtime.GetDotNetRuntime() != null);

            IDebuggerDisplayAttributeEvaluatorUtils.Initialize(context, debuggerDisplayAttributeEvaluator);
            // Needed by DebuggerRuntimeImpl (calls expressionCompiler.TryGetAliasInfo())
            context.GetOrCreateData(() => expressionCompiler);

            var loc = location as IDbgDotNetCodeLocation;

            if (loc == null)
            {
                // Could be a special frame, eg. managed to native frame
                return;
            }

            var state = StateWithKey <RuntimeState> .GetOrCreate(context.Runtime, decompiler);

            var debugInfo = GetOrCreateDebugInfo(state, loc, cancellationToken);

            if (debugInfo == null)
            {
                return;
            }
            DbgLanguageDebugInfoExtensions.SetLanguageDebugInfo(context, debugInfo);
        }
コード例 #2
0
        public override void InitializeContext(DbgEvaluationContext context, DbgCodeLocation location, CancellationToken cancellationToken)
        {
            Debug.Assert(context.Runtime.GetDotNetRuntime() != null);

            IDebuggerDisplayAttributeEvaluatorUtils.Initialize(context, debuggerDisplayAttributeEvaluator);
            // Needed by DebuggerRuntimeImpl (calls expressionCompiler.TryGetAliasInfo())
            context.GetOrCreateData(() => expressionCompiler);

            if ((context.Options & DbgEvaluationContextOptions.NoMethodBody) == 0 && location is IDbgDotNetCodeLocation loc)
            {
                var state = StateWithKey <RuntimeState> .GetOrCreate(context.Runtime, decompiler);

                var debugInfo = GetOrCreateDebugInfo(context, state, loc, cancellationToken);
                if (debugInfo != null)
                {
                    DbgLanguageDebugInfoExtensions.SetLanguageDebugInfo(context, debugInfo);
                }
            }
        }
コード例 #3
0
ファイル: DbgLanguageDebugInfo.cs プロジェクト: xi4oyu/dnSpy
 /// <summary>
 /// Attaches <paramref name="debugInfo"/> to <paramref name="context"/>
 /// </summary>
 /// <param name="context">Context</param>
 /// <param name="debugInfo">Debug info</param>
 public static void SetLanguageDebugInfo(DbgEvaluationContext context, DbgLanguageDebugInfo debugInfo) =>
 context.GetOrCreateData(() => debugInfo);
コード例 #4
0
 public static void Initialize(DbgEvaluationContext context, IDebuggerDisplayAttributeEvaluator evaluator) =>
 context.GetOrCreateData(() => evaluator);