internal MonoFunctionType(IMonoStructType klass, Cecil.MethodDefinition mdef) : base(klass.File.MonoLanguage) { this.klass = klass; this.method_info = mdef; this.token = MonoDebuggerSupport.GetMethodToken(mdef); this.name = GetMethodName(mdef) + MonoSymbolFile.GetMethodSignature(mdef); Cecil.TypeReference rtype; if (mdef.IsConstructor) { rtype = mdef.DeclaringType; has_return_type = true; } else { rtype = mdef.ReturnType; has_return_type = rtype.FullName != "System.Void"; } return_type = klass.File.MonoLanguage.LookupMonoType(rtype); parameter_types = new TargetType [mdef.Parameters.Count]; for (int i = 0; i < mdef.Parameters.Count; i++) { parameter_types [i] = klass.File.MonoLanguage.LookupMonoType( mdef.Parameters[i].ParameterType); } }
private MonoMethodInfo(IMonoStructType klass, int index, Cecil.MethodDefinition minfo, MonoFunctionType type) : base(type, MonoFunctionType.GetMethodName(minfo), index, minfo.IsStatic, GetAccessibility(minfo), type.FullName) { FunctionType = type; }
internal static MonoPropertyInfo Create(IMonoStructType klass, int index, Cecil.PropertyDefinition pinfo) { TargetType type = klass.File.MonoLanguage.LookupMonoType(pinfo.PropertyType); bool is_static = false; MonoFunctionType getter, setter; TargetMemberAccessibility accessibility = TargetMemberAccessibility.Private; if (pinfo.SetMethod != null) { setter = klass.LookupFunction(pinfo.SetMethod); is_static = pinfo.SetMethod.IsStatic; accessibility = MonoMethodInfo.GetAccessibility(pinfo.SetMethod); } else { setter = null; } if (pinfo.GetMethod != null) { getter = klass.LookupFunction(pinfo.GetMethod); is_static = pinfo.GetMethod.IsStatic; accessibility = MonoMethodInfo.GetAccessibility(pinfo.GetMethod); } else { getter = null; } return(new MonoPropertyInfo( type, klass, index, is_static, pinfo, accessibility, getter, setter)); }
internal static MonoEventInfo Create(IMonoStructType klass, int index, Cecil.EventDefinition einfo) { TargetType type = klass.File.MonoLanguage.LookupMonoType (einfo.EventType); bool is_static = false; MonoFunctionType add, remove, raise; TargetMemberAccessibility accessibility = TargetMemberAccessibility.Private; if (einfo.AddMethod != null) { add = klass.LookupFunction (einfo.AddMethod); is_static = einfo.AddMethod.IsStatic; accessibility = MonoMethodInfo.GetAccessibility (einfo.AddMethod); } else add = null; if (einfo.RemoveMethod != null) { remove = klass.LookupFunction (einfo.RemoveMethod); is_static = einfo.RemoveMethod.IsStatic; accessibility = MonoMethodInfo.GetAccessibility (einfo.RemoveMethod); } else remove = null; if (einfo.InvokeMethod != null) { raise = klass.LookupFunction (einfo.InvokeMethod); is_static = einfo.InvokeMethod.IsStatic; accessibility = MonoMethodInfo.GetAccessibility (einfo.InvokeMethod); } else raise = null; return new MonoEventInfo ( klass, index, einfo, type, is_static, accessibility, add, remove, raise); }
internal static MonoMethodInfo Create(IMonoStructType klass, int index, Cecil.MethodDefinition minfo) { MonoFunctionType type = klass.LookupFunction(minfo); return(new MonoMethodInfo(klass, index, minfo, type)); }
private MonoEventInfo(IMonoStructType klass, int index, Cecil.EventDefinition einfo, TargetType type, bool is_static, TargetMemberAccessibility accessibility, MonoFunctionType add, MonoFunctionType remove, MonoFunctionType raise) : base(type, einfo.Name, index, is_static, accessibility, add, remove, raise) { this.Klass = klass; this.AddType = add; this.RemoveType = remove; this.RaiseType = raise; }
public MonoFieldInfo(IMonoStructType type, TargetType field_type, int pos, Cecil.FieldDefinition finfo) : base(field_type, finfo.Name, pos, finfo.IsStatic, GetAccessibility(finfo), pos, 0, finfo.HasConstant) { FieldInfo = finfo; DebuggerTypeProxyAttribute type_proxy; MonoSymbolFile.CheckCustomAttributes(finfo, out browsable_state, out debugger_display, out type_proxy, out is_compiler_generated); }
public MonoClassInfo ResolveClass(TargetMemoryAccess target, bool fail) { if (resolved) { return(class_info); } if (class_info == null) { if (class_ptr.IsNull) { return(null); } TargetAddress klass = target.ReadAddress(class_ptr); if (klass.IsNull) { return(null); } class_info = File.MonoLanguage.ReadClassInfo(target, klass); } if (class_info == null) { if (!fail) { return(null); } throw new TargetException(TargetError.ClassNotInitialized, "Class `{0}' not initialized yet.", Name); } if (class_info.HasParent) { MonoClassInfo parent_info = class_info.GetParent(target); parent_type = (IMonoStructType)parent_info.Type; parent_type.ClassInfo = parent_info; if (parent_type.ResolveClass(target, fail) == null) { return(null); } } resolved = true; return(class_info); }
internal static MonoEventInfo Create(IMonoStructType klass, int index, Cecil.EventDefinition einfo) { TargetType type = klass.File.MonoLanguage.LookupMonoType(einfo.EventType); bool is_static = false; MonoFunctionType add, remove, raise; TargetMemberAccessibility accessibility = TargetMemberAccessibility.Private; if (einfo.AddMethod != null) { add = klass.LookupFunction(einfo.AddMethod); is_static = einfo.AddMethod.IsStatic; accessibility = MonoMethodInfo.GetAccessibility(einfo.AddMethod); } else { add = null; } if (einfo.RemoveMethod != null) { remove = klass.LookupFunction(einfo.RemoveMethod); is_static = einfo.RemoveMethod.IsStatic; accessibility = MonoMethodInfo.GetAccessibility(einfo.RemoveMethod); } else { remove = null; } if (einfo.InvokeMethod != null) { raise = klass.LookupFunction(einfo.InvokeMethod); is_static = einfo.InvokeMethod.IsStatic; accessibility = MonoMethodInfo.GetAccessibility(einfo.InvokeMethod); } else { raise = null; } return(new MonoEventInfo( klass, index, einfo, type, is_static, accessibility, add, remove, raise)); }
private MonoPropertyInfo(TargetType type, IMonoStructType klass, int index, bool is_static, Cecil.PropertyDefinition pinfo, TargetMemberAccessibility accessibility, MonoFunctionType getter, MonoFunctionType setter) : base(type, pinfo.Name, index, is_static, accessibility, getter, setter) { this.Klass = klass; this.GetterType = getter; this.SetterType = setter; bool is_compiler_generated; DebuggerTypeProxyAttribute type_proxy; MonoSymbolFile.CheckCustomAttributes(pinfo, out browsable_state, out debugger_display, out type_proxy, out is_compiler_generated); }
public MonoClassInfo ResolveClass(TargetMemoryAccess target, bool fail) { if (resolved) { return(class_info); } if (class_info == null) { int token = type.MetadataToken.ToInt32(); class_info = file.LookupClassInfo(target, token); } if (class_info == null) { if (!fail) { return(null); } throw new TargetException(TargetError.ClassNotInitialized, "Class `{0}' not initialized yet.", Name); } if (class_info.HasParent) { MonoClassInfo parent_info = class_info.GetParent(target); parent_type = (IMonoStructType)parent_info.Type; parent_type.ClassInfo = parent_info; if (parent_type.ResolveClass(target, fail) == null) { return(null); } } resolved = true; return(class_info); }
internal MonoFunctionType(IMonoStructType klass, Cecil.MethodDefinition mdef) : base(klass.File.MonoLanguage) { this.klass = klass; this.method_info = mdef; this.token = MonoDebuggerSupport.GetMethodToken (mdef); this.name = GetMethodName (mdef) + MonoSymbolFile.GetMethodSignature (mdef); Cecil.TypeReference rtype; if (mdef.IsConstructor) { rtype = mdef.DeclaringType; has_return_type = true; } else { rtype = mdef.ReturnType.ReturnType; has_return_type = rtype.FullName != "System.Void"; } return_type = klass.File.MonoLanguage.LookupMonoType (rtype); parameter_types = new TargetType [mdef.Parameters.Count]; for (int i = 0; i < mdef.Parameters.Count; i++) parameter_types [i] = klass.File.MonoLanguage.LookupMonoType ( mdef.Parameters[i].ParameterType); }
internal override int GetElementSize(TargetMemoryAccess target) { TargetType element_type; if (ElementType is MonoEnumType) { element_type = ((MonoEnumType)ElementType).ClassType; } else { element_type = ElementType; } IMonoStructType stype = element_type as IMonoStructType; if ((stype == null) || stype.Type.IsByRef) { return(base.GetElementSize(target)); } MonoClassInfo cinfo = stype.ResolveClass(target, true); return(cinfo.GetInstanceSize(target)); }
public MonoClassInfo ResolveClass(TargetMemoryAccess target, bool fail) { if (resolved) return class_info; if (class_info == null) { if (class_ptr.IsNull) return null; TargetAddress klass = target.ReadAddress (class_ptr); if (klass.IsNull) return null; class_info = File.MonoLanguage.ReadClassInfo (target, klass); } if (class_info == null) { if (!fail) return null; throw new TargetException (TargetError.ClassNotInitialized, "Class `{0}' not initialized yet.", Name); } if (class_info.HasParent) { MonoClassInfo parent_info = class_info.GetParent (target); parent_type = (IMonoStructType) parent_info.Type; parent_type.ClassInfo = parent_info; if (parent_type.ResolveClass (target, fail) == null) return null; } resolved = true; return class_info; }
internal static MonoPropertyInfo Create(IMonoStructType klass, int index, Cecil.PropertyDefinition pinfo) { TargetType type = klass.File.MonoLanguage.LookupMonoType (pinfo.PropertyType); bool is_static = false; MonoFunctionType getter, setter; TargetMemberAccessibility accessibility = TargetMemberAccessibility.Private; if (pinfo.SetMethod != null) { setter = klass.LookupFunction (pinfo.SetMethod); is_static = pinfo.SetMethod.IsStatic; accessibility = MonoMethodInfo.GetAccessibility (pinfo.SetMethod); } else setter = null; if (pinfo.GetMethod != null) { getter = klass.LookupFunction (pinfo.GetMethod); is_static = pinfo.GetMethod.IsStatic; accessibility = MonoMethodInfo.GetAccessibility (pinfo.GetMethod); } else getter = null; return new MonoPropertyInfo ( type, klass, index, is_static, pinfo, accessibility, getter, setter); }
private MonoPropertyInfo(TargetType type, IMonoStructType klass, int index, bool is_static, Cecil.PropertyDefinition pinfo, TargetMemberAccessibility accessibility, MonoFunctionType getter, MonoFunctionType setter) : base(type, pinfo.Name, index, is_static, accessibility, getter, setter) { this.Klass = klass; this.GetterType = getter; this.SetterType = setter; bool is_compiler_generated; DebuggerTypeProxyAttribute type_proxy; MonoSymbolFile.CheckCustomAttributes (pinfo, out browsable_state, out debugger_display, out type_proxy, out is_compiler_generated); }
public MonoClassInfo ResolveClass(TargetMemoryAccess target, bool fail) { if (resolved) return class_info; if (class_info == null) { int token = type.MetadataToken.ToInt32 (); class_info = file.LookupClassInfo (target, token); } if (class_info == null) { if (!fail) return null; throw new TargetException (TargetError.ClassNotInitialized, "Class `{0}' not initialized yet.", Name); } if (class_info.HasParent) { MonoClassInfo parent_info = class_info.GetParent (target); parent_type = (IMonoStructType) parent_info.Type; parent_type.ClassInfo = parent_info; if (parent_type.ResolveClass (target, fail) == null) return null; } resolved = true; return class_info; }
public MonoFieldInfo(IMonoStructType type, TargetType field_type, int pos, Cecil.FieldDefinition finfo) : base(field_type, finfo.Name, pos, finfo.IsStatic, GetAccessibility (finfo), pos, 0, finfo.HasConstant) { FieldInfo = finfo; DebuggerTypeProxyAttribute type_proxy; MonoSymbolFile.CheckCustomAttributes (finfo, out browsable_state, out debugger_display, out type_proxy, out is_compiler_generated); }
private MonoMethodInfo(IMonoStructType klass, int index, Cecil.MethodDefinition minfo, MonoFunctionType type) : base(type, MonoFunctionType.GetMethodName (minfo), index, minfo.IsStatic, GetAccessibility (minfo), type.FullName) { FunctionType = type; }
internal static MonoMethodInfo Create(IMonoStructType klass, int index, Cecil.MethodDefinition minfo) { MonoFunctionType type = klass.LookupFunction (minfo); return new MonoMethodInfo (klass, index, minfo, type); }