diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs
index bf5b37d270..d169d88c69 100644
--- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs
@@ -121,6 +121,7 @@ namespace Debugger
{
appDomain.Process.AssertPaused();
+ // TODO: Select thread in the correct AppDomain
Thread targetThread = appDomain.Process.SelectedThread;
if (targetThread == null) {
@@ -195,13 +196,13 @@ namespace Debugger
/// Synchronously calls a function and returns its return value
public static Value InvokeMethod(AppDomain appDomain, System.Type type, string name, Value thisValue, Value[] args)
{
- return InvokeMethod(MethodInfo.GetFromName(appDomain, type, name, args.Length), thisValue, args);
+ return InvokeMethod(DebugMethodInfo.GetFromName(appDomain, type, name, args.Length), thisValue, args);
}
#endregion
/// Synchronously calls a function and returns its return value
- public static Value InvokeMethod(MethodInfo method, Value thisValue, Value[] args)
+ public static Value InvokeMethod(DebugMethodInfo method, Value thisValue, Value[] args)
{
if (method.BackingField != null) {
method.Process.TraceMessage("Using backing field for " + method.FullName);
@@ -210,7 +211,7 @@ namespace Debugger
return AsyncInvokeMethod(method, thisValue, args).WaitForResult();
}
- public static Eval AsyncInvokeMethod(MethodInfo method, Value thisValue, Value[] args)
+ public static Eval AsyncInvokeMethod(DebugMethodInfo method, Value thisValue, Value[] args)
{
return new Eval(
method.AppDomain,
@@ -222,7 +223,7 @@ namespace Debugger
}
/// GetValueException.
- static void MethodInvokeStarter(Eval eval, MethodInfo method, Value thisValue, Value[] args)
+ static void MethodInvokeStarter(Eval eval, DebugMethodInfo method, Value thisValue, Value[] args)
{
List corArgs = new List();
args = args ?? new Value[0];
@@ -337,7 +338,7 @@ namespace Debugger
public static Eval AsyncNewObject(DebugType debugType, Value[] constructorArguments, DebugType[] constructorArgumentsTypes)
{
ICorDebugValue[] constructorArgsCorDebug = ValuesAsCorDebug(constructorArguments);
- MethodInfo constructor = debugType.GetMethod(".ctor", constructorArgumentsTypes);
+ DebugMethodInfo constructor = debugType.GetMethod(".ctor", constructorArgumentsTypes);
if (constructor == null) {
throw new DebuggerException(string.Format("Type {0} has no constructor overload with given argument types.", debugType.FullName));
}
diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/StackFrame.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/StackFrame.cs
index 17cc08267a..4212f7938c 100644
--- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/StackFrame.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/StackFrame.cs
@@ -32,7 +32,7 @@ namespace Debugger
object corILFramePauseSession;
ICorDebugFunction corFunction;
- MethodInfo methodInfo;
+ DebugMethodInfo methodInfo;
uint chainIndex;
uint frameIndex;
@@ -48,7 +48,7 @@ namespace Debugger
}
/// Get the method which this stack frame is executing
- public MethodInfo MethodInfo {
+ public DebugMethodInfo MethodInfo {
get { return methodInfo; }
}
diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionEvaluator.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionEvaluator.cs
index af06800eb6..19c6cd30f4 100644
--- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionEvaluator.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionEvaluator.cs
@@ -405,7 +405,7 @@ namespace Debugger
public override object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data)
{
// This is needed so that captured 'this' is supported
- foreach(LocalVariableInfo locVar in context.MethodInfo.LocalVariables) {
+ foreach(DebugLocalVariableInfo locVar in context.MethodInfo.LocalVariables) {
if (locVar.IsThis)
return locVar.GetValue(context);
}
diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionExtensionMethods.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionExtensionMethods.cs
index f42024231c..509bfddbb5 100644
--- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionExtensionMethods.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionExtensionMethods.cs
@@ -4,11 +4,12 @@
//
// $Revision$
//
-using ICSharpCode.NRefactory.PrettyPrinter;
using System;
using System.Collections.Generic;
using Debugger.MetaData;
using ICSharpCode.NRefactory.Ast;
+using ICSharpCode.NRefactory.PrettyPrinter;
+using System.Reflection;
namespace Debugger
{
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 1fc133f23d..1c1ebb6136 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
@@ -29,7 +29,21 @@ namespace Debugger.MetaData
public override Type DeclaringType {
get {
- throw new NotSupportedException();
+ return declaringType;
+ }
+ }
+
+ /// The AppDomain in which this member is loaded
+ public AppDomain AppDomain {
+ get {
+ return declaringType.AppDomain;
+ }
+ }
+
+ /// The Process in which this member is loaded
+ public Process Process {
+ get {
+ return declaringType.Process;
}
}
@@ -85,7 +99,7 @@ namespace Debugger.MetaData
get {
SignatureReader sigReader = new SignatureReader(fieldProps.SigBlob.GetData());
FieldSig fieldSig = sigReader.GetFieldSig(0);
- return DebugType.CreateFromSignature(this.Module, fieldSig.Type, this.DeclaringType);
+ return DebugType.CreateFromSignature(this.Module, fieldSig.Type, declaringType);
}
}
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 e38672c2ea..f1f025b1e7 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
@@ -36,13 +36,33 @@ namespace Debugger.MetaData
}
}
- public override uint MetadataToken {
+ /// The AppDomain in which this member is loaded
+ public AppDomain AppDomain {
get {
- return methodProps.Token;
+ return declaringType.AppDomain;
+ }
+ }
+
+ /// The Process in which this member is loaded
+ public Process Process {
+ get {
+ return declaringType.Process;
+ }
+ }
+
+ public override int MetadataToken {
+ get {
+ return (int)methodProps.Token;
}
}
// public virtual Module Module { get; }
+ public string FullName {
+ get {
+ return this.DeclaringType.FullName + "." + this.Name;
+ }
+ }
+
public override string Name {
get {
return methodProps.Name;
@@ -76,7 +96,7 @@ namespace Debugger.MetaData
public override MethodImplAttributes GetMethodImplementationFlags()
{
- return methodProps.ImplFlags;
+ return (MethodImplAttributes)methodProps.ImplFlags;
}
// internal virtual uint GetOneTimeFlags();
@@ -120,11 +140,11 @@ namespace Debugger.MetaData
// public override bool IsGenericMethodDefinition { get; }
// public virtual ParameterInfo ReturnParameter { get; }
- public override Type GetReturnType()
+ public Type GetReturnType()
{
if (this.MethodDefSig.RetType.Void) return null;
if (returnType == null) {
- returnType = DebugType.CreateFromSignature(this.Module, this.MethodDefSig.RetType.Type, this.DeclaringType);
+ returnType = DebugType.CreateFromSignature(this.Module, this.MethodDefSig.RetType.Type, declaringType);
}
return returnType;
}
@@ -157,12 +177,12 @@ namespace Debugger.MetaData
parameters = new ParameterInfo[this.MethodDefSig.ParamCount];
for(int i = 0; i < parameters.Length; i++) {
parameters[i] =
- new DebugParameterInfo() {
- Member = this,
- Name = this.GetParameterName(i),
- Position = i,
- ParameterType = DebugType.CreateFromSignature(this.Module, this.MethodDefSig.Parameters[i].Type, this.DeclaringType),
- };
+ new DebugParameterInfo(
+ this,
+ this.GetParameterName(i),
+ DebugType.CreateFromSignature(this.Module, this.MethodDefSig.Parameters[i].Type, declaringType),
+ i
+ );
}
}
return parameters;
@@ -373,7 +393,7 @@ namespace Debugger.MetaData
typeof(System.Diagnostics.DebuggerHiddenAttribute))
||
// Look on the type
- HasAnyAttribute(this.Module.MetaData, this.DeclaringType.Token,
+ HasAnyAttribute(this.Module.MetaData, (uint)this.DeclaringType.MetadataToken,
typeof(System.Diagnostics.DebuggerStepThroughAttribute),
typeof(System.Diagnostics.DebuggerNonUserCodeAttribute),
typeof(System.Diagnostics.DebuggerHiddenAttribute));
@@ -504,14 +524,14 @@ namespace Debugger.MetaData
if (localVariables != null) return localVariables;
localVariables = GetLocalVariablesInScope(this.SymMethod.RootScope);
- if (this.DeclaringType.IsDisplayClass || this.DeclaringType.IsYieldEnumerator) {
+ if (declaringType.IsDisplayClass || declaringType.IsYieldEnumerator) {
// Get display class from self
AddCapturedLocalVariables(
localVariables,
delegate(StackFrame context) {
return context.GetThisValue();
},
- this.DeclaringType
+ declaringType
);
// Get dispaly classes from fields
foreach(DebugFieldInfo fieldInfo in this.DeclaringType.GetFields()) {
@@ -522,7 +542,7 @@ namespace Debugger.MetaData
delegate(StackFrame context) {
return context.GetThisValue().GetFieldValue(fieldInfoCopy);
},
- fieldInfo.FieldType
+ (DebugType)fieldInfo.FieldType
);
}
}
@@ -590,7 +610,7 @@ namespace Debugger.MetaData
int start;
SignatureReader sigReader = new SignatureReader(symVar.Signature);
LocalVarSig.LocalVariable locVarSig = sigReader.ReadLocalVariable(sigReader.Blob, 0, out start);
- DebugType locVarType = DebugType.CreateFromSignature(this.Module, locVarSig.Type, this.DeclaringType);
+ DebugType locVarType = DebugType.CreateFromSignature(this.Module, locVarSig.Type, declaringType);
// Compiler generated?
// NB: Display class does not have the compiler-generated flag
if ((symVar.Attributes & 1) == 1 || symVar.Name.StartsWith("CS$")) {
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 e1a05080ea..38ec5b839a 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
@@ -18,10 +18,34 @@ namespace Debugger.MetaData
{
public class DebugParameterInfo : System.Reflection.ParameterInfo
{
- public override MemberInfo Member { get; internal set; }
- public override string Name { get; internal set; }
- public override Type ParameterType { get; internal set; }
- public override int Position { get; internal set; }
+ public MemberInfo member;
+ public string name;
+ public Type parameterType;
+ public 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; }
+ }
+
+ public DebugParameterInfo(MemberInfo member, string name, Type parameterType, int position)
+ {
+ this.member = member;
+ this.name = name;
+ this.parameterType = parameterType;
+ this.position = position;
+ }
// public virtual ParameterAttributes Attributes { get; }
// public virtual object DefaultValue { get; }
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 feb7d6e070..13be58ff9b 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
@@ -36,7 +36,21 @@ namespace Debugger.MetaData
}
}
- public override uint MetadataToken {
+ /// The AppDomain in which this member is loaded
+ public AppDomain AppDomain {
+ get {
+ return declaringType.AppDomain;
+ }
+ }
+
+ /// The Process in which this member is loaded
+ public Process Process {
+ get {
+ return declaringType.Process;
+ }
+ }
+
+ public override int MetadataToken {
get {
return (getMethod ?? setMethod).MetadataToken;
}
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 5c87543813..f996f52ff9 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
@@ -29,6 +29,9 @@ namespace Debugger.MetaData
///
public class DebugType: System.Type
{
+ const BindingFlags BindingFlagsAll = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance;
+ const BindingFlags BindingFlagsAllDeclared = BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance;
+
AppDomain appDomain;
Process process;
ICorDebugType corType;
@@ -59,7 +62,7 @@ namespace Debugger.MetaData
public override int MetadataToken {
get {
AssertClassOrValueType();
- return classProps.Token;
+ return (int)classProps.Token;
}
}
@@ -155,7 +158,7 @@ namespace Debugger.MetaData
// internal virtual bool IsSzArray { get; }
// public override MemberTypes MemberType { get; }
- public override Module Module {
+ public override System.Reflection.Module Module {
get {
AssertClassOrValueType();
return module;
@@ -215,7 +218,7 @@ namespace Debugger.MetaData
public T GetMember(string name, BindingFlags bindingFlags, Predicate filter) where T:MemberInfo
{
- T[] res = GetMembersImpl(name, bindingFlags, filter);
+ T[] res = GetMembers(name, bindingFlags, filter);
if (res.Length > 0) {
return res[0];
} else {
@@ -293,7 +296,7 @@ namespace Debugger.MetaData
// Do not include static types
bindingFlags = bindingFlags & ~BindingFlags.Static;
}
- List superResults = this.BaseType.QueryMembers(bindingFlags, name, token);
+ List superResults = this.BaseType.GetMembers(name, bindingFlags, filter);
results.AddRange(superResults);
}
@@ -328,7 +331,16 @@ namespace Debugger.MetaData
public override Type GetInterface(string name, bool ignoreCase)
{
- throw new NotSupportedException();
+ foreach(DebugType inter in this.Interfaces) {
+ if (string.Equals(inter.FullName, fullName, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal)) {
+ return inter;
+ }
+ }
+ if (BaseType != null) {
+ return BaseType.GetInterface(fullName);
+ } else {
+ return null;
+ }
}
// public virtual InterfaceMapping GetInterfaceMap(Type interfaceType);
@@ -375,7 +387,7 @@ namespace Debugger.MetaData
protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] paramTypes, ParameterModifier[] modifiers)
{
// TODO: Finish
- foreach(MethodInfo candidate in GetMembers(name, bindingAttr, null))) {
+ foreach(DebugMethodInfo candidate in GetMembers(name, bindingAttr, null)) {
if (paramTypes == null)
return candidate;
if (candidate.ParameterCount == paramTypes.Length) {
@@ -482,7 +494,7 @@ namespace Debugger.MetaData
return base.IsSubclassOf(superType);
}
- protected virtual bool IsValueTypeImpl()
+ protected override bool IsValueTypeImpl()
{
return this.Kind == DebugTypeKind.ValueType;
}
@@ -514,22 +526,6 @@ namespace Debugger.MetaData
get { return interfaces; }
}
- /// Return an interface with the given name
- /// Null if not found
- public DebugType GetInterface(string fullName)
- {
- foreach(DebugType inter in this.Interfaces) {
- if (inter.FullName == fullName) {
- return inter;
- }
- }
- if (BaseType != null) {
- return BaseType.GetInterface(fullName);
- } else {
- return null;
- }
- }
-
/// Get an element type for array or pointer.
public DebugType ElementType {
get {
@@ -749,7 +745,7 @@ namespace Debugger.MetaData
if (module.AppDomain == appDomain) {
uint token;
try {
- token = module.MetaData.FindTypeDefPropsByName(typeName, enclosingType == null ? 0 : enclosingType.Token).Token;
+ token = module.MetaData.FindTypeDefPropsByName(typeName, enclosingType == null ? 0 : enclosingType.MetadataToken).Token;
} catch {
continue;
}
@@ -788,10 +784,10 @@ namespace Debugger.MetaData
}
DebugType type = CreateFromName(appDomain, typeRef.Type, genArgs.ToArray());
for(int i = 0; i < typeRef.PointerNestingLevel; i++) {
- type = MakePointerType(type);
+ type = (DebugType)type.MakePointerType();
}
for(int i = typeRef.RankSpecifier.Length - 1; i >= 0; i--) {
- type = MakeArrayType(type, typeRef.RankSpecifier[i] + 1);
+ type = (DebugType)type.MakeArrayType(typeRef.RankSpecifier[i] + 1);
}
return type;
}
@@ -848,13 +844,13 @@ namespace Debugger.MetaData
if (sigType is ARRAY) {
ARRAY arraySig = (ARRAY)sigType;
DebugType elementType = CreateFromSignature(module, arraySig.Type, declaringType);
- return MakeArrayType(elementType, arraySig.Shape.Rank);
+ return (DebugType)elementType.MakeArrayType(arraySig.Shape.Rank);
}
if (sigType is SZARRAY) {
SZARRAY arraySig = (SZARRAY)sigType;
DebugType elementType = CreateFromSignature(module, arraySig.Type, declaringType);
- return MakeArrayType(elementType);
+ return (DebugType)elementType.MakeArrayType();
}
if (sigType is PTR) {
@@ -865,7 +861,7 @@ namespace Debugger.MetaData
} else {
elementType = CreateFromSignature(module, ptrSig.PtrType, declaringType);
}
- return MakePointerType(elementType);
+ return (DebugType)elementType.MakePointerType();
}
if (sigType is FNPTR) {
@@ -879,26 +875,26 @@ namespace Debugger.MetaData
public override Type MakeArrayType(int rank)
{
- ICorDebugType res = elementType.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.ARRAY, (uint)rank, elementType.CorType);
- return CreateFromCorType(elementType.AppDomain, res);
+ 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 = elementType.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.SZARRAY, 1, elementType.CorType);
- return CreateFromCorType(elementType.AppDomain, res);
+ ICorDebugType res = this.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.SZARRAY, 1, this.CorType);
+ return CreateFromCorType(this.AppDomain, res);
}
public override Type MakePointerType()
{
- ICorDebugType res = elementType.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.PTR, 0, elementType.CorType);
- return CreateFromCorType(elementType.AppDomain, res);
+ ICorDebugType res = this.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.PTR, 0, this.CorType);
+ return CreateFromCorType(this.AppDomain, res);
}
public override Type MakeByRefType()
{
- ICorDebugType res = elementType.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.BYREF, 0, elementType.CorType);
- return CreateFromCorType(elementType.AppDomain, res);
+ ICorDebugType res = this.AppDomain.CorAppDomain.CastTo().GetArrayOrPointerType((uint)CorElementType.BYREF, 0, this.CorType);
+ return CreateFromCorType(this.AppDomain, res);
}
public static DebugType CreateFromCorClass(AppDomain appDomain, bool? valueType, ICorDebugClass corClass, DebugType[] genericArguments)
@@ -1041,7 +1037,7 @@ namespace Debugger.MetaData
void LoadMemberInfo()
{
// Load interfaces
- foreach(InterfaceImplProps implProps in module.MetaData.EnumInterfaceImplProps(this.Token)) {
+ foreach(InterfaceImplProps implProps in module.MetaData.EnumInterfaceImplProps((uint)this.MetadataToken)) {
CorTokenType tkType = (CorTokenType)(implProps.Interface & 0xFF000000);
if (tkType == CorTokenType.TypeDef || tkType == CorTokenType.TypeRef) {
this.interfaces.Add(DebugType.CreateFromTypeDefOrRef(module, false, implProps.Interface, null));
@@ -1053,14 +1049,14 @@ namespace Debugger.MetaData
}
// Load fields
- foreach(FieldProps field in module.MetaData.EnumFieldProps(this.Token)) {
+ foreach(FieldProps field in module.MetaData.EnumFieldProps((uint)this.MetadataToken)) {
if (field.IsStatic && field.IsLiteral) continue; // Skip static literals TODO: Why?
AddMember(new DebugFieldInfo(this, field));
};
// Load methods
- foreach(MethodProps m in module.MetaData.EnumMethodProps(this.Token)) {
- AddMember(new MethodInfo(this, m));
+ foreach(MethodProps m in module.MetaData.EnumMethodProps((uint)this.MetadataToken)) {
+ AddMember(new DebugMethodInfo(this, m));
}
// Load properties
@@ -1069,7 +1065,7 @@ namespace Debugger.MetaData
// Collect data
Dictionary accessors = new Dictionary();
Dictionary propertyNames = new Dictionary();
- foreach(MethodInfo method in this.GetMethods(BindingFlags.AllInThisType)) {
+ foreach(MethodInfo method in this.GetMethods(BindingFlagsAllDeclared)) {
if (method.IsSpecialName && (method.Name.StartsWith("get_") || method.Name.StartsWith("set_"))) {
// There can be many get_Items
// TODO: This returns only last, return all
@@ -1083,7 +1079,7 @@ namespace Debugger.MetaData
MethodInfo setter = null;
accessors.TryGetValue("get_" + kvp.Key, out getter);
accessors.TryGetValue("set_" + kvp.Key, out setter);
- AddMember(new PropertyInfo(this, getter, setter));
+ AddMember(new DebugPropertyInfo(this, getter, setter));
}
}
@@ -1097,7 +1093,7 @@ namespace Debugger.MetaData
public bool IsCompilerGenerated {
get {
if (this.IsClass || this.IsValueType) {
- return MethodInfo.HasAnyAttribute(this.Module.MetaData, this.Token, typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute));
+ return MethodInfo.HasAnyAttribute(this.Module.MetaData, this.MetadataToken, typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute));
} else {
return false;
}
diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Object.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Object.cs
index e232f82251..135b16cea1 100644
--- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Object.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Object.cs
@@ -251,7 +251,7 @@ namespace Debugger
return this.GetPropertyValue((PropertyInfo)memberInfo);
}
}
- currentType = currentType.BaseType;
+ currentType = (DebugType)currentType.BaseType;
}
return null;
}