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); }
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); } } }
/// <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);
public static void Initialize(DbgEvaluationContext context, IDebuggerDisplayAttributeEvaluator evaluator) => context.GetOrCreateData(() => evaluator);