Пример #1
0
        static TypeOutput CreateType(TypeOutput output, CorValue value, TypePrinterFlags flags)
        {
            if (value == null)
            {
                output.Write("???", TypeColor.Error);
            }
            else
            {
                if (value.IsReference && value.Type == dndbg.Engine.COM.CorDebug.CorElementType.ByRef)
                {
                    value = value.NeuterCheckDereferencedValue ?? value;
                }

                var type = value.ExactType;
                if (type != null)
                {
                    type.Write(output, flags);
                }
                else
                {
                    var cls = value.Class;
                    if (cls != null)
                    {
                        cls.Write(output, flags);
                    }
                    else
                    {
                        output.Write("???", TypeColor.Error);
                    }
                }
            }
            return(output);
        }
Пример #2
0
        public static CachedOutput Create(CorFrame frame, TypePrinterFlags flags)
        {
            var output = new TypeOutput();

            frame.Write(output, flags);
            return(output.cachedOutput);
        }
Пример #3
0
        public static CachedOutput Create(CorType type, TypePrinterFlags flags)
        {
            var output = new TypeOutput();

            if (type == null)
            {
                output.Write("???", TypeColor.Error);
            }
            else
            {
                type.Write(output, flags);
            }
            return(output.cachedOutput);
        }
Пример #4
0
        public static CachedOutput CreateValue(CorValue value, TypePrinterFlags flags, Func <DnEval> getEval = null)
        {
            var output = new TypeOutput();

            if (value == null)
            {
                output.Write("???", TypeColor.Error);
            }
            else
            {
                value.Write(output, flags, getEval);
            }
            return(output.cachedOutput);
        }
Пример #5
0
        static CachedOutput CreateTypeInternal(TypeOutput valueOutput, TypeOutput typeOutput)
        {
            // This code doesn't compare the types to see if they're identical, it just compares
            // the output. This should be good enough.

            if (typeOutput.cachedOutput.Equals(valueOutput.cachedOutput))
            {
                return(valueOutput.cachedOutput);
            }

            typeOutput.Write(" ", TypeColor.Space);
            typeOutput.Write("{", TypeColor.Error);
            typeOutput.cachedOutput.data.AddRange(valueOutput.cachedOutput.data);
            typeOutput.Write("}", TypeColor.Error);
            return(typeOutput.cachedOutput);
        }