From 34a6fb2cd1b5d8675df1b9314a5f15bbc004b523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Wed, 10 Jan 2007 18:22:37 +0000 Subject: [PATCH] Debugger tests: Store various states to XML and compare with previous results git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2274 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Debugger.Core.csproj | 3 + .../Project/Src/Breakpoints/Breakpoint.cs | 2 + .../Project/Src/Debugger/DebugeeState.cs | 1 + .../Src/Debugger/Internal/ManagedCallback.cs | 1 + .../Project/Src/Modules/Module.cs | 6 + .../Project/Src/Tests/IgnoreAttribute.cs | 17 + .../Project/Src/Tests/SummaryOnlyAttribute.cs | 17 + .../Project/Src/Threads/Exception.cs | 1 + .../Project/Src/Threads/Function.cs | 7 +- .../Project/Src/Threads/ProcessEventArgs.cs | 3 +- .../Project/Src/Threads/SourcecodeSegment.cs | 5 + .../Project/Src/Threads/Stepper.cs | 1 + .../Project/Src/Threads/Thread.cs | 27 +- .../Project/Src/Threads/ThreadEventArgs.cs | 1 + .../Project/Src/Variables/Evals/Eval.cs | 1 + .../Project/Src/Variables/Types/DebugType.cs | 6 + .../Project/Src/Variables/Types/FieldInfo.cs | 1 + .../Project/Src/Variables/Types/MemberInfo.cs | 4 + .../Project/Src/Variables/Types/MethodInfo.cs | 1 + .../Src/Variables/Types/PropertyInfo.cs | 1 + .../Project/Src/Variables/Values/Value.cs | 2 + .../Project/Debugger.Tests.csproj | 25 +- .../Project/Src/DebuggerTests.cs | 367 +++-------- .../Project/Src/DebuggerTestsBase.cs | 275 ++++++++ .../Debugger.Tests/Project/Src/TestProgram.cs | 43 -- .../Project/Src/TestPrograms/ArrayValue.xml | 114 ++++ .../Project/Src/TestPrograms/Break.xml | 10 + .../Project/Src/TestPrograms/Breakpoint.xml | 31 + .../Project/Src/TestPrograms/Callstack.xml | 303 +++++++++ .../Src/TestPrograms/DebuggeeKilled.xml | 14 + .../FunctionArgumentVariables.xml | 589 ++++++++++++++++++ .../Src/TestPrograms/FunctionLifetime.xml | 340 ++++++++++ .../TestPrograms/FunctionLocalVariables.xml | 133 ++++ .../FunctionVariablesLifetime.xml | 414 ++++++++++++ .../Project/Src/TestPrograms/HelloWorld.xml | 13 + .../Project/Src/TestPrograms/ObjectValue.xml | 215 +++++++ .../Project/Src/TestPrograms/SetIP.xml | 17 + .../Src/TestPrograms/SimpleProgram.xml | 9 + .../Project/Src/TestPrograms/Stepping.xml | 449 +++++++++++++ 39 files changed, 3117 insertions(+), 352 deletions(-) create mode 100644 src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/IgnoreAttribute.cs create mode 100644 src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/SummaryOnlyAttribute.cs create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs delete mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestProgram.cs create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Break.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Breakpoint.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Callstack.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebuggeeKilled.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionArgumentVariables.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLifetime.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLocalVariables.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/HelloWorld.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SetIP.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SimpleProgram.xml create mode 100644 src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Stepping.xml diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj index 6b4312a176..264d053a29 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj @@ -201,6 +201,8 @@ + + @@ -395,6 +397,7 @@ + diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Breakpoints/Breakpoint.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Breakpoints/Breakpoint.cs index 6b2d718fce..729fd1c556 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Breakpoints/Breakpoint.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Breakpoints/Breakpoint.cs @@ -20,12 +20,14 @@ namespace Debugger bool enabled = true; ICorDebugFunctionBreakpoint corBreakpoint; + [Debugger.Tests.Ignore] public NDebugger Debugger { get { return debugger; } } + [Debugger.Tests.SummaryOnly] public SourcecodeSegment SourcecodeSegment { get { return sourcecodeSegment; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebugeeState.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebugeeState.cs index c55d2edb95..c0b29c8552 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebugeeState.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebugeeState.cs @@ -29,6 +29,7 @@ namespace Debugger } } + [Debugger.Tests.Ignore] public Process Process { get { return process; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs index 0c25f275c2..65f18be043 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs @@ -26,6 +26,7 @@ namespace Debugger Process process; bool pauseProcessInsteadOfContinue; + [Debugger.Tests.Ignore] public Process Process { get { return process; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs index 22da5547b3..1d6bd0631c 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs @@ -24,6 +24,7 @@ namespace Debugger ISymUnmanagedReader symReader; MetaData metaData; + [Debugger.Tests.Ignore] public Process Process { get { return process; @@ -147,5 +148,10 @@ namespace Debugger unloaded = true; } + + public override string ToString() + { + return string.Format("{0}", this.Filename); + } } } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/IgnoreAttribute.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/IgnoreAttribute.cs new file mode 100644 index 0000000000..3df7eb152f --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/IgnoreAttribute.cs @@ -0,0 +1,17 @@ +// +// +// +// +// $Revision$ +// + +using System; + +namespace Debugger.Tests +{ + [AttributeUsage(AttributeTargets.Property)] + public class IgnoreAttribute: Attribute + { + + } +} diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/SummaryOnlyAttribute.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/SummaryOnlyAttribute.cs new file mode 100644 index 0000000000..2e0222652a --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/SummaryOnlyAttribute.cs @@ -0,0 +1,17 @@ +// +// +// +// +// $Revision$ +// + +using System; + +namespace Debugger.Tests +{ + [AttributeUsage(AttributeTargets.Property)] + public class SummaryOnlyAttribute: Attribute + { + + } +} diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Exception.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Exception.cs index 5d35e3776e..a35b448476 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Exception.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Exception.cs @@ -22,6 +22,7 @@ namespace Debugger string type; string message; + [Debugger.Tests.Ignore] public Process Process { get { return process; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs index ba8305dbd2..1a61475333 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs @@ -37,6 +37,7 @@ namespace Debugger MethodProps methodProps; /// The process in which this function is executed + [Debugger.Tests.Ignore] public Process Process { get { return process; @@ -51,6 +52,7 @@ namespace Debugger } /// Metadata token of the function + [Debugger.Tests.Ignore] public uint Token { get { return methodProps.Token; @@ -58,13 +60,15 @@ namespace Debugger } /// A module in which the function is defined - public Module Module { + [Debugger.Tests.SummaryOnly] + public Module Module { get { return module; } } /// A thread in which the function is executed + [Debugger.Tests.Ignore] public Thread Thread { get { return thread; @@ -379,6 +383,7 @@ namespace Debugger /// Gets all variables in the lexical scope of the function. /// That is, arguments, local variables and varables of the containing class. /// + [Debugger.Tests.Ignore] // Accessible though others public NamedValueCollection Variables { get { return new NamedValueCollection(GetVariables()); diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ProcessEventArgs.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ProcessEventArgs.cs index 1ae5bfc2ea..b3e5296f21 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ProcessEventArgs.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ProcessEventArgs.cs @@ -13,7 +13,8 @@ namespace Debugger public class ProcessEventArgs: DebuggerEventArgs { Process process; - + + [Debugger.Tests.Ignore] public Process Process { get { return process; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/SourcecodeSegment.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/SourcecodeSegment.cs index 5a2134d4d2..e06111a40e 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/SourcecodeSegment.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/SourcecodeSegment.cs @@ -203,5 +203,10 @@ namespace Debugger ilOffset = (int)symMethod.GetOffset(symDoc, validLine, 0); return true; } + + public override string ToString() + { + return string.Format("Start={0},{1} End={2},{3}", this.startLine, this.startColumn, this.endLine, this.endColumn); + } } } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Stepper.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Stepper.cs index 71e66cc707..53453b961f 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Stepper.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Stepper.cs @@ -23,6 +23,7 @@ namespace Debugger public event EventHandler StepComplete; + [Debugger.Tests.Ignore] public Process Process { get { return function.Process; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs index d4711dacc8..57c663eb9b 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs @@ -45,6 +45,7 @@ namespace Debugger } } + [Debugger.Tests.Ignore] public Process Process { get { return process; @@ -60,13 +61,15 @@ namespace Debugger OnStateChanged(); } } - + + [Debugger.Tests.Ignore] public uint ID { get{ return id; } } + [Debugger.Tests.Ignore] public ExceptionType CurrentExceptionType { get { return currentExceptionType; @@ -82,7 +85,7 @@ namespace Debugger } } - public ICorDebugThread CorThread { + internal ICorDebugThread CorThread { get { if (nativeThreadExited) { throw new DebuggerException("Native thread has exited"); @@ -169,9 +172,9 @@ namespace Debugger ); } } - + public string Name { - get { + get { if (!HasBeenLoaded) return lastName; if (process.IsRunning) return lastName; Value runtimeValue = RuntimeValue; @@ -238,7 +241,13 @@ namespace Debugger } } - public IEnumerable Callstack { + public IList Callstack { + get { + return new List(CallstackEnum).AsReadOnly(); + } + } + + IEnumerable CallstackEnum { get { process.AssertPaused(); @@ -348,6 +357,7 @@ namespace Debugger } } + [Debugger.Tests.SummaryOnly] public Function SelectedFunction { get { return selectedFunction; @@ -361,9 +371,10 @@ namespace Debugger } } + [Debugger.Tests.SummaryOnly] public Function LastFunctionWithLoadedSymbols { get { - foreach (Function function in Callstack) { + foreach (Function function in CallstackEnum) { if (function.HasSymbols) { return function; } @@ -376,9 +387,10 @@ namespace Debugger /// Returns the most recent function on callstack. /// Returns null if callstack is empty. /// + [Debugger.Tests.SummaryOnly] public Function LastFunction { get { - foreach(Function function in Callstack) { + foreach(Function function in CallstackEnum) { return function; } return null; @@ -388,6 +400,7 @@ namespace Debugger /// /// Returns the first function that was called on thread /// + [Debugger.Tests.SummaryOnly] public Function FirstFunction { get { Function first = null; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ThreadEventArgs.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ThreadEventArgs.cs index ba7e22214e..9b320a073e 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ThreadEventArgs.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ThreadEventArgs.cs @@ -14,6 +14,7 @@ namespace Debugger { Thread thread; + [Debugger.Tests.Ignore] public Thread Thread { get { return thread; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs index 44a8fd3304..6f945f8bce 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs @@ -37,6 +37,7 @@ namespace Debugger ICorDebugEval corEval; string errorMsg; + [Debugger.Tests.Ignore] public Process Process { get { return process; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/DebugType.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/DebugType.cs index 1778d8ea0d..c25d2248e2 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/DebugType.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/DebugType.cs @@ -48,6 +48,7 @@ namespace Debugger } /// Gets the process in which the type was loaded + [Debugger.Tests.Ignore] public Process Process { get { return process; @@ -421,5 +422,10 @@ namespace Debugger { return base.GetHashCode(); } + + public override string ToString() + { + return string.Format("{0}", this.fullName); + } } } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/FieldInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/FieldInfo.cs index dcf8e8c40e..6a7e8df828 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/FieldInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/FieldInfo.cs @@ -48,6 +48,7 @@ namespace Debugger } /// Gets the metadata token associated with this field + [Debugger.Tests.Ignore] public override uint MetadataToken { get { return fieldProps.Token; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MemberInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MemberInfo.cs index 9f4b3007e8..9347b51443 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MemberInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MemberInfo.cs @@ -21,6 +21,7 @@ namespace Debugger DebugType declaringType; /// Gets the process in which the type was loaded + [Debugger.Tests.Ignore] public Process Process { get { return declaringType.Process; @@ -28,6 +29,7 @@ namespace Debugger } /// Gets the type that declares this member element + [Debugger.Tests.SummaryOnly] public DebugType DeclaringType { get { return declaringType; @@ -44,12 +46,14 @@ namespace Debugger public abstract bool IsStatic { get; } /// Gets the metadata token associated with this member + [Debugger.Tests.Ignore] public abstract uint MetadataToken { get; } /// Gets the name of this member public abstract string Name { get; } /// Gets the module in which this member is defined + [Debugger.Tests.SummaryOnly] public Module Module { get { return declaringType.Module; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MethodInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MethodInfo.cs index 0e0131b79f..db33ba26d8 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MethodInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MethodInfo.cs @@ -50,6 +50,7 @@ namespace Debugger } /// Gets the metadata token associated with this method + [Debugger.Tests.Ignore] public override uint MetadataToken { get { return methodProps.Token; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/PropertyInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/PropertyInfo.cs index a89f637e44..53dc448ab8 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/PropertyInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/PropertyInfo.cs @@ -43,6 +43,7 @@ namespace Debugger /// Gets the metadata token associated with getter (or setter) /// of this property + [Debugger.Tests.Ignore] public override uint MetadataToken { get { return (getMethod ?? setMethod).MetadataToken; diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.cs index aa4f2b65ab..536a813ce4 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.cs @@ -91,6 +91,7 @@ namespace Debugger } /// The process that owns the value + [Debugger.Tests.Ignore] public Process Process { get { return process; @@ -211,6 +212,7 @@ namespace Debugger } /// Returns the of the value + [Debugger.Tests.SummaryOnly] public DebugType Type { get { return Cache.Type; 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 079078fdec..34c34f201d 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj @@ -1,6 +1,6 @@  - WinExe + Library Debugger.Tests Debugger.Tests Debug @@ -20,7 +20,6 @@ 4194304 4096 true - Debugger.Tests.TestProgram DEBUG;TRACE @@ -40,25 +39,9 @@ - - - - - - - - - - - - - - - - - - - + + + diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs index 57f19b3b8e..7453ddf683 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs @@ -20,112 +20,28 @@ using System.Threading; namespace Debugger.Tests { - /// - /// This class contains methods that test the debugger - /// [TestFixture] - public class DebuggerTests + public class DebuggerTests: DebuggerTestsBase { - NDebugger debugger; - string assemblyFilename; - string assemblyDir; - string symbolsFilename; - - Process process; - string log; - string lastLogMessage; - - [TestFixtureSetUp] - public void TestFixtureSetUp() - { - assemblyFilename = Assembly.GetExecutingAssembly().Location; - assemblyDir = Path.GetDirectoryName(assemblyFilename); - symbolsFilename = Path.Combine(assemblyDir, Path.GetFileNameWithoutExtension(assemblyFilename) + ".pdb"); - - debugger = new NDebugger(); - debugger.MTA2STA.CallMethod = CallMethod.Manual; - } - - [TestFixtureTearDown] - public void TestFixtureTearDown() - { - - } - - [TearDown] - public void TearDown() - { - while(debugger.Processes.Count > 0) { - debugger.Processes[0].Terminate(); - debugger.Processes[0].WaitForExit(); - } - } - - void StartProgram(string programName) - { - StartProgram(assemblyFilename, programName); - } - - void StartProgram(string exeFilename, string programName) - { - log = ""; - lastLogMessage = null; - process = debugger.Start(exeFilename, Path.GetDirectoryName(exeFilename), programName); - process.LogMessage += delegate(object sender, MessageEventArgs e) { - log += e.Message; - lastLogMessage = e.Message; - }; - } - - void WaitForPause(PausedReason expectedReason) - { - process.WaitForPause(); - Assert.AreEqual(true, process.IsPaused); - Assert.AreEqual(expectedReason, process.PausedReason); - } - - void WaitForPause(PausedReason expectedReason, string expectedLastLogMessage) - { - WaitForPause(expectedReason); - if (expectedLastLogMessage != null) expectedLastLogMessage += "\r\n"; - Assert.AreEqual(expectedLastLogMessage, lastLogMessage); - } - - [Test] public void SimpleProgram() { - StartProgram("SimpleProgram"); + StartTest("SimpleProgram"); process.WaitForExit(); } [Test] public void HelloWorld() { - StartProgram("HelloWorld"); + StartTest("HelloWorld"); process.WaitForExit(); - Assert.AreEqual("Hello world!\r\n", log); } [Test] public void Break() { - StartProgram("Break"); - WaitForPause(PausedReason.Break, null); - - process.Continue(); - process.WaitForExit(); - } - - [Test] - public void Symbols() - { - Assert.AreEqual("debugger.tests.exe", Path.GetFileName(assemblyFilename).ToLower()); - Assert.IsTrue(File.Exists(symbolsFilename), "Symbols file not found (.pdb)"); - - StartProgram("Symbols"); + StartTest("Break"); WaitForPause(PausedReason.Break, null); - Assert.AreEqual(true, process.GetModule(Path.GetFileName(assemblyFilename)).SymbolsLoaded, "Module symbols not loaded"); process.Continue(); process.WaitForExit(); @@ -134,13 +50,12 @@ namespace Debugger.Tests [Test] public void Breakpoint() { - Breakpoint b = debugger.AddBreakpoint(@"F:\SharpDevelopTrunk\src\AddIns\Misc\Debugger\Debugger.Tests\Project\Src\TestPrograms\Breakpoint.cs", 18); + Breakpoint breakpoint = debugger.AddBreakpoint(@"F:\SharpDevelopTrunk\src\AddIns\Misc\Debugger\Debugger.Tests\Project\Src\TestPrograms\Breakpoint.cs", 18); - StartProgram("Breakpoint"); + StartTest("Breakpoint"); WaitForPause(PausedReason.Break, null); - Assert.AreEqual(true, b.Enabled); - Assert.AreEqual(true, b.HadBeenSet, "Breakpoint is not set"); - Assert.AreEqual(18, b.SourcecodeSegment.StartLine); + + ObjectDump(breakpoint); process.Continue(); WaitForPause(PausedReason.Breakpoint, "Mark 1"); @@ -150,83 +65,65 @@ namespace Debugger.Tests process.Continue(); process.WaitForExit(); - Assert.AreEqual("Mark 1\r\nMark 2\r\n", log); - } - - [Test] - public void FileRelease() - { - Assert.IsTrue(File.Exists(assemblyFilename), "Assembly file not found"); - Assert.IsTrue(File.Exists(symbolsFilename), "Symbols file not found (.pdb)"); - - string tempPath = Path.Combine(Path.GetTempPath(), Path.Combine("DebeggerTest", new Random().Next().ToString())); - Directory.CreateDirectory(tempPath); - - string newAssemblyFilename = Path.Combine(tempPath, Path.GetFileName(assemblyFilename)); - string newSymbolsFilename = Path.Combine(tempPath, Path.GetFileName(symbolsFilename)); - - File.Copy(assemblyFilename, newAssemblyFilename); - File.Copy(symbolsFilename, newSymbolsFilename); - - Assert.IsTrue(File.Exists(newAssemblyFilename), "Assembly file copying failed"); - Assert.IsTrue(File.Exists(newSymbolsFilename), "Symbols file copying failed"); - - StartProgram(newAssemblyFilename, "FileRelease"); - process.WaitForExit(); - - try { - File.Delete(newAssemblyFilename); - } catch (System.Exception e) { - Assert.Fail("Assembly file not released\n" + e.ToString()); - } - try { - File.Delete(newSymbolsFilename); - } catch (System.Exception e) { - Assert.Fail("Symbols file not released\n" + e.ToString()); - } + ObjectDump(breakpoint); } - [Test] - public void DebuggeeKilled() - { - StartProgram("DebuggeeKilled"); - WaitForPause(PausedReason.Break); - Assert.AreNotEqual(null, lastLogMessage); - System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(int.Parse(lastLogMessage)); - p.Kill(); - process.WaitForExit(); - } +// [Test] +// public void FileRelease() +// { +// +// } + +// [Test] +// public void DebuggeeKilled() +// { +// StartTest("DebuggeeKilled"); +// WaitForPause(PausedReason.Break); +// Assert.AreNotEqual(null, lastLogMessage); +// System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(int.Parse(lastLogMessage)); +// p.Kill(); +// process.WaitForExit(); +// } [Test] public void Stepping() { - StartProgram("Stepping"); + StartTest("Stepping"); WaitForPause(PausedReason.Break, null); + ObjectDump("SelectedFunction", process.SelectedFunction); process.StepOver(); // Debugger.Break WaitForPause(PausedReason.StepComplete, null); + ObjectDump("SelectedFunction", process.SelectedFunction); process.StepOver(); // Debug.WriteLine 1 WaitForPause(PausedReason.StepComplete, "1"); + ObjectDump("SelectedFunction", process.SelectedFunction); process.StepInto(); // Method Sub WaitForPause(PausedReason.StepComplete, "1"); + ObjectDump("SelectedFunction", process.SelectedFunction); process.StepInto(); // '{' WaitForPause(PausedReason.StepComplete, "1"); + ObjectDump("SelectedFunction", process.SelectedFunction); process.StepInto(); // Debug.WriteLine 2 WaitForPause(PausedReason.StepComplete, "2"); + ObjectDump("SelectedFunction", process.SelectedFunction); process.StepOut(); // Method Sub WaitForPause(PausedReason.StepComplete, "4"); + ObjectDump("SelectedFunction", process.SelectedFunction); process.StepOver(); // Method Sub WaitForPause(PausedReason.StepComplete, "4"); + ObjectDump("SelectedFunction", process.SelectedFunction); process.StepOver(); // Method Sub2 WaitForPause(PausedReason.StepComplete, "5"); + ObjectDump("SelectedFunction", process.SelectedFunction); process.Continue(); process.WaitForExit(); @@ -235,25 +132,17 @@ namespace Debugger.Tests [Test] public void Callstack() { - List callstack; - - StartProgram("Callstack"); + StartTest("Callstack"); WaitForPause(PausedReason.Break, null); - callstack = new List(process.SelectedThread.Callstack); - Assert.AreEqual("Sub2", callstack[0].Name); - Assert.AreEqual("Sub1", callstack[1].Name); - Assert.AreEqual("Main", callstack[2].Name); + ObjectDump("Callstack", process.SelectedThread.Callstack); process.StepOut(); WaitForPause(PausedReason.StepComplete, null); - callstack = new List(process.SelectedThread.Callstack); - Assert.AreEqual("Sub1", callstack[0].Name); - Assert.AreEqual("Main", callstack[1].Name); + ObjectDump("Callstack", process.SelectedThread.Callstack); process.StepOut(); WaitForPause(PausedReason.StepComplete, null); - callstack = new List(process.SelectedThread.Callstack); - Assert.AreEqual("Main", callstack[0].Name); + ObjectDump("Callstack", process.SelectedThread.Callstack); process.Continue(); process.WaitForExit(); @@ -262,46 +151,13 @@ namespace Debugger.Tests [Test] public void FunctionArgumentVariables() { - StartProgram("FunctionArgumentVariables"); + StartTest("FunctionArgumentVariables"); WaitForPause(PausedReason.Break, null); - for(int i = 0; i < 2; i++) { - NamedValueCollection args; - + for(int i = 0; i < 6; i++) { process.Continue(); WaitForPause(PausedReason.Break, null); - args = process.SelectedFunction.Arguments; - NamedValue args_i = args["i"]; - NamedValue args_s = args["s"]; - NamedValue args_args = args["args"]; - // names - Assert.AreEqual("i", args_i.Name); - Assert.AreEqual("s", args_s.Name); - Assert.AreEqual("args", args_args.Name); - // types - Assert.IsTrue(args_i.IsPrimitive); - Assert.IsTrue(args_s.IsPrimitive); - Assert.IsTrue(args_args.IsArray); - // values - Assert.AreEqual("0", args_i.AsString); - Assert.AreEqual("S", args_s.AsString); - Assert.AreEqual(0, args_args.ArrayLenght); - - process.Continue(); - WaitForPause(PausedReason.Break, null); - args = process.SelectedFunction.Arguments; - // values - Assert.AreEqual("1", args["i"].AsString); - Assert.AreEqual("S", args["s"].AsString); - Assert.AreEqual(1, args["args"].ArrayLenght); - - process.Continue(); - WaitForPause(PausedReason.Break, null); - args = process.SelectedFunction.Arguments; - // values - Assert.AreEqual("2", args["i"].AsString); - Assert.IsTrue(args["s"].IsNull); - Assert.AreEqual(2, args["args"].ArrayLenght); + ObjectDump("SelectedFunction", process.SelectedFunction); } process.Continue(); @@ -311,21 +167,9 @@ namespace Debugger.Tests [Test] public void FunctionLocalVariables() { - StartProgram("FunctionLocalVariables"); + StartTest("FunctionLocalVariables"); WaitForPause(PausedReason.Break, null); - NamedValueCollection vars = process.SelectedFunction.LocalVariables; - // types - Assert.IsTrue(vars["i"].IsPrimitive); - Assert.IsTrue(vars["s"].IsPrimitive); - Assert.IsTrue(vars["args"].IsArray); - Assert.IsTrue(vars["n"].IsNull); - Assert.IsTrue(vars["o"].IsObject); - // values - Assert.AreEqual("0", vars["i"].AsString); - Assert.AreEqual("S", vars["s"].AsString); - Assert.AreEqual(1, vars["args"].ArrayLenght); - Assert.IsTrue(vars["n"].IsNull); - Assert.AreEqual("{System.Object}", vars["o"].AsString); + ObjectDump("SelectedFunction", process.SelectedFunction); process.Continue(); process.WaitForExit(); @@ -336,30 +180,25 @@ namespace Debugger.Tests { Function function; - StartProgram("FunctionLifetime"); + StartTest("FunctionLifetime"); WaitForPause(PausedReason.Break, null); function = process.SelectedFunction; - Assert.IsNotNull(function); - Assert.AreEqual("Function", function.Name); - Assert.AreEqual(false, function.HasExpired); - Assert.AreEqual("1", function.GetArgument(0).AsString); + ObjectDump("Function", function); process.Continue(); // Go to the SubFunction WaitForPause(PausedReason.Break, null); - Assert.AreEqual("SubFunction", process.SelectedFunction.Name); - Assert.AreEqual(false, function.HasExpired); - Assert.AreEqual("1", function.GetArgument(0).AsString); + ObjectDump("Function", function); + ObjectDump("SubFunction", process.SelectedFunction); process.Continue(); // Go back to Function WaitForPause(PausedReason.Break, null); - Assert.AreEqual("Function", process.SelectedFunction.Name); - Assert.AreEqual(false, function.HasExpired); - Assert.AreEqual("1", function.GetArgument(0).AsString); + Assert.AreEqual(function, process.SelectedFunction); + ObjectDump("Function", function); process.Continue(); // Setp out of function WaitForPause(PausedReason.Break, null); - Assert.AreEqual("Main", process.SelectedFunction.Name); - Assert.AreEqual(true, function.HasExpired); + ObjectDump("Main", process.SelectedFunction); + ObjectDump("Function", function); process.Continue(); process.WaitForExit(); @@ -368,63 +207,50 @@ namespace Debugger.Tests [Test] public void FunctionVariablesLifetime() { - Function function = null; NamedValue argument = null; NamedValue local = null; NamedValue localInSubFunction = null; NamedValue @class = null; - StartProgram("FunctionVariablesLifetime"); // 1 - Enter program + StartTest("FunctionVariablesLifetime"); // 1 - Enter program WaitForPause(PausedReason.Break, null); - function = process.SelectedFunction; - Assert.IsNotNull(function); - Assert.AreEqual("Function", function.Name); - argument = function.GetArgument(0); - local = function.LocalVariables["local"]; - @class = function.ContaingClassVariables["class"]; - Assert.IsNotNull(argument); - Assert.IsNotNull(local); - Assert.IsNotNull(@class); - Assert.AreEqual("argument", argument.Name); - Assert.AreEqual("local", local.Name); - Assert.AreEqual("class", @class.Name); - Assert.AreEqual("1", argument.AsString); - Assert.AreEqual("2", local.AsString); - Assert.AreEqual("3", @class.AsString); + argument = process.SelectedFunction.GetArgument(0); + local = process.SelectedFunction.LocalVariables["local"]; + @class = process.SelectedFunction.ContaingClassVariables["class"]; + ObjectDump("argument", argument); + ObjectDump("local", local); + ObjectDump("@class", @class); process.Continue(); // 2 - Go to the SubFunction WaitForPause(PausedReason.Break, null); - Assert.AreEqual("1", argument.AsString); - Assert.AreEqual("2", local.AsString); - Assert.AreEqual("3", @class.AsString); - // Check localInSubFunction variable localInSubFunction = process.SelectedFunction.LocalVariables["localInSubFunction"]; - Assert.AreEqual("4", localInSubFunction.AsString); + ObjectDump("argument", argument); + ObjectDump("local", local); + ObjectDump("@class", @class); + ObjectDump("localInSubFunction", @localInSubFunction); process.Continue(); // 3 - Go back to Function WaitForPause(PausedReason.Break, null); - Assert.AreEqual("1", argument.AsString); - Assert.AreEqual("2", local.AsString); - Assert.AreEqual("3", @class.AsString); - // localInSubFunction should be dead now - Assert.IsTrue(localInSubFunction.HasExpired); + ObjectDump("argument", argument); + ObjectDump("local", local); + ObjectDump("@class", @class); + ObjectDump("localInSubFunction", @localInSubFunction); process.Continue(); // 4 - Go to the SubFunction WaitForPause(PausedReason.Break, null); - Assert.AreEqual("1", argument.AsString); - Assert.AreEqual("2", local.AsString); - Assert.AreEqual("3", @class.AsString); - // localInSubFunction should be still dead... - Assert.IsTrue(localInSubFunction.HasExpired); - // ... , but we should able to get new one + ObjectDump("argument", argument); + ObjectDump("local", local); + ObjectDump("@class", @class); + ObjectDump("localInSubFunction", @localInSubFunction); localInSubFunction = process.SelectedFunction.LocalVariables["localInSubFunction"]; - Assert.AreEqual("4", localInSubFunction.AsString); + ObjectDump("localInSubFunction(new)", @localInSubFunction); process.Continue(); // 5 - Setp out of both functions WaitForPause(PausedReason.Break, null); - Assert.IsTrue(argument.HasExpired); - Assert.IsTrue(local.HasExpired); - Assert.IsTrue(@class.HasExpired); + ObjectDump("argument", argument); + ObjectDump("local", local); + ObjectDump("@class", @class); + ObjectDump("localInSubFunction", @localInSubFunction); process.Continue(); process.WaitForExit(); @@ -433,18 +259,11 @@ namespace Debugger.Tests [Test] public void ArrayValue() { - StartProgram("ArrayValue"); + StartTest("ArrayValue"); WaitForPause(PausedReason.Break, null); NamedValue array = process.SelectedFunction.LocalVariables["array"]; - Assert.AreEqual("array", array.Name); - Assert.IsTrue(array.IsArray); - Assert.AreEqual("{System.Int32[]}", array.AsString); - NamedValueCollection elements = array.GetArrayElements(); - Assert.AreEqual(5, elements.Count); - for(int i = 0; i < 5; i++) { - Assert.AreEqual("[" + i.ToString() + "]", elements[i].Name); - Assert.AreEqual(i.ToString(), elements[i].AsString); - } + ObjectDump("array", array); + ObjectDump("array elements", array.GetArrayElements()); process.Continue(); process.WaitForExit(); @@ -453,29 +272,19 @@ namespace Debugger.Tests [Test] public void ObjectValue() { - NamedValue local = null; + NamedValue val = null; - StartProgram("ObjectValue"); + StartTest("ObjectValue"); WaitForPause(PausedReason.Break, null); - local = process.SelectedFunction.LocalVariables["val"]; - Assert.AreEqual("val", local.Name); - Assert.IsTrue(local.IsObject); - Assert.AreEqual("{Debugger.Tests.TestPrograms.ObjectValue}", local.AsString); - Assert.AreEqual("Debugger.Tests.TestPrograms.ObjectValue", local.Type.FullName); - NamedValueCollection subVars = local.GetMembers(null, Debugger.BindingFlags.All); - Assert.IsTrue(subVars["privateField"].IsPrimitive); - Assert.IsTrue(subVars["publicFiled"].IsPrimitive); - Assert.IsTrue(subVars["PublicProperty"].IsPrimitive); - Assert.IsTrue(((MemberValue)subVars["privateField"]).MemberInfo.IsPrivate); - Assert.IsTrue(((MemberValue)subVars["publicFiled"]).MemberInfo.IsPublic); - Assert.IsTrue(((MemberValue)subVars["PublicProperty"]).MemberInfo.IsPublic); - DebugType baseClass = local.Type.BaseType; - Assert.AreEqual("Debugger.Tests.TestPrograms.BaseClass", baseClass.FullName); - Assert.AreEqual("private", subVars["privateField"].AsString); + val = process.SelectedFunction.LocalVariables["val"]; + ObjectDump("val", val); + ObjectDump("val members", val.GetMembers(null, Debugger.BindingFlags.All)); + //ObjectDump("typeof(val)", val.Type); process.Continue(); WaitForPause(PausedReason.Break, null); - Assert.AreEqual("new private", subVars["privateField"].AsString); + ObjectDump("val", val); + ObjectDump("val members", val.GetMembers(null, Debugger.BindingFlags.All)); process.Continue(); process.WaitForExit(); @@ -555,7 +364,7 @@ namespace Debugger.Tests [Test] public void SetIP() { - StartProgram("SetIP"); + StartTest("SetIP"); WaitForPause(PausedReason.Break, "1"); Assert.IsNotNull(process.SelectedFunction.CanSetIP("SetIP.cs", 16, 0)); diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs new file mode 100644 index 0000000000..34f09b531f --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs @@ -0,0 +1,275 @@ +// +// +// +// +// $Revision$ +// + +using Microsoft.CSharp; +using System; +using System.CodeDom.Compiler; +using System.Collections; +using System.IO; +using System.Security.Cryptography; +using System.Text; +using System.Reflection; +using System.Xml; + +using NUnit.Framework; + +using Debugger; +using Debugger.Interop; + +namespace Debugger.Tests +{ + public class DebuggerTestsBase + { + protected NDebugger debugger; + protected Process process; + protected string log; + protected string lastLogMessage; + protected string testName; + protected XmlDocument testDoc; + protected XmlElement testNode; + protected XmlElement snapshotNode; + protected int shapshotID; + + [TestFixtureSetUp] + public virtual void TestFixtureSetUp() + { + debugger = new NDebugger(); + debugger.MTA2STA.CallMethod = CallMethod.Manual; + } + + [TestFixtureTearDown] + public virtual void TestFixtureTearDown() + { + + } + + [SetUp] + public virtual void SetUp() + { + testName = null; + + testDoc = new XmlDocument(); + testDoc.AppendChild(testDoc.CreateXmlDeclaration("1.0","utf-8",null)); + testDoc.AppendChild(testDoc.CreateElement("DebuggerTests")); + testNode = testDoc.CreateElement("Test"); + testDoc.DocumentElement.AppendChild(testNode); + } + + [TearDown] + public virtual void TearDown() + { + while(debugger.Processes.Count > 0) { + debugger.Processes[0].Terminate(); + debugger.Processes[0].WaitForExit(); + } + string path = Path.GetTempPath(); + path = Path.Combine(path, "SharpDevelop"); + path = Path.Combine(path, "DebuggerTestResults"); + Directory.CreateDirectory(path); + testDoc.Save(Path.Combine(path, testName + ".xml")); + + string oldXml = GetResource(testName + ".xml"); + MemoryStream newXmlStream = new MemoryStream(); + testDoc.Save(newXmlStream); + newXmlStream.Seek(0, SeekOrigin.Begin); + string newXml = new StreamReader(newXmlStream).ReadToEnd(); + Assert.AreEqual(oldXml, newXml); + } + + protected void StartTest(string testName) + { + this.testName = testName; + string exeFilename = CompileTest(testName); + + testNode.SetAttribute("name", testName); + shapshotID = 0; + + log = ""; + lastLogMessage = null; + process = debugger.Start(exeFilename, Path.GetDirectoryName(exeFilename), testName); + process.LogMessage += delegate(object sender, MessageEventArgs e) { + log += e.Message; + lastLogMessage = e.Message; + LogEvent("LogMessage", e.Message.Replace("\r",@"\r").Replace("\n",@"\n")); + }; + process.ModuleLoaded += delegate(object sender, ModuleEventArgs e) { + LogEvent("ModuleLoaded", e.Module.Filename).SetAttribute("symbols", e.Module.SymbolsLoaded.ToString()); + }; + process.DebuggingPaused += delegate(object sender, ProcessEventArgs e) { + LogEvent("DebuggingPaused", e.Process.PausedReason.ToString()); + }; +// process.DebuggingResumed += delegate(object sender, ProcessEventArgs e) { +// LogEvent("DebuggingResumed", e.Process.PausedReason.ToString()); +// }; + process.Expired += delegate(object sender, EventArgs e) { + LogEvent("ProcessExited", null); + }; + + LogEvent("ProcessStarted", null); + } + + protected XmlElement LogEvent(string name, string content) + { + XmlElement eventNode = testDoc.CreateElement(name); + if (content != null) { + eventNode.AppendChild(testDoc.CreateTextNode(content)); + } + testNode.AppendChild(eventNode); + return eventNode; + } + + protected void WaitForPause(PausedReason expectedReason) + { + process.WaitForPause(); + Assert.AreEqual(true, process.IsPaused); + Assert.AreEqual(expectedReason, process.PausedReason); + } + + protected void WaitForPause(PausedReason expectedReason, string expectedLastLogMessage) + { + WaitForPause(expectedReason); + if (expectedLastLogMessage != null) expectedLastLogMessage += "\r\n"; + Assert.AreEqual(expectedLastLogMessage, lastLogMessage); + +// snapshotNode = testDoc.CreateElement("Snapshot"); +// snapshotNode.SetAttribute("id", (shapshotID++).ToString()); +// testNode.AppendChild(snapshotNode); + } + + public void ObjectDump(object obj) + { + ObjectDump(null, obj); + } + + public void ObjectDump(string name, object obj) + { + XmlElement dumpNode = testDoc.CreateElement("ObjectDump"); + if (name != null) dumpNode.SetAttribute("name", name); + testNode.AppendChild(dumpNode); + Serialize(dumpNode, obj); + } + + static bool ShouldExpandType(Type type) + { + return type.IsSubclassOf(typeof(DebuggerObject)) || + ( typeof(IEnumerable).IsAssignableFrom(type) && + type.Namespace != "System" + ); + } + + public static void Serialize(XmlNode parent, object obj) + { + XmlDocument doc = parent.OwnerDocument; + + if (obj == null) { + parent.AppendChild(doc.CreateElement("Null")); + return; + } + + Type type = obj.GetType(); + + XmlElement objectRoot = doc.CreateElement(XmlConvert.EncodeName(type.Name)); + parent.AppendChild(objectRoot); + + if (!ShouldExpandType(type)) { + objectRoot.AppendChild(doc.CreateTextNode(obj.ToString())); + return; + } + + foreach(System.Reflection.PropertyInfo property in type.GetProperties()) { + if (property.GetGetMethod().GetParameters().Length > 0) continue; + if (property.GetCustomAttributes(typeof(Debugger.Tests.IgnoreAttribute), true).Length > 0) continue; + + XmlElement propertyNode = doc.CreateElement(property.Name); + objectRoot.AppendChild(propertyNode); + + object val; + try { + val = property.GetValue(obj, new object[] {}); + } catch (System.Exception e) { + while(e.InnerException != null) e = e.InnerException; + propertyNode.SetAttribute("exception", e.Message); + continue; + } + if (val == null) { + propertyNode.AppendChild(doc.CreateTextNode("null")); + } else if (!ShouldExpandType(val.GetType()) || property.GetCustomAttributes(typeof(Debugger.Tests.SummaryOnlyAttribute), true).Length > 0) { + // Only write ToString() text + propertyNode.AppendChild(doc.CreateTextNode(val.ToString())); + } else { + Serialize(propertyNode, val); + } + } + + // Save all objects of an enumerable object + if (obj is IEnumerable) { + XmlElement enumRoot = doc.CreateElement("Items"); + objectRoot.AppendChild(enumRoot); + foreach(object enumObject in (IEnumerable)obj) { + Serialize(enumRoot, enumObject); + } + } + } + + string GetResource(string filename) + { + string resourcePrefix = "Debugger.Tests.Src.TestPrograms."; + + Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourcePrefix + filename); + if (stream == null) throw new System.Exception("Resource " + filename + " not found"); + return new StreamReader(stream).ReadToEnd(); + } + + string CompileTest(string testName) + { + string code = GetResource(testName + ".cs"); + + string md5 = ToHexadecimal(new MD5CryptoServiceProvider().ComputeHash(Encoding.UTF8.GetBytes(code))); + + string path = Path.GetTempPath(); + path = Path.Combine(path, "SharpDevelop"); + path = Path.Combine(path, "DebuggerTests"); + path = Path.Combine(path, md5); + Directory.CreateDirectory(path); + + string codeFilename = Path.Combine(path, testName + ".cs"); + string exeFilename = Path.Combine(path, testName + ".exe"); + + StreamWriter file = new StreamWriter(codeFilename); + file.Write(code); + file.Close(); + + CompilerParameters compParams = new CompilerParameters(); + compParams.GenerateExecutable = true; + compParams.GenerateInMemory = false; + compParams.TreatWarningsAsErrors = false; + compParams.IncludeDebugInformation = true; + compParams.ReferencedAssemblies.Add("System.dll"); + compParams.OutputAssembly = exeFilename; + + CSharpCodeProvider compiler = new CSharpCodeProvider(); + CompilerResults result = compiler.CompileAssemblyFromFile(compParams, codeFilename); + + if (result.Errors.Count > 0) { + throw new System.Exception("There was an error(s) during compilation of test program:\n" + result.Errors[0].ToString()); + } + + return exeFilename; + } + + static string ToHexadecimal(byte[] bytes) + { + char[] chars = new char[] {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F',}; + string hex = ""; + foreach(byte b in bytes) { + hex += chars[b >> 4]; + hex += chars[b & 0x0F]; + } + return hex; + } + } +} diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestProgram.cs b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestProgram.cs deleted file mode 100644 index 143e8df779..0000000000 --- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestProgram.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// -// -// -// $Revision$ -// - -using System; - -using Progs = Debugger.Tests.TestPrograms; - -namespace Debugger.Tests -{ - public class TestProgram - { - public static void Main(string[] args) - { - if (args.Length == 0) { - return; - } - switch (args[0]) { - case "ArrayValue": Progs.ArrayValue.Main(); break; - case "Break": Progs.Break.Main(); break; - case "Breakpoint": Progs.Breakpoint.Main(); break; - case "Callstack": Progs.Callstack.Main(); break; - case "DebuggeeKilled": Progs.DebuggeeKilled.Main(); break; - case "FileRelease": Progs.FileRelease.Main(); break; - case "FunctionArgumentVariables": Progs.FunctionArgumentVariables.Main(); break; - case "FunctionLifetime": Progs.FunctionLifetime.Main(); break; - case "FunctionLocalVariables": Progs.FunctionLocalVariables.Main(); break; - case "FunctionVariablesLifetime": Progs.FunctionVariablesLifetime.Main(); break; - case "HelloWorld": Progs.HelloWorld.Main(); break; - case "ObjectValue": Progs.ObjectValue.Main(); break; - case "PropertyVariable": Progs.PropertyVariable.Main(); break; - case "PropertyVariableForm": Progs.PropertyVariableForm.Main(); break; - case "SetIP": Progs.SetIP.Main(); break; - case "SimpleProgram": Progs.SimpleProgram.Main(); break; - case "Stepping": Progs.Stepping.Main(); break; - case "Symbols": Progs.Symbols.Main(); break; - } - } - } -} diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.xml new file mode 100644 index 0000000000..84293ef3e9 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.xml @@ -0,0 +1,114 @@ + + + + + mscorlib.dll + ArrayValue.exe + Break + + + array + True + 5 + 1 + System.UInt32[] + False + {System.Int32[]} + False + False + False + + False + System.Int32[] + + + + + 5 + + + System.UInt32[] + [0] + False + + + + False + 0 + False + True + True + 0 + False + System.Int32 + + + System.UInt32[] + [1] + False + + + + False + 1 + False + True + True + 1 + False + System.Int32 + + + System.UInt32[] + [2] + False + + + + False + 2 + False + True + True + 2 + False + System.Int32 + + + System.UInt32[] + [3] + False + + + + False + 3 + False + True + True + 3 + False + System.Int32 + + + System.UInt32[] + [4] + False + + + + False + 4 + False + True + True + 4 + False + System.Int32 + + + + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Break.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Break.xml new file mode 100644 index 0000000000..4293c0711e --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Break.xml @@ -0,0 +1,10 @@ + + + + + mscorlib.dll + Break.exe + Break + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Breakpoint.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Breakpoint.xml new file mode 100644 index 0000000000..77cb0d7e66 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Breakpoint.xml @@ -0,0 +1,31 @@ + + + + + mscorlib.dll + Breakpoint.exe + System.dll + Break + + + Start=18,0 End=18,0 + True + True + + + System.Configuration.dll + System.Xml.dll + Mark 1\r\n + Breakpoint + Mark 2\r\n + Break + + + + Start=18,0 End=18,0 + False + True + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Callstack.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Callstack.xml new file mode 100644 index 0000000000..f6b7dfd865 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Callstack.xml @@ -0,0 +1,303 @@ + + + + + mscorlib.dll + Callstack.exe + Break + + + 3 + + + Sub2 + Callstack.exe + True + True + False + Start=26,4 End=26,40 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + Sub1 + Callstack.exe + True + True + False + Start=21,4 End=21,11 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + Main + Callstack.exe + True + True + False + Start=16,4 End=16,11 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + + + StepComplete + + + 2 + + + Sub1 + Callstack.exe + True + True + False + Start=21,4 End=21,11 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + Main + Callstack.exe + True + True + False + Start=16,4 End=16,11 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + + + StepComplete + + + 1 + + + Main + Callstack.exe + True + True + False + Start=16,4 End=16,11 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebuggeeKilled.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebuggeeKilled.xml new file mode 100644 index 0000000000..f3ae4346cf --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebuggeeKilled.xml @@ -0,0 +1,14 @@ + + + + + mscorlib.dll + DebuggeeKilled.exe + System.dll + System.Configuration.dll + System.Xml.dll + 2268\r\n + Break + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionArgumentVariables.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionArgumentVariables.xml new file mode 100644 index 0000000000..5af53d7e87 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionArgumentVariables.xml @@ -0,0 +1,589 @@ + + + + + mscorlib.dll + FunctionArgumentVariables.exe + Break + Break + + + StaticFunction + FunctionArgumentVariables.exe + True + True + False + Start=28,4 End=28,40 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 3 + + + 3 + + + 0 + i + False + + + + False + 0 + False + True + True + 0 + False + System.Int32 + + + 1 + s + False + + + + False + S + False + True + False + S + False + System.String + + + 2 + args + True + 0 + 1 + System.UInt32[] + False + {System.String[]} + False + False + False + + False + System.String[] + + + + + + + 0 + + + + + + Break + + + StaticFunction + FunctionArgumentVariables.exe + True + True + False + Start=28,4 End=28,40 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 3 + + + 3 + + + 0 + i + False + + + + False + 1 + False + True + True + 1 + False + System.Int32 + + + 1 + s + False + + + + False + S + False + True + False + S + False + System.String + + + 2 + args + True + 1 + 1 + System.UInt32[] + False + {System.String[]} + False + False + False + + False + System.String[] + + + + + + + 0 + + + + + + Break + + + StaticFunction + FunctionArgumentVariables.exe + True + True + False + Start=28,4 End=28,40 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 3 + + + 3 + + + 0 + i + False + + + + False + 2 + False + True + True + 2 + False + System.Int32 + + + 1 + s + False + + + + True + <null> + False + False + False + + False + System.String + + + 2 + args + True + 2 + 1 + System.UInt32[] + False + {System.String[]} + False + False + False + + False + System.String[] + + + + + + + 0 + + + + + + Break + + + Function + FunctionArgumentVariables.exe + False + True + False + Start=33,4 End=33,40 + + + this + False + + + + False + {Debugger.Tests.TestPrograms.FunctionArgumentVariables} + True + False + False + + False + Debugger.Tests.TestPrograms.FunctionArgumentVariables + + + + + 0 + + + + 3 + + + 3 + + + 0 + i + False + + + + False + 0 + False + True + True + 0 + False + System.Int32 + + + 1 + s + False + + + + False + S + False + True + False + S + False + System.String + + + 2 + args + True + 0 + 1 + System.UInt32[] + False + {System.String[]} + False + False + False + + False + System.String[] + + + + + + + 0 + + + + + + Break + + + Function + FunctionArgumentVariables.exe + False + True + False + Start=33,4 End=33,40 + + + this + False + + + + False + {Debugger.Tests.TestPrograms.FunctionArgumentVariables} + True + False + False + + False + Debugger.Tests.TestPrograms.FunctionArgumentVariables + + + + + 0 + + + + 3 + + + 3 + + + 0 + i + False + + + + False + 1 + False + True + True + 1 + False + System.Int32 + + + 1 + s + False + + + + False + S + False + True + False + S + False + System.String + + + 2 + args + True + 1 + 1 + System.UInt32[] + False + {System.String[]} + False + False + False + + False + System.String[] + + + + + + + 0 + + + + + + Break + + + Function + FunctionArgumentVariables.exe + False + True + False + Start=33,4 End=33,40 + + + this + False + + + + False + {Debugger.Tests.TestPrograms.FunctionArgumentVariables} + True + False + False + + False + Debugger.Tests.TestPrograms.FunctionArgumentVariables + + + + + 0 + + + + 3 + + + 3 + + + 0 + i + False + + + + False + 2 + False + True + True + 2 + False + System.Int32 + + + 1 + s + False + + + + True + <null> + False + False + False + + False + System.String + + + 2 + args + True + 2 + 1 + System.UInt32[] + False + {System.String[]} + False + False + False + + False + System.String[] + + + + + + + 0 + + + + + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLifetime.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLifetime.xml new file mode 100644 index 0000000000..5c71e1f100 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLifetime.xml @@ -0,0 +1,340 @@ + + + + + mscorlib.dll + FunctionLifetime.exe + Break + + + Function + FunctionLifetime.exe + True + True + False + Start=22,4 End=22,40 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 1 + + + 1 + + + 0 + i + False + + + + False + 1 + False + True + True + 1 + False + System.Int32 + + + + + + + 0 + + + + + + Break + + + Function + FunctionLifetime.exe + True + True + False + Start=23,4 End=23,18 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 1 + + + 1 + + + 0 + i + False + + + + False + 1 + False + True + True + 1 + False + System.Int32 + + + + + + + 0 + + + + + + + + SubFunction + FunctionLifetime.exe + True + True + False + Start=29,4 End=29,40 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + Break + + + Function + FunctionLifetime.exe + True + True + False + Start=24,4 End=24,40 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 1 + + + 1 + + + 0 + i + False + + + + False + 1 + False + True + True + 1 + False + System.Int32 + + + + + + + 0 + + + + + + Break + + + Main + FunctionLifetime.exe + True + True + False + Start=17,4 End=17,40 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + + + Function + FunctionLifetime.exe + True + True + True + + + + this + + + + + + + + + + + True + + + + + + 0 + + + + + + + + 0 + + + + + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLocalVariables.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLocalVariables.xml new file mode 100644 index 0000000000..c7a7555a78 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLocalVariables.xml @@ -0,0 +1,133 @@ + + + + + mscorlib.dll + FunctionLocalVariables.exe + Break + + + Main + FunctionLocalVariables.exe + True + True + False + Start=23,4 End=23,40 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 5 + + + i + False + + + + False + 0 + False + True + True + 0 + False + System.Int32 + + + s + False + + + + False + S + False + True + False + S + False + System.String + + + args + True + 1 + 1 + System.UInt32[] + False + {System.String[]} + False + False + False + + False + System.String[] + + + n + False + + + + True + <null> + False + False + False + + False + System.Object + + + o + False + + + + False + {System.Object} + True + False + False + + False + System.Object + + + + + + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.xml new file mode 100644 index 0000000000..6834ee0691 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.xml @@ -0,0 +1,414 @@ + + + + + mscorlib.dll + FunctionVariablesLifetime.exe + Break + + + 0 + argument + False + + + + False + 1 + False + True + True + 1 + False + System.Int32 + + + + + local + False + + + + False + 2 + False + True + True + 2 + False + System.Int32 + + + + + + + False + False + True + False + class + Debugger.Tests.TestPrograms.FunctionVariablesLifetime + FunctionVariablesLifetime.exe + + + class + False + + + + False + 3 + False + True + True + 3 + False + System.Int32 + + + Break + + + 0 + argument + False + + + + False + 1 + False + True + True + 1 + False + System.Int32 + + + + + local + False + + + + False + 2 + False + True + True + 2 + False + System.Int32 + + + + + + + False + False + True + False + class + Debugger.Tests.TestPrograms.FunctionVariablesLifetime + FunctionVariablesLifetime.exe + + + class + False + + + + False + 3 + False + True + True + 3 + False + System.Int32 + + + + + localInSubFunction + False + + + + False + 4 + False + True + True + 4 + False + System.Int32 + + + Break + + + 0 + argument + False + + + + False + 1 + False + True + True + 1 + False + System.Int32 + + + + + local + False + + + + False + 2 + False + True + True + 2 + False + System.Int32 + + + + + + + False + False + True + False + class + Debugger.Tests.TestPrograms.FunctionVariablesLifetime + FunctionVariablesLifetime.exe + + + class + False + + + + False + 3 + False + True + True + 3 + False + System.Int32 + + + + + localInSubFunction + + + + + + + + + + + True + + + + Break + + + 0 + argument + False + + + + False + 1 + False + True + True + 1 + False + System.Int32 + + + + + local + False + + + + False + 2 + False + True + True + 2 + False + System.Int32 + + + + + + + False + False + True + False + class + Debugger.Tests.TestPrograms.FunctionVariablesLifetime + FunctionVariablesLifetime.exe + + + class + False + + + + False + 3 + False + True + True + 3 + False + System.Int32 + + + + + localInSubFunction + + + + + + + + + + + True + + + + + + localInSubFunction + False + + + + False + 4 + False + True + True + 4 + False + System.Int32 + + + Break + + + 0 + argument + + + + + + + + + + + True + + + + + + local + + + + + + + + + + + True + + + + + + + + False + False + True + False + class + Debugger.Tests.TestPrograms.FunctionVariablesLifetime + FunctionVariablesLifetime.exe + + + class + + + + + + + + + + + True + + + + + + localInSubFunction + + + + + + + + + + + True + + + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/HelloWorld.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/HelloWorld.xml new file mode 100644 index 0000000000..a97a62d505 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/HelloWorld.xml @@ -0,0 +1,13 @@ + + + + + mscorlib.dll + HelloWorld.exe + System.dll + System.Configuration.dll + System.Xml.dll + Hello world!\r\n + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.xml new file mode 100644 index 0000000000..637fa85aa7 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.xml @@ -0,0 +1,215 @@ + + + + + mscorlib.dll + ObjectValue.exe + Break + + + val + False + + + + False + {Debugger.Tests.TestPrograms.ObjectValue} + True + False + False + + False + Debugger.Tests.TestPrograms.ObjectValue + + + EvalComplete + + + 3 + + + + + False + True + False + False + privateField + Debugger.Tests.TestPrograms.ObjectValue + ObjectValue.exe + + + privateField + False + + + + False + private + False + True + False + private + False + System.String + + + + + False + False + True + False + publicFiled + Debugger.Tests.TestPrograms.ObjectValue + ObjectValue.exe + + + publicFiled + False + + + + False + public + False + True + False + public + False + System.String + + + + + False + True + False + PublicProperty + Debugger.Tests.TestPrograms.ObjectValue + ObjectValue.exe + + + PublicProperty + False + + + + False + private + False + True + False + private + False + System.String + + + + + Break + + + val + False + + + + False + {Debugger.Tests.TestPrograms.ObjectValue} + True + False + False + + False + Debugger.Tests.TestPrograms.ObjectValue + + + EvalComplete + + + 3 + + + + + False + True + False + False + privateField + Debugger.Tests.TestPrograms.ObjectValue + ObjectValue.exe + + + privateField + False + + + + False + new private + False + True + False + new private + False + System.String + + + + + False + False + True + False + publicFiled + Debugger.Tests.TestPrograms.ObjectValue + ObjectValue.exe + + + publicFiled + False + + + + False + public + False + True + False + public + False + System.String + + + + + False + True + False + PublicProperty + Debugger.Tests.TestPrograms.ObjectValue + ObjectValue.exe + + + PublicProperty + False + + + + False + new private + False + True + False + new private + False + System.String + + + + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SetIP.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SetIP.xml new file mode 100644 index 0000000000..507b05bc44 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SetIP.xml @@ -0,0 +1,17 @@ + + + + + mscorlib.dll + SetIP.exe + System.dll + System.Configuration.dll + System.Xml.dll + 1\r\n + Break + SetIP + 1\r\n + Break + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SimpleProgram.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SimpleProgram.xml new file mode 100644 index 0000000000..080f7f0a94 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SimpleProgram.xml @@ -0,0 +1,9 @@ + + + + + mscorlib.dll + SimpleProgram.exe + + + \ No newline at end of file diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Stepping.xml b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Stepping.xml new file mode 100644 index 0000000000..bcc6ef3208 --- /dev/null +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Stepping.xml @@ -0,0 +1,449 @@ + + + + + mscorlib.dll + Stepping.exe + System.dll + Break + + + Main + Stepping.exe + True + True + False + Start=16,4 End=16,40 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + StepComplete + + + Main + Stepping.exe + True + True + False + Start=17,4 End=17,44 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + System.Configuration.dll + System.Xml.dll + 1\r\n + StepComplete + + + Main + Stepping.exe + True + True + False + Start=18,4 End=18,10 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + StepComplete + + + Sub + Stepping.exe + True + True + False + Start=23,3 End=23,4 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + StepComplete + + + Sub + Stepping.exe + True + True + False + Start=24,4 End=24,44 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + 2\r\n + StepComplete + + + Sub + Stepping.exe + True + True + False + Start=25,4 End=25,44 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + 3\r\n + 4\r\n + StepComplete + + + Main + Stepping.exe + True + True + False + Start=18,4 End=18,10 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + StepComplete + + + Main + Stepping.exe + True + True + False + Start=19,4 End=19,11 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + 5\r\n + StepComplete + + + Main + Stepping.exe + True + True + False + Start=20,3 End=20,4 + + + this + + + + + True + + + False + False + False + + False + null + + + + + 0 + + + + 0 + + + 0 + + + + + + 0 + + + + + + + + \ No newline at end of file