Inheritance: Mono.Debugger.SymbolFile
Ejemplo n.º 1
0
        protected MonoFundamentalType(MonoSymbolFile file, Cecil.TypeDefinition typedef,
					       string name, FundamentalKind kind, int size)
            : base(file.Language, name, kind, size)
        {
            this.file = file;
            this.typedef = typedef;
        }
Ejemplo n.º 2
0
        private MonoStringType(MonoSymbolFile file, Cecil.TypeDefinition typedef,
					int object_size, int size)
            : base(file, typedef, "string", FundamentalKind.String, size)
        {
            this.ObjectSize = object_size;
            this.CreateString = file.MonoLanguage.MonoDebuggerInfo.CreateString;
        }
Ejemplo n.º 3
0
        public static MonoVoidType Create(MonoSymbolFile corlib, TargetMemoryAccess memory)
        {
            MonoVoidType type = new MonoVoidType (
                corlib, corlib.ModuleDefinition.Types ["System.Void"]);

            TargetAddress klass = corlib.MonoLanguage.MetadataHelper.GetVoidClass (memory);
            type.create_type (memory, klass);

            return type;
        }
Ejemplo n.º 4
0
        protected MonoClassInfo(MonoSymbolFile file, Cecil.TypeDefinition typedef,
					 TargetMemoryAccess target, TargetAddress klass)
        {
            this.SymbolFile = file;
            this.KlassAddress = klass;
            this.CecilType = typedef;

            parent_klass = MetadataHelper.MonoClassGetParent (target, klass);
            GenericClass = MetadataHelper.MonoClassGetGenericClass (target, klass);
            GenericContainer = MetadataHelper.MonoClassGetGenericContainer (target, klass);
        }
Ejemplo n.º 5
0
        public static MonoStringType Create(MonoSymbolFile corlib, TargetMemoryAccess memory)
        {
            int object_size = 2 * memory.TargetMemoryInfo.TargetAddressSize;

            MonoStringType type = new MonoStringType (
                corlib, corlib.ModuleDefinition.GetType ("System.String"),
                object_size, object_size + 4);

            TargetAddress klass = corlib.MonoLanguage.MetadataHelper.GetStringClass (memory);
            type.create_type (memory, klass);

            return type;
        }
Ejemplo n.º 6
0
        public static MonoFundamentalType Create(MonoSymbolFile corlib,
							  TargetMemoryAccess memory,
							  FundamentalKind kind)
        {
            MonoFundamentalType fundamental;
            TargetAddress klass;

            switch (kind) {
            case FundamentalKind.Boolean:
                klass = corlib.MonoLanguage.MetadataHelper.GetBooleanClass (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.Boolean"),
                    "bool", kind, 1);
                break;

            case FundamentalKind.Char:
                klass = corlib.MonoLanguage.MetadataHelper.GetCharClass (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.Char"),
                    "char", kind, 2);
                break;

            case FundamentalKind.SByte:
                klass = corlib.MonoLanguage.MetadataHelper.GetSByteClass (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.SByte"),
                    "sbyte", kind, 1);
                break;

            case FundamentalKind.Byte:
                klass = corlib.MonoLanguage.MetadataHelper.GetByteClass (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.Byte"),
                    "byte", kind, 1);
                break;

            case FundamentalKind.Int16:
                klass = corlib.MonoLanguage.MetadataHelper.GetInt16Class (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.Int16"),
                    "short", kind, 2);
                break;

            case FundamentalKind.UInt16:
                klass = corlib.MonoLanguage.MetadataHelper.GetUInt16Class (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.UInt16"),
                    "ushort", kind, 2);
                break;

            case FundamentalKind.Int32:
                klass = corlib.MonoLanguage.MetadataHelper.GetInt32Class (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.Int32"),
                    "int", kind, 4);
                break;

            case FundamentalKind.UInt32:
                klass = corlib.MonoLanguage.MetadataHelper.GetUInt32Class (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.UInt32"),
                    "uint", kind, 4);
                break;

            case FundamentalKind.Int64:
                klass = corlib.MonoLanguage.MetadataHelper.GetInt64Class (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.Int64"),
                    "long", kind, 8);
                break;

            case FundamentalKind.UInt64:
                klass = corlib.MonoLanguage.MetadataHelper.GetUInt64Class (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.UInt64"),
                    "ulong", kind, 8);
                break;

            case FundamentalKind.Single:
                klass = corlib.MonoLanguage.MetadataHelper.GetSingleClass (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.Single"),
                    "float", kind, 4);
                break;

            case FundamentalKind.Double:
                klass = corlib.MonoLanguage.MetadataHelper.GetDoubleClass (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.Double"),
                    "double", kind, 8);
                break;

            case FundamentalKind.IntPtr:
                klass = corlib.MonoLanguage.MetadataHelper.GetIntPtrClass (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.IntPtr"),
                    "System.IntPtr", kind, memory.TargetMemoryInfo.TargetAddressSize);
                break;

            case FundamentalKind.UIntPtr:
                klass = corlib.MonoLanguage.MetadataHelper.GetUIntPtrClass (memory);
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.UIntPtr"),
                    "System.UIntPtr", kind, memory.TargetMemoryInfo.TargetAddressSize);
                break;

            case FundamentalKind.Decimal:
                fundamental = new MonoFundamentalType (
                    corlib, corlib.ModuleDefinition.GetType ("System.Decimal"),
                    "decimal", kind, Marshal.SizeOf (typeof (Decimal)));
                return fundamental;

            default:
                throw new InternalError ();
            }

            fundamental.create_type (memory, klass);
            return fundamental;
        }
Ejemplo n.º 7
0
 protected MonoObjectType(MonoSymbolFile file, Cecil.TypeDefinition typedef, int size)
     : base(file.MonoLanguage, "object", size)
 {
     this.file = file;
     this.typedef = typedef;
 }
Ejemplo n.º 8
0
 protected MonoVoidType(MonoSymbolFile file, Cecil.TypeDefinition typedef)
     : base(file.MonoLanguage, TargetObjectKind.Unknown)
 {
     this.file = file;
     this.typedef = typedef;
 }
Ejemplo n.º 9
0
        public static MonoClassInfo ReadCoreType(MonoSymbolFile file,
							  Cecil.TypeDefinition typedef,
							  TargetMemoryAccess target,
							  TargetAddress klass,
							  out MonoClassType type)
        {
            MonoClassInfo info = new MonoClassInfo (file, typedef, target, klass);
            type = new MonoClassType (file, typedef, info);
            ((IMonoStructType) type).ClassInfo = info;
            info.struct_type = type;
            info.type = type;
            return info;
        }