diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj index b6afcaed0e..5d0af4e05a 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj @@ -8,7 +8,7 @@ {A4C858C8-51B6-4265-A695-A20FCEBA1D19} ..\..\..\..\..\..\bin\UnitTests\ False - False + True False False AnyCPU @@ -47,6 +47,7 @@ + diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs index 6b34d90027..009bfa290b 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs @@ -328,6 +328,7 @@ namespace Debugger.Tests compParams.IncludeDebugInformation = true; compParams.ReferencedAssemblies.Add("System.dll"); compParams.OutputAssembly = exeFilename; + compParams.CompilerOptions = "/unsafe"; compParams.ReferencedAssemblies.Add(typeof(TestFixtureAttribute).Assembly.Location); CSharpCodeProvider compiler = new CSharpCodeProvider(); diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebugTypes.cs b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebugTypes.cs new file mode 100644 index 0000000000..1e903733a5 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebugTypes.cs @@ -0,0 +1,921 @@ +// +// +// +// +// $Revision$ +// + +using System; + +namespace Debugger.Tests.TestPrograms +{ + public class DebugTypes + { + public struct Point { + int x; + int y; + } + + public static unsafe void Main() + { + 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; + + System.Diagnostics.Debugger.Break(); + + Fun(loc, ref locByRef, locPtr, ref locPtrByRef, + locPtrPtr, locVoidPtr, + locObj, ref locObjByRef, + locSZArray, locArray, + locStruct, ref locStruct, locStructPtr); + } + + 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) + { + System.Diagnostics.Debugger.Break(); + } + } +} + +#if TEST_CODE +namespace Debugger.Tests { + public partial class DebuggerTests + { + [NUnit.Framework.Test] + public void DebugTypes() + { + ExpandProperties( + "Value.Type", + "DebubType.BaseType" + ); + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Break + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#endif // EXPECTED_OUTPUT \ No newline at end of file