Browse Source

Compare object types by module paths rather then modules instances - one module can be loaded multiple times (for appdomains)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2917 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
6efba61ccd
  1. 5
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs
  2. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs

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

@ -210,7 +210,10 @@ namespace Debugger @@ -210,7 +210,10 @@ namespace Debugger
throw new GetValueException("Can not evaluate on a value which is not an object");
}
if (!method.DeclaringType.IsInstanceOfType(thisValue)) {
throw new GetValueException("Can not evaluate because the object is not of proper type");
throw new GetValueException(
"Can not evaluate because the object is not of proper type. " +
"Expected: " + method.DeclaringType.FullName + " Seen: " + thisValue.Type.FullName
);
}
corArgs.Add(thisValue.SoftReference);
}

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

@ -421,7 +421,9 @@ namespace Debugger.MetaData @@ -421,7 +421,9 @@ namespace Debugger.MetaData
}
if (this.IsClass || this.IsValueType) {
return (other.IsClass || other.IsValueType) &&
other.Module == this.Module &&
// Test fullpath since module can be loaded multiple times to different appdomains
// eg during unit testing
other.Module.FullPath == this.Module.FullPath &&
other.MetadataToken == this.MetadataToken;
}
throw new DebuggerException("Unknown type");

Loading…
Cancel
Save