Пример #1
0
        public override void FormatFrame(DbgEvaluationInfo evalInfo, IDbgTextWriter output, DbgStackFrameFormatterOptions options, DbgValueFormatterOptions valueOptions, CultureInfo cultureInfo)
        {
            if (evalInfo == null)
            {
                throw new ArgumentNullException(nameof(evalInfo));
            }
            if (!(evalInfo.Context is DbgEvaluationContextImpl))
            {
                throw new ArgumentException();
            }
            if (evalInfo.Context.Language != Language)
            {
                throw new ArgumentException();
            }
            if (evalInfo.Context.Runtime.RuntimeKindGuid != runtimeKindGuid)
            {
                throw new ArgumentException();
            }
            if (output == null)
            {
                throw new ArgumentNullException(nameof(output));
            }
            var frameImpl = evalInfo.Frame as DbgStackFrameImpl;

            if (frameImpl == null)
            {
                throw new ArgumentException();
            }
            if (!frameImpl.TryFormat(evalInfo.Context, output, options, valueOptions, cultureInfo, evalInfo.CancellationToken))
            {
                engineFormatter.FormatFrame(evalInfo, output, options, valueOptions, cultureInfo);
            }
        }
Пример #2
0
        public override void FormatFrame(DbgEvaluationInfo evalInfo, IDbgTextWriter output, DbgStackFrameFormatterOptions options, DbgValueFormatterOptions valueOptions, CultureInfo?cultureInfo)
        {
            if (evalInfo is null)
            {
                throw new ArgumentNullException(nameof(evalInfo));
            }
            if (!(evalInfo.Context is DbgEvaluationContextImpl))
            {
                throw new ArgumentException();
            }
            if (evalInfo.Context.Language != Language)
            {
                throw new ArgumentException();
            }
            if (evalInfo.Context.Runtime.RuntimeKindGuid != runtimeKindGuid)
            {
                throw new ArgumentException();
            }
            if (output is null)
            {
                throw new ArgumentNullException(nameof(output));
            }
            var frameImpl = evalInfo.Frame as DbgStackFrameImpl;

            if (frameImpl is null)
            {
                throw new ArgumentException();
            }
            try {
                if (!frameImpl.TryFormat(evalInfo.Context, output, options, valueOptions, cultureInfo, evalInfo.CancellationToken))
                {
                    engineFormatter.FormatFrame(evalInfo, output, options, valueOptions, cultureInfo);
                }
            }
            catch (Exception ex) when(ExceptionUtils.IsInternalDebuggerError(ex))
            {
                WriteError(output);
            }
        }