Exemplo n.º 1
0
        public static CachedOutput Create(CorFrame frame, TypePrinterFlags flags)
        {
            var output = new TypeOutput();

            frame.Write(output, flags);
            return(output.cachedOutput);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
 TypePrinterFlags GetTypePrinterFlags(ILocalsSettings localsSettings, TypePrinterFlags flags)
 {
     Update(localsSettings.ShowNamespaces, TypePrinterFlags.ShowNamespaces, ref flags);
     Update(localsSettings.ShowTokens, TypePrinterFlags.ShowTokens, ref flags);
     Update(localsSettings.ShowTypeKeywords, TypePrinterFlags.ShowTypeKeywords, ref flags);
     return(flags);
 }
Exemplo n.º 4
0
        public override string ToString()
        {
            const TypePrinterFlags flags = TypePrinterFlags.ShowParameterTypes |
                                           TypePrinterFlags.ShowReturnTypes | TypePrinterFlags.ShowNamespaces |
                                           TypePrinterFlags.ShowTypeKeywords;

            return(debugger.Dispatcher.UI(() => evt.ToString(flags)));
        }
Exemplo n.º 5
0
        public static CachedOutput Create(TypeSig fieldType, TypePrinterFlags flags)
        {
            fieldType = fieldType.RemovePinnedAndModifiers() ?? fieldType;
            if (fieldType is ByRefSig)
            {
                fieldType = fieldType.Next ?? fieldType;
            }
            var typeOutput = TypePrinterUtils.Write(new TypeOutput(), fieldType, flags);

            return(typeOutput.cachedOutput);
        }
Exemplo n.º 6
0
 static void Update(bool b, TypePrinterFlags f, ref TypePrinterFlags flags)
 {
     if (b)
     {
         flags |= f;
     }
     else
     {
         flags &= ~f;
     }
 }
Exemplo n.º 7
0
        public static CachedOutput CreateType(CorValue value, CorClass cls, TypePrinterFlags flags)
        {
            var valueOutput = CreateType(new TypeOutput(), value, flags);

            if (cls == null || value == null)
            {
                return(valueOutput.cachedOutput);
            }

            var typeOutput = value.WriteType(new TypeOutput(), cls, flags);

            return(CreateTypeInternal(valueOutput, typeOutput));
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
0
 public T WriteType <T>(T output, TypeSig ts, IList <CorType> typeArgs, IList <CorType> methodArgs, TypePrinterFlags flags, Func <DnEval> getEval = null) where T : ITypeOutput
 {
     new TypePrinter(output, flags, getEval).Write(ts, typeArgs, methodArgs);
     return(output);
 }
Exemplo n.º 11
0
 public T WriteType <T>(T output, CorClass cls, TypePrinterFlags flags, Func <DnEval> getEval = null) where T : ITypeOutput
 {
     new TypePrinter(output, flags, getEval).Write(cls);
     return(output);
 }
Exemplo n.º 12
0
 public static CachedOutput CreateConstant(TypeSig type, object c, TypePrinterFlags flags)
 {
     return(TypePrinterUtils.WriteConstant(new TypeOutput(), type, c, flags).cachedOutput);
 }
Exemplo n.º 13
0
 public string ToString(CorValue value, TypePrinterFlags flags)
 {
     return(Write(new StringBuilderTypeOutput(), value, flags).ToString());
 }
Exemplo n.º 14
0
 public static T Write <T>(this T output, TypeSig type, TypePrinterFlags flags, IList <CorType> typeGenArgs = null, IList <CorType> methGenArgs = null) where T : ITypeOutput
 {
     new TypePrinter(output, flags).Write(type, typeGenArgs, methGenArgs);
     return(output);
 }
Exemplo n.º 15
0
 TypePrinterFlags GetTypePrinterFlags(IDebuggerSettings debuggerSettings, TypePrinterFlags flags)
 {
     Update(!debuggerSettings.UseHexadecimal, TypePrinterFlags.UseDecimal, ref flags);
     return(flags);
 }
Exemplo n.º 16
0
 public static string ConstantToString(object c, TypePrinterFlags flags)
 {
     return(WriteConstant(new StringBuilderTypeOutput(), c, flags).ToString());
 }
Exemplo n.º 17
0
 public string ToString(TypePrinterFlags flags) => Write(new StringBuilderTypeOutput(), flags).ToString();
Exemplo n.º 18
0
 public string ToString(TypePrinterFlags flags, Func <DnEval> getEval = null)
 {
     return(Write(new StringBuilderTypeOutput(), flags, getEval).ToString());
 }
Exemplo n.º 19
0
 public static string ConstantToString(TypeSig type, object c, TypePrinterFlags flags) => WriteConstant(new StringBuilderTypeOutput(), type, c, flags).ToString();
Exemplo n.º 20
0
 public static string ToString(CorElementType etype, TypePrinterFlags flags) => Write(new StringBuilderTypeOutput(), etype, flags).ToString();
Exemplo n.º 21
0
 public static T Write <T>(this T output, CorElementType etype, TypePrinterFlags flags) where T : ITypeOutput => Write(output, ToTypeSig(etype), flags);
Exemplo n.º 22
0
 public static string ToString(TypeSig type, TypePrinterFlags flags, IList <CorType> typeGenArgs = null, IList <CorType> methGenArgs = null) => Write(new StringBuilderTypeOutput(), type, flags, typeGenArgs, methGenArgs).ToString();
Exemplo n.º 23
0
 public T Write <T>(T output, TypePrinterFlags flags) where T : ITypeOutput
 {
     new TypePrinter(output, flags).Write(this);
     return(output);
 }
Exemplo n.º 24
0
 public static CachedOutput CreateType(CorValue value, TypePrinterFlags flags)
 {
     return(CreateType(new TypeOutput(), value, flags).cachedOutput);
 }
Exemplo n.º 25
0
 public string ToString(TypePrinterFlags flags)
 {
     return(Write(new StringBuilderTypeOutput(), flags).ToString());
 }
Exemplo n.º 26
0
        public static CachedOutput CreateType(CorValue value, TypeSig ts, IList <CorType> typeArgs, IList <CorType> methodArgs, TypePrinterFlags flags)
        {
            if (value == null && ts != null)
            {
                return(TypePrinterUtils.Write(new TypeOutput(), ts, flags, typeArgs, methodArgs).cachedOutput);
            }
            var valueOutput = CreateType(new TypeOutput(), value, flags);

            if (ts == null || value == null)
            {
                return(valueOutput.cachedOutput);
            }

            ts = ts.RemovePinnedAndModifiers() ?? ts;
            if (ts is ByRefSig)
            {
                ts = ts.Next ?? ts;
            }

            var typeOutput = value.WriteType(new TypeOutput(), ts, typeArgs, methodArgs, flags);

            return(CreateTypeInternal(valueOutput, typeOutput));
        }
Exemplo n.º 27
0
 public T Write <T>(T output, CorValue value, TypePrinterFlags flags, Func <DnEval> getEval = null) where T : ITypeOutput
 {
     new TypePrinter(output, flags, getEval).Write(value, this);
     return(output);
 }
Exemplo n.º 28
0
 public static T WriteConstant <T>(this T output, object c, TypePrinterFlags flags) where T : ITypeOutput
 {
     new TypePrinter(output, flags).WriteConstant(c);
     return(output);
 }
Exemplo n.º 29
0
 public T Write <T>(T output, TypeSig type, TypePrinterFlags flags) where T : ITypeOutput
 {
     new TypePrinter(output, flags).Write(type, TypeParameters.ToArray());
     return(output);
 }