Browse Source

Fix DebugType.IsEnum (always returned false due to undocumented breaking change in .NET 4.5).

Fixed debugger IDStringProvider for single-dimensional arrays.
Ignore unit that needs adjustment after Siegfried's recent debugger changes.
pull/18/head
Daniel Grunwald 14 years ago
parent
commit
83a7ae5f69
  1. 10
      src/AddIns/Debugger/Debugger.Core/IDStringProvider.cs
  2. 7
      src/AddIns/Debugger/Debugger.Core/MetaData/DebugType.cs
  3. 1
      src/AddIns/Debugger/Debugger.Tests/Tests/DebugType_Tests.cs

10
src/AddIns/Debugger/Debugger.Core/IDStringProvider.cs

@ -78,10 +78,12 @@ namespace Debugger @@ -78,10 +78,12 @@ namespace Debugger
AppendTypeName(b, type.GetElementType());
if (type.IsArray) {
b.Append('[');
for (int i = 0; i < type.GetArrayRank(); i++) {
if (i > 0)
b.Append(',');
b.Append("0:");
if (type.GetArrayRank() > 1) {
for (int i = 0; i < type.GetArrayRank(); i++) {
if (i > 0)
b.Append(',');
b.Append("0:");
}
}
b.Append(']');
}

7
src/AddIns/Debugger/Debugger.Core/MetaData/DebugType.cs

@ -727,6 +727,13 @@ namespace Debugger.MetaData @@ -727,6 +727,13 @@ namespace Debugger.MetaData
this.IsSubclassOf(DebugType.CreateFromType(this.AppDomain.Mscorlib, typeof(ValueType)));
}
/// <inheritdoc/>
public override bool IsEnum {
get {
return this.BaseType == DebugType.CreateFromType(this.AppDomain.Mscorlib, typeof(Enum));
}
}
/// <inheritdoc/>
public override bool IsSubclassOf(Type superType)
{

1
src/AddIns/Debugger/Debugger.Tests/Tests/DebugType_Tests.cs

@ -218,6 +218,7 @@ namespace Debugger.Tests { @@ -218,6 +218,7 @@ namespace Debugger.Tests {
}
[NUnit.Framework.Test]
[NUnit.Framework.Ignore("Broken after Siegfried added the IsGeneric implementation; can't adjust test easily as I'm on .NET 4.5")]
public void DebugType_Tests()
{
if (IsDotnet45Installed())

Loading…
Cancel
Save