Browse Source

Fixing some syntax errors (still work in progress)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5104 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 16 years ago
parent
commit
e144544cd4
  1. 11
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs
  2. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/StackFrame.cs
  3. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionEvaluator.cs
  4. 3
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionExtensionMethods.cs
  5. 18
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugFieldInfo.cs
  6. 52
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugMethodInfo.cs
  7. 32
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugParameterInfo.cs
  8. 16
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugPropertyInfo.cs
  9. 84
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs
  10. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Object.cs

11
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs

@ -121,6 +121,7 @@ namespace Debugger @@ -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 @@ -195,13 +196,13 @@ namespace Debugger
/// <summary> Synchronously calls a function and returns its return value </summary>
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
/// <summary> Synchronously calls a function and returns its return value </summary>
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 @@ -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 @@ -222,7 +223,7 @@ namespace Debugger
}
/// <exception cref="GetValueException"><c>GetValueException</c>.</exception>
static void MethodInvokeStarter(Eval eval, MethodInfo method, Value thisValue, Value[] args)
static void MethodInvokeStarter(Eval eval, DebugMethodInfo method, Value thisValue, Value[] args)
{
List<ICorDebugValue> corArgs = new List<ICorDebugValue>();
args = args ?? new Value[0];
@ -337,7 +338,7 @@ namespace Debugger @@ -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));
}

4
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/StackFrame.cs

@ -32,7 +32,7 @@ namespace Debugger @@ -32,7 +32,7 @@ namespace Debugger
object corILFramePauseSession;
ICorDebugFunction corFunction;
MethodInfo methodInfo;
DebugMethodInfo methodInfo;
uint chainIndex;
uint frameIndex;
@ -48,7 +48,7 @@ namespace Debugger @@ -48,7 +48,7 @@ namespace Debugger
}
/// <summary> Get the method which this stack frame is executing </summary>
public MethodInfo MethodInfo {
public DebugMethodInfo MethodInfo {
get { return methodInfo; }
}

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionEvaluator.cs

@ -405,7 +405,7 @@ namespace Debugger @@ -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);
}

3
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/ExpressionExtensionMethods.cs

@ -4,11 +4,12 @@ @@ -4,11 +4,12 @@
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
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
{

18
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugFieldInfo.cs

@ -29,7 +29,21 @@ namespace Debugger.MetaData @@ -29,7 +29,21 @@ namespace Debugger.MetaData
public override Type DeclaringType {
get {
throw new NotSupportedException();
return declaringType;
}
}
/// <summary> The AppDomain in which this member is loaded </summary>
public AppDomain AppDomain {
get {
return declaringType.AppDomain;
}
}
/// <summary> The Process in which this member is loaded </summary>
public Process Process {
get {
return declaringType.Process;
}
}
@ -85,7 +99,7 @@ namespace Debugger.MetaData @@ -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);
}
}

52
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugMethodInfo.cs

@ -36,13 +36,33 @@ namespace Debugger.MetaData @@ -36,13 +36,33 @@ namespace Debugger.MetaData
}
}
public override uint MetadataToken {
/// <summary> The AppDomain in which this member is loaded </summary>
public AppDomain AppDomain {
get {
return methodProps.Token;
return declaringType.AppDomain;
}
}
/// <summary> The Process in which this member is loaded </summary>
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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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$")) {

32
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugParameterInfo.cs

@ -18,10 +18,34 @@ namespace Debugger.MetaData @@ -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; }

16
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugPropertyInfo.cs

@ -36,7 +36,21 @@ namespace Debugger.MetaData @@ -36,7 +36,21 @@ namespace Debugger.MetaData
}
}
public override uint MetadataToken {
/// <summary> The AppDomain in which this member is loaded </summary>
public AppDomain AppDomain {
get {
return declaringType.AppDomain;
}
}
/// <summary> The Process in which this member is loaded </summary>
public Process Process {
get {
return declaringType.Process;
}
}
public override int MetadataToken {
get {
return (getMethod ?? setMethod).MetadataToken;
}

84
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs

@ -29,6 +29,9 @@ namespace Debugger.MetaData @@ -29,6 +29,9 @@ namespace Debugger.MetaData
/// </remarks>
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 @@ -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 @@ -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 @@ -215,7 +218,7 @@ namespace Debugger.MetaData
public T GetMember<T>(string name, BindingFlags bindingFlags, Predicate<T> filter) where T:MemberInfo
{
T[] res = GetMembersImpl<T>(name, bindingFlags, filter);
T[] res = GetMembers<T>(name, bindingFlags, filter);
if (res.Length > 0) {
return res[0];
} else {
@ -293,7 +296,7 @@ namespace Debugger.MetaData @@ -293,7 +296,7 @@ namespace Debugger.MetaData
// Do not include static types
bindingFlags = bindingFlags & ~BindingFlags.Static;
}
List<T> superResults = this.BaseType.QueryMembers<T>(bindingFlags, name, token);
List<T> superResults = this.BaseType.GetMembers<T>(name, bindingFlags, filter);
results.AddRange(superResults);
}
@ -328,7 +331,16 @@ namespace Debugger.MetaData @@ -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 @@ -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<MethodInfo>(name, bindingAttr, null))) {
foreach(DebugMethodInfo candidate in GetMembers<DebugMethodInfo>(name, bindingAttr, null)) {
if (paramTypes == null)
return candidate;
if (candidate.ParameterCount == paramTypes.Length) {
@ -482,7 +494,7 @@ namespace Debugger.MetaData @@ -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 @@ -514,22 +526,6 @@ namespace Debugger.MetaData
get { return interfaces; }
}
/// <summary> Return an interface with the given name </summary>
/// <returns> Null if not found </returns>
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;
}
}
/// <summary> Get an element type for array or pointer. </summary>
public DebugType ElementType {
get {
@ -749,7 +745,7 @@ namespace Debugger.MetaData @@ -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 @@ -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 @@ -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 @@ -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 @@ -879,26 +875,26 @@ namespace Debugger.MetaData
public override Type MakeArrayType(int rank)
{
ICorDebugType res = elementType.AppDomain.CorAppDomain.CastTo<ICorDebugAppDomain2>().GetArrayOrPointerType((uint)CorElementType.ARRAY, (uint)rank, elementType.CorType);
return CreateFromCorType(elementType.AppDomain, res);
ICorDebugType res = this.AppDomain.CorAppDomain.CastTo<ICorDebugAppDomain2>().GetArrayOrPointerType((uint)CorElementType.ARRAY, (uint)rank, this.CorType);
return CreateFromCorType(this.AppDomain, res);
}
public override Type MakeArrayType()
{
ICorDebugType res = elementType.AppDomain.CorAppDomain.CastTo<ICorDebugAppDomain2>().GetArrayOrPointerType((uint)CorElementType.SZARRAY, 1, elementType.CorType);
return CreateFromCorType(elementType.AppDomain, res);
ICorDebugType res = this.AppDomain.CorAppDomain.CastTo<ICorDebugAppDomain2>().GetArrayOrPointerType((uint)CorElementType.SZARRAY, 1, this.CorType);
return CreateFromCorType(this.AppDomain, res);
}
public override Type MakePointerType()
{
ICorDebugType res = elementType.AppDomain.CorAppDomain.CastTo<ICorDebugAppDomain2>().GetArrayOrPointerType((uint)CorElementType.PTR, 0, elementType.CorType);
return CreateFromCorType(elementType.AppDomain, res);
ICorDebugType res = this.AppDomain.CorAppDomain.CastTo<ICorDebugAppDomain2>().GetArrayOrPointerType((uint)CorElementType.PTR, 0, this.CorType);
return CreateFromCorType(this.AppDomain, res);
}
public override Type MakeByRefType()
{
ICorDebugType res = elementType.AppDomain.CorAppDomain.CastTo<ICorDebugAppDomain2>().GetArrayOrPointerType((uint)CorElementType.BYREF, 0, elementType.CorType);
return CreateFromCorType(elementType.AppDomain, res);
ICorDebugType res = this.AppDomain.CorAppDomain.CastTo<ICorDebugAppDomain2>().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 @@ -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 @@ -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 @@ -1069,7 +1065,7 @@ namespace Debugger.MetaData
// Collect data
Dictionary<string, MethodInfo> accessors = new Dictionary<string, MethodInfo>();
Dictionary<string, object> propertyNames = new Dictionary<string, object>();
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 @@ -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 @@ -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;
}

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Object.cs

@ -251,7 +251,7 @@ namespace Debugger @@ -251,7 +251,7 @@ namespace Debugger
return this.GetPropertyValue((PropertyInfo)memberInfo);
}
}
currentType = currentType.BaseType;
currentType = (DebugType)currentType.BaseType;
}
return null;
}

Loading…
Cancel
Save