Browse Source

Missed one TypeSpec case

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4567 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 16 years ago
parent
commit
29622091dd
  1. 8
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs
  2. 91
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Expressions.cs

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

@ -462,12 +462,16 @@ namespace Debugger.MetaData @@ -462,12 +462,16 @@ namespace Debugger.MetaData
if (valueType == null) {
uint superClassToken = metaData.GetTypeDefProps(corClass.Token).SuperClassToken;
if ((superClassToken & 0xFF000000) == 0x02000000) { // TypeDef
CorTokenType tkType = (CorTokenType)(superClassToken & 0xFF000000);
if (tkType == CorTokenType.TypeDef) {
valueType = metaData.GetTypeDefProps(superClassToken).Name == typeof(ValueType).FullName;
}
if ((superClassToken & 0xFF000000) == 0x01000000) { // TypeRef
if (tkType == CorTokenType.TypeRef) {
valueType = metaData.GetTypeRefProps(superClassToken).Name == typeof(ValueType).FullName;
}
if (tkType == CorTokenType.TypeSpec) {
valueType = false; // TODO: Resolve properly
}
}
genericArguments = genericArguments ?? new DebugType[] {};

91
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Expressions.cs

@ -43,9 +43,20 @@ namespace Debugger.Tests.TestPrograms @@ -43,9 +43,20 @@ namespace Debugger.Tests.TestPrograms
int i = 0;
string[] array = {"one", "two", "three"};
string[,] array2 = {{"A","B"},{"C","D"}};
string BaseClass = "baseClassString";
System.Diagnostics.Debugger.Break();
}
public void Test(int arg)
{
}
public void Test(TestClass[] arg)
{
}
}
}
@ -61,6 +72,7 @@ namespace Debugger.Tests { @@ -61,6 +72,7 @@ namespace Debugger.Tests {
ObjectDump("Arguments", process.SelectedStackFrame.GetArgumentValues());
ObjectDump("LocalVariables", process.SelectedStackFrame.GetLocalVariableValues());
ObjectDump("this", process.SelectedStackFrame.GetThisValue().GetMemberValues());
ObjectDump("methods", process.SelectedStackFrame.MethodInfo.DeclaringType.GetMethods());
EndTest();
}
@ -76,7 +88,7 @@ namespace Debugger.Tests { @@ -76,7 +88,7 @@ namespace Debugger.Tests {
<ProcessStarted />
<ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>Expressions.exe (Has symbols)</ModuleLoaded>
<DebuggingPaused>Break Expressions.cs:47,4-47,40</DebuggingPaused>
<DebuggingPaused>Break Expressions.cs:48,4-48,40</DebuggingPaused>
<Arguments
Capacity="4"
Count="1">
@ -94,7 +106,7 @@ namespace Debugger.Tests { @@ -94,7 +106,7 @@ namespace Debugger.Tests {
</Arguments>
<LocalVariables
Capacity="4"
Count="3">
Count="4">
<Item>
<Value
ArrayDimensions="{Exception: Value is not an array}"
@ -127,6 +139,17 @@ namespace Debugger.Tests { @@ -127,6 +139,17 @@ namespace Debugger.Tests {
PrimitiveValue="{Exception: Value is not a primitive type}"
Type="System.String[,]" />
</Item>
<Item>
<Value
ArrayDimensions="{Exception: Value is not an array}"
ArrayLength="{Exception: Value is not an array}"
ArrayRank="{Exception: Value is not an array}"
AsString="baseClassString"
Expression="BaseClass"
IsReference="True"
PrimitiveValue="baseClassString"
Type="System.String" />
</Item>
</LocalVariables>
<this>
<Item>
@ -218,6 +241,70 @@ namespace Debugger.Tests { @@ -218,6 +241,70 @@ namespace Debugger.Tests {
Type="System.String" />
</Item>
</this>
<methods
Capacity="8"
Count="6">
<Item>
<MethodInfo
DeclaringType="Debugger.Tests.TestPrograms.TestClass"
FullName="Debugger.Tests.TestPrograms.TestClass.get_Name"
IsPublic="True"
IsSpecialName="True"
Module="Expressions.exe"
Name="get_Name"
ReturnType="System.String"
StepOver="True" />
</Item>
<Item>
<MethodInfo
DeclaringType="Debugger.Tests.TestPrograms.TestClass"
FullName="Debugger.Tests.TestPrograms.TestClass.Main"
IsPublic="True"
IsStatic="True"
Module="Expressions.exe"
Name="Main" />
</Item>
<Item>
<MethodInfo
DeclaringType="Debugger.Tests.TestPrograms.TestClass"
FullName="Debugger.Tests.TestPrograms.TestClass.Test"
IsPublic="True"
LocalVariableNames="{array, array2, BaseClass, i}"
Module="Expressions.exe"
Name="Test"
ParameterCount="1"
ParameterTypes="{System.String}" />
</Item>
<Item>
<MethodInfo
DeclaringType="Debugger.Tests.TestPrograms.TestClass"
FullName="Debugger.Tests.TestPrograms.TestClass.Test"
IsPublic="True"
Module="Expressions.exe"
Name="Test"
ParameterCount="1"
ParameterTypes="{System.Int32}" />
</Item>
<Item>
<MethodInfo
DeclaringType="Debugger.Tests.TestPrograms.TestClass"
FullName="Debugger.Tests.TestPrograms.TestClass.Test"
IsPublic="True"
Module="Expressions.exe"
Name="Test"
ParameterCount="1"
ParameterTypes="{Debugger.Tests.TestPrograms.TestClass[]}" />
</Item>
<Item>
<MethodInfo
DeclaringType="Debugger.Tests.TestPrograms.TestClass"
FullName="Debugger.Tests.TestPrograms.TestClass..ctor"
IsPublic="True"
IsSpecialName="True"
Module="Expressions.exe"
Name=".ctor" />
</Item>
</methods>
<ProcessExited />
</Test>
</DebuggerTests>

Loading…
Cancel
Save