//
//
//
//
// $Revision$
//
using System;
namespace Debugger.Tests.TestPrograms
{
public class DebugTypes
{
public class MyClass
{
}
public interface MyInterface
{
}
public class MyInterfaceImpl: MyInterface
{
}
public struct Point {
int x;
int y;
}
public static unsafe void Main()
{
// The nulls should be first to test for "Value does not fall within the expected range." exception of .BaseType
MyClass nullMyClass = null;
object nullObject = null;
string nullString = null;
object obj = new Object();
int loc = 42;
int locByRef = 43;
int* locPtr = &loc;
int* locPtrByRef = &loc;
int** locPtrPtr = &locPtr;
void* locVoidPtr = &loc;
object locObj = new object();
object locObjByRef = new object();
char[] locSZArray = "Test".ToCharArray();
char[,] locArray = new char[2,2];
Point locStruct;
Point* locStructPtr = &locStruct;
object box = 40;
MyInterfaceImpl myInterfaceImpl = new MyInterfaceImpl();
MyInterface myInterface = myInterfaceImpl;
System.Diagnostics.Debugger.Break();
Fun(loc, ref locByRef, locPtr, ref locPtrByRef,
locPtrPtr, locVoidPtr,
locObj, ref locObjByRef,
locSZArray, locArray,
locStruct, ref locStruct, locStructPtr,
box, ref box);
}
static unsafe void Fun(int arg, ref int argByRef, int* argPtr, ref int* argPtrByRef,
int** argPtrPtr, void* argVoidPtr,
object argObj, ref object argObjByRef,
char[] argSZArray, char[,] argArray,
Point argStruct, ref Point argStructByRef, Point* argStructPtr,
object argBox, ref object argBoxByRef)
{
System.Diagnostics.Debugger.Break();
}
}
}
#if TEST_CODE
namespace Debugger.Tests {
public partial class DebuggerTests
{
[NUnit.Framework.Test]
public void DebugTypes()
{
ExpandProperties(
"Value.Type",
"DebugType.ElementType"
);
StartTest("DebugTypes.cs");
ObjectDump("LocalVariables", process.SelectedStackFrame.GetLocalVariableValues());
process.Continue();
ObjectDump("Arguments", process.SelectedStackFrame.GetArgumentValues());
EndTest();
}
}
}
#endif
#if EXPECTED_OUTPUT
mscorlib.dll (No symbols)
DebugTypes.exe (Has symbols)
Break DebugTypes.cs:57,4-57,40
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
Break DebugTypes.cs:74,4-74,40
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
-
null
#endif // EXPECTED_OUTPUT