Browse Source

Fixed "Value does not fall within the expected range." that occurred while getting base type for Object or Pointers

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3203 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 17 years ago
parent
commit
dbe1eb1c3f
  1. 7
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs
  2. 750
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebugTypes.cs

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

@ -293,6 +293,10 @@ namespace Debugger.MetaData @@ -293,6 +293,10 @@ namespace Debugger.MetaData
/// </summary>
public DebugType BaseType {
get {
// corType.Base *sometimes* does not work for object and can cause "Value does not fall within the expected range." exception
if (this.FullName == "System.Object") {
return null;
}
// corType.Base does not work for arrays
if (this.IsArray) {
return DebugType.Create(this.Process, AppDomainID, "System.Array");
@ -301,6 +305,9 @@ namespace Debugger.MetaData @@ -301,6 +305,9 @@ namespace Debugger.MetaData
if (this.IsPrimitive) {
return DebugType.Create(this.Process, AppDomainID, "System.Object");
}
if (this.IsPointer || this.IsVoid) {
return null;
}
ICorDebugType baseType = corType.Base;
if (baseType != null) {
return Create(process, baseType);

750
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebugTypes.cs

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save