diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugFieldInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugFieldInfo.cs index d991777789..30430fcec6 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugFieldInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugFieldInfo.cs @@ -27,6 +27,7 @@ namespace Debugger.MetaData this.fieldProps = fieldProps; } + /// public override Type DeclaringType { get { return declaringType; } } @@ -46,45 +47,55 @@ namespace Debugger.MetaData get { return declaringType.DebugModule; } } + /// public override int MetadataToken { get { return (int)fieldProps.Token; } } + /// public override System.Reflection.Module Module { get { throw new NotSupportedException(); } } + /// public override string Name { get { return fieldProps.Name; } } + /// public override Type ReflectedType { get { throw new NotSupportedException(); } } + /// public override object[] GetCustomAttributes(bool inherit) { throw new NotSupportedException(); } + /// public override object[] GetCustomAttributes(Type attributeType, bool inherit) { throw new NotSupportedException(); } + /// public override bool IsDefined(Type attributeType, bool inherit) { return DebugType.IsDefined(this, inherit, attributeType); } + /// public override FieldAttributes Attributes { get { return (FieldAttributes)fieldProps.Flags; } } + /// public override RuntimeFieldHandle FieldHandle { get { throw new NotSupportedException(); } } + /// public override Type FieldType { get { SignatureReader sigReader = new SignatureReader(fieldProps.SigBlob.GetData()); @@ -97,16 +108,19 @@ namespace Debugger.MetaData // public virtual object GetRawConstantValue(); // public virtual Type[] GetRequiredCustomModifiers(); + /// public override object GetValue(object obj) { return Value.GetFieldValue((Value)obj, this); } + /// public override void SetValue(object obj, object value, System.Reflection.BindingFlags invokeAttr, Binder binder, CultureInfo culture) { Value.SetFieldValue((Value)obj, this, (Value)value); } + /// public override string ToString() { return this.FieldType + " " + this.Name; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugLocalVariableInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugLocalVariableInfo.cs index 0effbabf5b..dd2ab1a295 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugLocalVariableInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugLocalVariableInfo.cs @@ -25,14 +25,17 @@ namespace Debugger.MetaData int localIndex; DebugType localType; + /// public override int LocalIndex { get { return localIndex; } } + /// public override Type LocalType { get { return localType; } } + /// public override bool IsPinned { get { throw new NotSupportedException(); } } @@ -54,6 +57,7 @@ namespace Debugger.MetaData return getter(context); } + /// public override string ToString() { string msg = this.LocalType + " " + this.Name; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugMethodInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugMethodInfo.cs index 18c87581a2..96e7c4879f 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugMethodInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugMethodInfo.cs @@ -31,6 +31,7 @@ namespace Debugger.MetaData this.methodProps = methodProps; } + /// public override Type DeclaringType { get { return declaringType; } } @@ -50,10 +51,12 @@ namespace Debugger.MetaData get { return declaringType.DebugModule; } } + /// public override int MetadataToken { get { return (int)methodProps.Token; } } + /// public override System.Reflection.Module Module { get { throw new NotSupportedException(); } } @@ -80,24 +83,29 @@ namespace Debugger.MetaData } } + /// public override string Name { get { return methodProps.Name; } } + /// public override Type ReflectedType { get { throw new NotSupportedException(); } } + /// public override object[] GetCustomAttributes(bool inherit) { throw new NotSupportedException(); } + /// public override object[] GetCustomAttributes(Type attributeType, bool inherit) { throw new NotSupportedException(); } + /// public override bool IsDefined(Type attributeType, bool inherit) { return DebugType.IsDefined(this, inherit, attributeType); @@ -106,11 +114,13 @@ namespace Debugger.MetaData // public virtual Type[] GetGenericArguments(); // public virtual MethodBody GetMethodBody(); + /// public override MethodImplAttributes GetMethodImplementationFlags() { return (MethodImplAttributes)methodProps.ImplFlags; } + /// public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) { List args = new List(); @@ -120,28 +130,34 @@ namespace Debugger.MetaData return Eval.InvokeMethod(this, (Value)obj, args.ToArray()); } + /// public override MethodAttributes Attributes { get { return (MethodAttributes)methodProps.Flags; } } // public virtual CallingConventions CallingConvention { get; } + /// public override bool ContainsGenericParameters { get { throw new NotSupportedException(); } } + /// public override bool IsGenericMethod { get { throw new NotSupportedException(); } } + /// public override bool IsGenericMethodDefinition { get { throw new NotSupportedException(); } } + /// public override RuntimeMethodHandle MethodHandle { get { throw new NotSupportedException(); } } + /// public override MethodInfo GetBaseDefinition() { throw new NotSupportedException(); @@ -152,6 +168,7 @@ namespace Debugger.MetaData // public virtual MethodInfo MakeGenericMethod(params Type[] typeArguments); // public override bool ContainsGenericParameters { get; } + /// public override Type ReturnType { get { if (this.MethodDefSig.RetType.Void) return null; @@ -159,6 +176,7 @@ namespace Debugger.MetaData } } + /// public override ParameterInfo ReturnParameter { get { if (this.MethodDefSig.RetType.Void) return null; @@ -166,6 +184,7 @@ namespace Debugger.MetaData } } + /// public override ICustomAttributeProvider ReturnTypeCustomAttributes { get { throw new NotSupportedException(); } } @@ -189,6 +208,7 @@ namespace Debugger.MetaData ParameterInfo[] parameters; + /// public override ParameterInfo[] GetParameters() { if (parameters == null) { @@ -591,6 +611,7 @@ namespace Debugger.MetaData return new Value(context.AppDomain, corVal); } + /// public override string ToString() { string txt = string.Empty; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugParameterInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugParameterInfo.cs index 1f392a5414..2d36054b15 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugParameterInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugParameterInfo.cs @@ -23,18 +23,22 @@ namespace Debugger.MetaData Type parameterType; int position; + /// public override MemberInfo Member { get { return member; } } + /// public override string Name { get { return name; } } + /// public override Type ParameterType { get { return parameterType; } } + /// public override int Position { get { return position; } } @@ -57,6 +61,7 @@ namespace Debugger.MetaData // public virtual Type[] GetRequiredCustomModifiers(); // public virtual bool IsDefined(Type attributeType, bool inherit); + /// public override string ToString() { return this.ParameterType + " " + this.Name; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugPropertyInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugPropertyInfo.cs index 84d79ff097..a3970b95d0 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugPropertyInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugPropertyInfo.cs @@ -30,6 +30,7 @@ namespace Debugger.MetaData this.setMethod = setMethod; } + /// public override Type DeclaringType { get { return declaringType; } } @@ -49,51 +50,62 @@ namespace Debugger.MetaData get { return declaringType.DebugModule; } } + /// public override int MetadataToken { get { return 0; } } + /// public override System.Reflection.Module Module { get { throw new NotSupportedException(); } } + /// public override string Name { get { return (getMethod ?? setMethod).Name.Remove(0,4); } } + /// public override Type ReflectedType { get { throw new NotSupportedException(); } } + /// public override object[] GetCustomAttributes(bool inherit) { throw new NotSupportedException(); } + /// public override object[] GetCustomAttributes(Type attributeType, bool inherit) { throw new NotSupportedException(); } + /// public override bool IsDefined(Type attributeType, bool inherit) { return DebugType.IsDefined(this, inherit, attributeType); } + /// public override PropertyAttributes Attributes { get { throw new NotSupportedException(); } } + /// public override bool CanRead { get { return getMethod != null; } } + /// public override bool CanWrite { get { return setMethod != null; } } + /// public override Type PropertyType { get { if (getMethod != null) { @@ -104,6 +116,7 @@ namespace Debugger.MetaData } } + /// public override MethodInfo[] GetAccessors(bool nonPublic) { throw new NotSupportedException(); @@ -111,11 +124,13 @@ namespace Debugger.MetaData // public virtual object GetConstantValue(); + /// public override MethodInfo GetGetMethod(bool nonPublic) { return getMethod; } + /// public override ParameterInfo[] GetIndexParameters() { if (GetGetMethod() != null) { @@ -129,11 +144,13 @@ namespace Debugger.MetaData // public virtual object GetRawConstantValue(); // public virtual Type[] GetRequiredCustomModifiers(); + /// public override MethodInfo GetSetMethod(bool nonPublic) { return setMethod; } + /// public override object GetValue(object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) { List args = new List(); @@ -143,6 +160,7 @@ namespace Debugger.MetaData return Value.GetPropertyValue((Value)obj, this, args.ToArray()); } + /// public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) { List args = new List(); @@ -166,6 +184,7 @@ namespace Debugger.MetaData } } + /// public override string ToString() { return this.PropertyType + " " + this.Name; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs index 1f7ed7d677..da9fe57988 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs @@ -55,6 +55,7 @@ namespace Debugger.MetaData get { return corType; } } + /// public override Type DeclaringType { get { throw new NotSupportedException(); } } @@ -74,32 +75,39 @@ namespace Debugger.MetaData get { return module; } } + /// public override int MetadataToken { get { return (int)classProps.Token; } } + /// public override System.Reflection.Module Module { get { throw new NotSupportedException(); } } + /// public override string Name { get { return name; } } + /// public override Type ReflectedType { get { throw new NotSupportedException(); } } + /// public override object[] GetCustomAttributes(bool inherit) { throw new NotSupportedException(); } + /// public override object[] GetCustomAttributes(Type attributeType, bool inherit) { throw new NotSupportedException(); } + /// public override bool IsDefined(Type attributeType, bool inherit) { return IsDefined(this, inherit, attributeType); @@ -130,14 +138,17 @@ namespace Debugger.MetaData return false; } + /// public override Assembly Assembly { get { throw new NotSupportedException(); } } + /// public override string AssemblyQualifiedName { get { throw new NotSupportedException(); } } + /// public override Type BaseType { get { // corType.Base *sometimes* does not work for object and can cause "Value does not fall within the expected range." exception @@ -167,10 +178,12 @@ namespace Debugger.MetaData // public virtual bool ContainsGenericParameters { get; } // public virtual MethodBase DeclaringMethod { get; } + /// public override string FullName { get { return fullName; } } + /// public override Guid GUID { get { throw new NotSupportedException(); } } @@ -180,26 +193,31 @@ namespace Debugger.MetaData // public virtual bool IsGenericParameter { get; } // public virtual bool IsGenericTypeDefinition { get; } + /// public override bool IsGenericType { get { return this.GetGenericArguments().Length > 0; } } + /// public override string Namespace { get { return ns; } } // public virtual StructLayoutAttribute StructLayoutAttribute { get; } + /// public override RuntimeTypeHandle TypeHandle { get { throw new NotSupportedException(); } } + /// public override Type UnderlyingSystemType { get { return this; } } + /// public override int GetArrayRank() { if (!IsArray) throw new ArgumentException("Type is not array"); @@ -207,17 +225,20 @@ namespace Debugger.MetaData return (int)corType.Rank; } + /// protected override TypeAttributes GetAttributeFlagsImpl() { return (TypeAttributes)classProps.Flags; } + /// protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { // TODO throw new NotSupportedException(); } + /// public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { throw new NotSupportedException(); @@ -225,6 +246,7 @@ namespace Debugger.MetaData // public virtual MemberInfo[] GetDefaultMembers(); + /// public override Type GetElementType() { return elementType; @@ -305,6 +327,7 @@ namespace Debugger.MetaData return results.ToArray(); } + /// public override EventInfo GetEvent(string name, BindingFlags bindingAttr) { throw new NotSupportedException(); @@ -312,21 +335,25 @@ namespace Debugger.MetaData // public virtual EventInfo[] GetEvents(); + /// public override EventInfo[] GetEvents(BindingFlags bindingAttr) { throw new NotSupportedException(); } + /// public override FieldInfo GetField(string name, BindingFlags bindingAttr) { return GetMember(name, bindingAttr, null); } + /// public override FieldInfo[] GetFields(BindingFlags bindingAttr) { return GetMembers(null, bindingAttr, null); } + /// public override Type[] GetGenericArguments() { return genericArguments.ToArray(); @@ -345,6 +372,7 @@ namespace Debugger.MetaData // public virtual Type[] GetGenericParameterConstraints(); // public virtual Type GetGenericTypeDefinition(); + /// public override Type GetInterface(string name, bool ignoreCase) { foreach(DebugType inter in this.GetInterfaces()) { @@ -361,16 +389,19 @@ namespace Debugger.MetaData // public virtual InterfaceMapping GetInterfaceMap(Type interfaceType); + /// public override Type[] GetInterfaces() { return this.interfaces.ToArray(); } + /// public override MemberInfo[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr) { return GetMembers(name, bindingAttr, delegate(MemberInfo info) { return (info.MemberType & type) != 0; }); } + /// public override MemberInfo[] GetMembers(BindingFlags bindingAttr) { return GetMembers(null, bindingAttr, null); @@ -394,6 +425,7 @@ namespace Debugger.MetaData return null; } + /// protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] paramTypes, ParameterModifier[] modifiers) { // TODO: Finish @@ -418,16 +450,19 @@ namespace Debugger.MetaData return GetMembers(name, bindingAttr, null); } + /// public override MethodInfo[] GetMethods(BindingFlags bindingAttr) { return GetMembers(null, bindingAttr, null); } + /// public override Type GetNestedType(string name, BindingFlags bindingAttr) { throw new NotSupportedException(); } + /// public override Type[] GetNestedTypes(BindingFlags bindingAttr) { throw new NotSupportedException(); @@ -446,38 +481,45 @@ namespace Debugger.MetaData }); } + /// public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) { return GetMembers(null, bindingAttr, null); } + /// protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { // TODO: Finsih return GetMember(name, bindingAttr, null); } + /// protected override bool HasElementTypeImpl() { return elementType != null; } + /// public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) { throw new NotSupportedException(); } + /// protected override bool IsArrayImpl() { return corElementType == CorElementType.ARRAY || corElementType == CorElementType.SZARRAY; } + /// protected override bool IsByRefImpl() { return corElementType == CorElementType.BYREF; } + /// protected override bool IsPointerImpl() { return corElementType == CorElementType.PTR; @@ -495,6 +537,7 @@ namespace Debugger.MetaData // } // } + /// protected override bool IsValueTypeImpl() { // ValueType and Enum are exceptions and are threated as classes @@ -503,6 +546,7 @@ namespace Debugger.MetaData this.IsSubclassOf(this.AppDomain.ValueType); } + /// public override bool IsSubclassOf(Type superType) { if (!(superType is DebugType)) { @@ -511,11 +555,13 @@ namespace Debugger.MetaData return base.IsSubclassOf(superType); } + /// protected override bool IsCOMObjectImpl() { throw new NotSupportedException(); } + /// public override bool IsInstanceOfType(object o) { if (o == null) return false; @@ -523,6 +569,7 @@ namespace Debugger.MetaData return this.IsAssignableFrom(((Value)o).Type); } + /// public override bool IsAssignableFrom(Type c) { // TODO: Finsih @@ -539,6 +586,7 @@ namespace Debugger.MetaData get { return primitiveType; } } + /// protected override bool IsPrimitiveImpl() { return this.PrimitiveType != null; @@ -757,24 +805,28 @@ namespace Debugger.MetaData // public virtual Type MakeGenericType(params Type[] typeArguments); + /// public override Type MakeArrayType(int rank) { ICorDebugType res = this.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.ARRAY, (uint)rank, this.CorType); return CreateFromCorType(this.AppDomain, res); } + /// public override Type MakeArrayType() { ICorDebugType res = this.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.SZARRAY, 1, this.CorType); return CreateFromCorType(this.AppDomain, res); } + /// public override Type MakePointerType() { ICorDebugType res = this.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.PTR, 0, this.CorType); return CreateFromCorType(this.AppDomain, res); } + /// public override Type MakeByRefType() { ICorDebugType res = this.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.BYREF, 0, this.CorType); @@ -1031,6 +1083,7 @@ namespace Debugger.MetaData membersByToken[member.MetadataToken] = member; } + /// public override string ToString() { return this.FullName;