Browse Source

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
shortcuts
David Srbecký 19 years ago
parent
commit
34a6fb2cd1
  1. 3
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj
  2. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Breakpoints/Breakpoint.cs
  3. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebugeeState.cs
  4. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs
  5. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs
  6. 17
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/IgnoreAttribute.cs
  7. 17
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/SummaryOnlyAttribute.cs
  8. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Exception.cs
  9. 7
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs
  10. 3
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ProcessEventArgs.cs
  11. 5
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/SourcecodeSegment.cs
  12. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Stepper.cs
  13. 27
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs
  14. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ThreadEventArgs.cs
  15. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs
  16. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/DebugType.cs
  17. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/FieldInfo.cs
  18. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MemberInfo.cs
  19. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MethodInfo.cs
  20. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/PropertyInfo.cs
  21. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.cs
  22. 25
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj
  23. 367
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs
  24. 275
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs
  25. 43
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestProgram.cs
  26. 114
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.xml
  27. 10
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Break.xml
  28. 31
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Breakpoint.xml
  29. 303
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Callstack.xml
  30. 14
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebuggeeKilled.xml
  31. 589
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionArgumentVariables.xml
  32. 340
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLifetime.xml
  33. 133
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLocalVariables.xml
  34. 414
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.xml
  35. 13
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/HelloWorld.xml
  36. 215
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.xml
  37. 17
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SetIP.xml
  38. 9
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SimpleProgram.xml
  39. 449
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Stepping.xml

3
src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj

@ -201,6 +201,8 @@ @@ -201,6 +201,8 @@
<Compile Include="Src\Modules\Module.cs" />
<Compile Include="Src\Modules\ModuleEventArgs.cs" />
<Compile Include="Src\Modules\Process-Modules.cs" />
<Compile Include="Src\Tests\IgnoreAttribute.cs" />
<Compile Include="Src\Tests\SummaryOnlyAttribute.cs" />
<Compile Include="Src\Threads\Exception.cs" />
<Compile Include="Src\Threads\ExceptionType.cs" />
<Compile Include="Src\Threads\FrameID.cs" />
@ -395,6 +397,7 @@ @@ -395,6 +397,7 @@
<Folder Include="Src\Interop\Enums" />
<Folder Include="Src\Interop\MetaData" />
<Folder Include="Src\Modules" />
<Folder Include="Src\Tests" />
<Folder Include="Src\Threads" />
<Folder Include="Src\Util" />
<Folder Include="Src\Variables" />

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Breakpoints/Breakpoint.cs

@ -20,12 +20,14 @@ namespace Debugger @@ -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;

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebugeeState.cs

@ -29,6 +29,7 @@ namespace Debugger @@ -29,6 +29,7 @@ namespace Debugger
}
}
[Debugger.Tests.Ignore]
public Process Process {
get {
return process;

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs

@ -26,6 +26,7 @@ namespace Debugger @@ -26,6 +26,7 @@ namespace Debugger
Process process;
bool pauseProcessInsteadOfContinue;
[Debugger.Tests.Ignore]
public Process Process {
get {
return process;

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs

@ -24,6 +24,7 @@ namespace Debugger @@ -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 @@ -147,5 +148,10 @@ namespace Debugger
unloaded = true;
}
public override string ToString()
{
return string.Format("{0}", this.Filename);
}
}
}

17
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/IgnoreAttribute.cs

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
namespace Debugger.Tests
{
[AttributeUsage(AttributeTargets.Property)]
public class IgnoreAttribute: Attribute
{
}
}

17
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Tests/SummaryOnlyAttribute.cs

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
namespace Debugger.Tests
{
[AttributeUsage(AttributeTargets.Property)]
public class SummaryOnlyAttribute: Attribute
{
}
}

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Exception.cs

@ -22,6 +22,7 @@ namespace Debugger @@ -22,6 +22,7 @@ namespace Debugger
string type;
string message;
[Debugger.Tests.Ignore]
public Process Process {
get {
return process;

7
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs

@ -37,6 +37,7 @@ namespace Debugger @@ -37,6 +37,7 @@ namespace Debugger
MethodProps methodProps;
/// <summary> The process in which this function is executed </summary>
[Debugger.Tests.Ignore]
public Process Process {
get {
return process;
@ -51,6 +52,7 @@ namespace Debugger @@ -51,6 +52,7 @@ namespace Debugger
}
/// <summary> Metadata token of the function </summary>
[Debugger.Tests.Ignore]
public uint Token {
get {
return methodProps.Token;
@ -58,13 +60,15 @@ namespace Debugger @@ -58,13 +60,15 @@ namespace Debugger
}
/// <summary> A module in which the function is defined </summary>
public Module Module {
[Debugger.Tests.SummaryOnly]
public Module Module {
get {
return module;
}
}
/// <summary> A thread in which the function is executed </summary>
[Debugger.Tests.Ignore]
public Thread Thread {
get {
return thread;
@ -379,6 +383,7 @@ namespace Debugger @@ -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.
/// </summary>
[Debugger.Tests.Ignore] // Accessible though others
public NamedValueCollection Variables {
get {
return new NamedValueCollection(GetVariables());

3
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ProcessEventArgs.cs

@ -13,7 +13,8 @@ namespace Debugger @@ -13,7 +13,8 @@ namespace Debugger
public class ProcessEventArgs: DebuggerEventArgs
{
Process process;
[Debugger.Tests.Ignore]
public Process Process {
get {
return process;

5
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/SourcecodeSegment.cs

@ -203,5 +203,10 @@ namespace Debugger @@ -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);
}
}
}

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Stepper.cs

@ -23,6 +23,7 @@ namespace Debugger @@ -23,6 +23,7 @@ namespace Debugger
public event EventHandler<StepperEventArgs> StepComplete;
[Debugger.Tests.Ignore]
public Process Process {
get {
return function.Process;

27
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs

@ -45,6 +45,7 @@ namespace Debugger @@ -45,6 +45,7 @@ namespace Debugger
}
}
[Debugger.Tests.Ignore]
public Process Process {
get {
return process;
@ -60,13 +61,15 @@ namespace Debugger @@ -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 @@ -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 @@ -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 @@ -238,7 +241,13 @@ namespace Debugger
}
}
public IEnumerable<Function> Callstack {
public IList<Function> Callstack {
get {
return new List<Function>(CallstackEnum).AsReadOnly();
}
}
IEnumerable<Function> CallstackEnum {
get {
process.AssertPaused();
@ -348,6 +357,7 @@ namespace Debugger @@ -348,6 +357,7 @@ namespace Debugger
}
}
[Debugger.Tests.SummaryOnly]
public Function SelectedFunction {
get {
return selectedFunction;
@ -361,9 +371,10 @@ namespace Debugger @@ -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 @@ -376,9 +387,10 @@ namespace Debugger
/// Returns the most recent function on callstack.
/// Returns null if callstack is empty.
/// </summary>
[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 @@ -388,6 +400,7 @@ namespace Debugger
/// <summary>
/// Returns the first function that was called on thread
/// </summary>
[Debugger.Tests.SummaryOnly]
public Function FirstFunction {
get {
Function first = null;

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/ThreadEventArgs.cs

@ -14,6 +14,7 @@ namespace Debugger @@ -14,6 +14,7 @@ namespace Debugger
{
Thread thread;
[Debugger.Tests.Ignore]
public Thread Thread {
get {
return thread;

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs

@ -37,6 +37,7 @@ namespace Debugger @@ -37,6 +37,7 @@ namespace Debugger
ICorDebugEval corEval;
string errorMsg;
[Debugger.Tests.Ignore]
public Process Process {
get {
return process;

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/DebugType.cs

@ -48,6 +48,7 @@ namespace Debugger @@ -48,6 +48,7 @@ namespace Debugger
}
/// <summary> Gets the process in which the type was loaded </summary>
[Debugger.Tests.Ignore]
public Process Process {
get {
return process;
@ -421,5 +422,10 @@ namespace Debugger @@ -421,5 +422,10 @@ namespace Debugger
{
return base.GetHashCode();
}
public override string ToString()
{
return string.Format("{0}", this.fullName);
}
}
}

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/FieldInfo.cs

@ -48,6 +48,7 @@ namespace Debugger @@ -48,6 +48,7 @@ namespace Debugger
}
/// <summary> Gets the metadata token associated with this field </summary>
[Debugger.Tests.Ignore]
public override uint MetadataToken {
get {
return fieldProps.Token;

4
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MemberInfo.cs

@ -21,6 +21,7 @@ namespace Debugger @@ -21,6 +21,7 @@ namespace Debugger
DebugType declaringType;
/// <summary> Gets the process in which the type was loaded </summary>
[Debugger.Tests.Ignore]
public Process Process {
get {
return declaringType.Process;
@ -28,6 +29,7 @@ namespace Debugger @@ -28,6 +29,7 @@ namespace Debugger
}
/// <summary> Gets the type that declares this member element </summary>
[Debugger.Tests.SummaryOnly]
public DebugType DeclaringType {
get {
return declaringType;
@ -44,12 +46,14 @@ namespace Debugger @@ -44,12 +46,14 @@ namespace Debugger
public abstract bool IsStatic { get; }
/// <summary> Gets the metadata token associated with this member </summary>
[Debugger.Tests.Ignore]
public abstract uint MetadataToken { get; }
/// <summary> Gets the name of this member </summary>
public abstract string Name { get; }
/// <summary> Gets the module in which this member is defined </summary>
[Debugger.Tests.SummaryOnly]
public Module Module {
get {
return declaringType.Module;

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/MethodInfo.cs

@ -50,6 +50,7 @@ namespace Debugger @@ -50,6 +50,7 @@ namespace Debugger
}
/// <summary> Gets the metadata token associated with this method </summary>
[Debugger.Tests.Ignore]
public override uint MetadataToken {
get {
return methodProps.Token;

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Types/PropertyInfo.cs

@ -43,6 +43,7 @@ namespace Debugger @@ -43,6 +43,7 @@ namespace Debugger
/// <summary> Gets the metadata token associated with getter (or setter)
/// of this property </summary>
[Debugger.Tests.Ignore]
public override uint MetadataToken {
get {
return (getMethod ?? setMethod).MetadataToken;

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.cs

@ -91,6 +91,7 @@ namespace Debugger @@ -91,6 +91,7 @@ namespace Debugger
}
/// <summary> The process that owns the value </summary>
[Debugger.Tests.Ignore]
public Process Process {
get {
return process;
@ -211,6 +212,7 @@ namespace Debugger @@ -211,6 +212,7 @@ namespace Debugger
}
/// <summary> Returns the <see cref="Debugger.DebugType"/> of the value </summary>
[Debugger.Tests.SummaryOnly]
public DebugType Type {
get {
return Cache.Type;

25
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Library</OutputType>
<RootNamespace>Debugger.Tests</RootNamespace>
<AssemblyName>Debugger.Tests</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -20,7 +20,6 @@ @@ -20,7 +20,6 @@
<BaseAddress>4194304</BaseAddress>
<FileAlignment>4096</FileAlignment>
<DebugSymbols>true</DebugSymbols>
<StartupObject>Debugger.Tests.TestProgram</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineConstants>DEBUG;TRACE</DefineConstants>
@ -40,25 +39,9 @@ @@ -40,25 +39,9 @@
<ItemGroup>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\DebuggerTests.cs" />
<Compile Include="Src\TestPrograms\SimpleProgram.cs" />
<Compile Include="Src\TestProgram.cs" />
<Compile Include="Src\TestPrograms\HelloWorld.cs" />
<Compile Include="Src\TestPrograms\Breakpoint.cs" />
<Compile Include="Src\TestPrograms\Symbols.cs" />
<Compile Include="Src\TestPrograms\Break.cs" />
<Compile Include="Src\TestPrograms\FileRelease.cs" />
<Compile Include="Src\TestPrograms\Stepping.cs" />
<Compile Include="Src\TestPrograms\Callstack.cs" />
<Compile Include="Src\TestPrograms\FunctionArgumentVariables.cs" />
<Compile Include="Src\TestPrograms\FunctionLocalVariables.cs" />
<Compile Include="Src\TestPrograms\FunctionLifetime.cs" />
<Compile Include="Src\TestPrograms\FunctionVariablesLifetime.cs" />
<Compile Include="Src\TestPrograms\ObjectValue.cs" />
<Compile Include="Src\TestPrograms\PropertyVariable.cs" />
<Compile Include="Src\TestPrograms\PropertyVariableForm.cs" />
<Compile Include="Src\TestPrograms\SetIP.cs" />
<Compile Include="Src\TestPrograms\ArrayValue.cs" />
<Compile Include="Src\TestPrograms\DebuggeeKilled.cs" />
<Compile Include="Src\DebuggerTestsBase.cs" />
<EmbeddedResource Include="Src\TestPrograms\*.cs" />
<EmbeddedResource Include="Src\TestPrograms\*.xml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Src" />

367
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs

@ -20,112 +20,28 @@ using System.Threading; @@ -20,112 +20,28 @@ using System.Threading;
namespace Debugger.Tests
{
/// <summary>
/// This class contains methods that test the debugger
/// </summary>
[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 @@ -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 @@ -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 @@ -235,25 +132,17 @@ namespace Debugger.Tests
[Test]
public void Callstack()
{
List<Function> callstack;
StartProgram("Callstack");
StartTest("Callstack");
WaitForPause(PausedReason.Break, null);
callstack = new List<Function>(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<Function>(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<Function>(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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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));

275
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs

@ -0,0 +1,275 @@ @@ -0,0 +1,275 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
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;
}
}
}

43
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestProgram.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
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;
}
}
}
}

114
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.xml

@ -0,0 +1,114 @@ @@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="ArrayValue">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">ArrayValue.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="array">
<LocalVariable>
<Name>array</Name>
<IsArray>True</IsArray>
<ArrayLenght>5</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsNull>False</IsNull>
<AsString>{System.Int32[]}</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.Int32[]</Type>
</LocalVariable>
</ObjectDump>
<ObjectDump name="array elements">
<NamedValueCollection>
<Count>5</Count>
<Items>
<ArrayElement>
<Indicies>System.UInt32[]</Indicies>
<Name>[0]</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>0</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>0</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</ArrayElement>
<ArrayElement>
<Indicies>System.UInt32[]</Indicies>
<Name>[1]</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>1</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>1</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</ArrayElement>
<ArrayElement>
<Indicies>System.UInt32[]</Indicies>
<Name>[2]</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>2</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>2</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</ArrayElement>
<ArrayElement>
<Indicies>System.UInt32[]</Indicies>
<Name>[3]</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>3</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>3</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</ArrayElement>
<ArrayElement>
<Indicies>System.UInt32[]</Indicies>
<Name>[4]</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>4</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>4</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</ArrayElement>
</Items>
</NamedValueCollection>
</ObjectDump>
<ProcessExited />
</Test>
</DebuggerTests>

10
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Break.xml

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="Break">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">Break.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<ProcessExited />
</Test>
</DebuggerTests>

31
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Breakpoint.xml

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="Breakpoint">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">Breakpoint.exe</ModuleLoaded>
<ModuleLoaded symbols="False">System.dll</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump>
<Breakpoint>
<SourcecodeSegment>Start=18,0 End=18,0</SourcecodeSegment>
<HadBeenSet>True</HadBeenSet>
<Enabled>True</Enabled>
</Breakpoint>
</ObjectDump>
<ModuleLoaded symbols="False">System.Configuration.dll</ModuleLoaded>
<ModuleLoaded symbols="False">System.Xml.dll</ModuleLoaded>
<LogMessage>Mark 1\r\n</LogMessage>
<DebuggingPaused>Breakpoint</DebuggingPaused>
<LogMessage>Mark 2\r\n</LogMessage>
<DebuggingPaused>Break</DebuggingPaused>
<ProcessExited />
<ObjectDump>
<Breakpoint>
<SourcecodeSegment>Start=18,0 End=18,0</SourcecodeSegment>
<HadBeenSet>False</HadBeenSet>
<Enabled>True</Enabled>
</Breakpoint>
</ObjectDump>
</Test>
</DebuggerTests>

303
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Callstack.xml

@ -0,0 +1,303 @@ @@ -0,0 +1,303 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="Callstack">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">Callstack.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="Callstack">
<ReadOnlyCollection_x0060_1>
<Count>3</Count>
<Items>
<Function>
<Name>Sub2</Name>
<Module>Callstack.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=26,4 End=26,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
<Function>
<Name>Sub1</Name>
<Module>Callstack.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=21,4 End=21,11</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
<Function>
<Name>Main</Name>
<Module>Callstack.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=16,4 End=16,11</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</Items>
</ReadOnlyCollection_x0060_1>
</ObjectDump>
<DebuggingPaused>StepComplete</DebuggingPaused>
<ObjectDump name="Callstack">
<ReadOnlyCollection_x0060_1>
<Count>2</Count>
<Items>
<Function>
<Name>Sub1</Name>
<Module>Callstack.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=21,4 End=21,11</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
<Function>
<Name>Main</Name>
<Module>Callstack.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=16,4 End=16,11</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</Items>
</ReadOnlyCollection_x0060_1>
</ObjectDump>
<DebuggingPaused>StepComplete</DebuggingPaused>
<ObjectDump name="Callstack">
<ReadOnlyCollection_x0060_1>
<Count>1</Count>
<Items>
<Function>
<Name>Main</Name>
<Module>Callstack.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=16,4 End=16,11</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</Items>
</ReadOnlyCollection_x0060_1>
</ObjectDump>
<ProcessExited />
</Test>
</DebuggerTests>

14
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebuggeeKilled.xml

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="DebuggeeKilled">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">DebuggeeKilled.exe</ModuleLoaded>
<ModuleLoaded symbols="False">System.dll</ModuleLoaded>
<ModuleLoaded symbols="False">System.Configuration.dll</ModuleLoaded>
<ModuleLoaded symbols="False">System.Xml.dll</ModuleLoaded>
<LogMessage>2268\r\n</LogMessage>
<DebuggingPaused>Break</DebuggingPaused>
<ProcessExited />
</Test>
</DebuggerTests>

589
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionArgumentVariables.xml

@ -0,0 +1,589 @@ @@ -0,0 +1,589 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="FunctionArgumentVariables">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">FunctionArgumentVariables.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>StaticFunction</Name>
<Module>FunctionArgumentVariables.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=28,4 End=28,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>3</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>3</Count>
<Items>
<MethodArgument>
<Index>0</Index>
<Name>i</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>0</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>0</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
<MethodArgument>
<Index>1</Index>
<Name>s</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>S</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>S</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MethodArgument>
<MethodArgument>
<Index>2</Index>
<Name>args</Name>
<IsArray>True</IsArray>
<ArrayLenght>0</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsNull>False</IsNull>
<AsString>{System.String[]}</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.String[]</Type>
</MethodArgument>
</Items>
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>StaticFunction</Name>
<Module>FunctionArgumentVariables.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=28,4 End=28,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>3</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>3</Count>
<Items>
<MethodArgument>
<Index>0</Index>
<Name>i</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>1</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>1</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
<MethodArgument>
<Index>1</Index>
<Name>s</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>S</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>S</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MethodArgument>
<MethodArgument>
<Index>2</Index>
<Name>args</Name>
<IsArray>True</IsArray>
<ArrayLenght>1</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsNull>False</IsNull>
<AsString>{System.String[]}</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.String[]</Type>
</MethodArgument>
</Items>
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>StaticFunction</Name>
<Module>FunctionArgumentVariables.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=28,4 End=28,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>3</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>3</Count>
<Items>
<MethodArgument>
<Index>0</Index>
<Name>i</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>2</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>2</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
<MethodArgument>
<Index>1</Index>
<Name>s</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>&lt;null&gt;</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MethodArgument>
<MethodArgument>
<Index>2</Index>
<Name>args</Name>
<IsArray>True</IsArray>
<ArrayLenght>2</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsNull>False</IsNull>
<AsString>{System.String[]}</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.String[]</Type>
</MethodArgument>
</Items>
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Function</Name>
<Module>FunctionArgumentVariables.exe</Module>
<IsStatic>False</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=33,4 End=33,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>{Debugger.Tests.TestPrograms.FunctionArgumentVariables}</AsString>
<IsObject>True</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>Debugger.Tests.TestPrograms.FunctionArgumentVariables</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>3</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>3</Count>
<Items>
<MethodArgument>
<Index>0</Index>
<Name>i</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>0</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>0</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
<MethodArgument>
<Index>1</Index>
<Name>s</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>S</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>S</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MethodArgument>
<MethodArgument>
<Index>2</Index>
<Name>args</Name>
<IsArray>True</IsArray>
<ArrayLenght>0</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsNull>False</IsNull>
<AsString>{System.String[]}</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.String[]</Type>
</MethodArgument>
</Items>
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Function</Name>
<Module>FunctionArgumentVariables.exe</Module>
<IsStatic>False</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=33,4 End=33,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>{Debugger.Tests.TestPrograms.FunctionArgumentVariables}</AsString>
<IsObject>True</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>Debugger.Tests.TestPrograms.FunctionArgumentVariables</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>3</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>3</Count>
<Items>
<MethodArgument>
<Index>0</Index>
<Name>i</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>1</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>1</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
<MethodArgument>
<Index>1</Index>
<Name>s</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>S</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>S</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MethodArgument>
<MethodArgument>
<Index>2</Index>
<Name>args</Name>
<IsArray>True</IsArray>
<ArrayLenght>1</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsNull>False</IsNull>
<AsString>{System.String[]}</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.String[]</Type>
</MethodArgument>
</Items>
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Function</Name>
<Module>FunctionArgumentVariables.exe</Module>
<IsStatic>False</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=33,4 End=33,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>{Debugger.Tests.TestPrograms.FunctionArgumentVariables}</AsString>
<IsObject>True</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>Debugger.Tests.TestPrograms.FunctionArgumentVariables</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>3</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>3</Count>
<Items>
<MethodArgument>
<Index>0</Index>
<Name>i</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>2</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>2</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
<MethodArgument>
<Index>1</Index>
<Name>s</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>&lt;null&gt;</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MethodArgument>
<MethodArgument>
<Index>2</Index>
<Name>args</Name>
<IsArray>True</IsArray>
<ArrayLenght>2</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsNull>False</IsNull>
<AsString>{System.String[]}</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.String[]</Type>
</MethodArgument>
</Items>
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<ProcessExited />
</Test>
</DebuggerTests>

340
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLifetime.xml

@ -0,0 +1,340 @@ @@ -0,0 +1,340 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="FunctionLifetime">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">FunctionLifetime.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="Function">
<Function>
<Name>Function</Name>
<Module>FunctionLifetime.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=22,4 End=22,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>1</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>1</Count>
<Items>
<MethodArgument>
<Index>0</Index>
<Name>i</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>1</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>1</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
</Items>
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="Function">
<Function>
<Name>Function</Name>
<Module>FunctionLifetime.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=23,4 End=23,18</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>1</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>1</Count>
<Items>
<MethodArgument>
<Index>0</Index>
<Name>i</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>1</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>1</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
</Items>
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<ObjectDump name="SubFunction">
<Function>
<Name>SubFunction</Name>
<Module>FunctionLifetime.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=29,4 End=29,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="Function">
<Function>
<Name>Function</Name>
<Module>FunctionLifetime.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=24,4 End=24,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>1</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>1</Count>
<Items>
<MethodArgument>
<Index>0</Index>
<Name>i</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>1</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>1</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
</Items>
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="Main">
<Function>
<Name>Main</Name>
<Module>FunctionLifetime.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=17,4 End=17,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<ObjectDump name="Function">
<Function>
<Name>Function</Name>
<Module>FunctionLifetime.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>True</HasExpired>
<NextStatement exception="Function has expired" />
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Value has expired" />
<ArrayLenght exception="Value has expired" />
<ArrayRank exception="Value has expired" />
<ArrayDimensions exception="Value has expired" />
<IsNull exception="Value has expired" />
<AsString exception="Value has expired" />
<IsObject exception="Value has expired" />
<IsPrimitive exception="Value has expired" />
<IsInteger exception="Value has expired" />
<PrimitiveValue exception="Value has expired" />
<HasExpired>True</HasExpired>
<Type exception="Value has expired" />
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount exception="Function has expired" />
<Arguments exception="Function has expired" />
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<ProcessExited />
</Test>
</DebuggerTests>

133
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLocalVariables.xml

@ -0,0 +1,133 @@ @@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="FunctionLocalVariables">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">FunctionLocalVariables.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Main</Name>
<Module>FunctionLocalVariables.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=23,4 End=23,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>5</Count>
<Items>
<LocalVariable>
<Name>i</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>0</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>0</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</LocalVariable>
<LocalVariable>
<Name>s</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>S</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>S</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</LocalVariable>
<LocalVariable>
<Name>args</Name>
<IsArray>True</IsArray>
<ArrayLenght>1</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsNull>False</IsNull>
<AsString>{System.String[]}</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.String[]</Type>
</LocalVariable>
<LocalVariable>
<Name>n</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>&lt;null&gt;</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.Object</Type>
</LocalVariable>
<LocalVariable>
<Name>o</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>{System.Object}</AsString>
<IsObject>True</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>System.Object</Type>
</LocalVariable>
</Items>
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<ProcessExited />
</Test>
</DebuggerTests>

414
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.xml

@ -0,0 +1,414 @@ @@ -0,0 +1,414 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="FunctionVariablesLifetime">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">FunctionVariablesLifetime.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="argument">
<MethodArgument>
<Index>0</Index>
<Name>argument</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>1</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>1</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
</ObjectDump>
<ObjectDump name="local">
<LocalVariable>
<Name>local</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>2</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>2</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</LocalVariable>
</ObjectDump>
<ObjectDump name="@class">
<MemberValue>
<MemberInfo>
<FieldInfo>
<IsLiteral>False</IsLiteral>
<IsPrivate>False</IsPrivate>
<IsPublic>True</IsPublic>
<IsStatic>False</IsStatic>
<Name>class</Name>
<DeclaringType>Debugger.Tests.TestPrograms.FunctionVariablesLifetime</DeclaringType>
<Module>FunctionVariablesLifetime.exe</Module>
</FieldInfo>
</MemberInfo>
<Name>class</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>3</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>3</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MemberValue>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="argument">
<MethodArgument>
<Index>0</Index>
<Name>argument</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>1</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>1</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
</ObjectDump>
<ObjectDump name="local">
<LocalVariable>
<Name>local</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>2</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>2</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</LocalVariable>
</ObjectDump>
<ObjectDump name="@class">
<MemberValue>
<MemberInfo>
<FieldInfo>
<IsLiteral>False</IsLiteral>
<IsPrivate>False</IsPrivate>
<IsPublic>True</IsPublic>
<IsStatic>False</IsStatic>
<Name>class</Name>
<DeclaringType>Debugger.Tests.TestPrograms.FunctionVariablesLifetime</DeclaringType>
<Module>FunctionVariablesLifetime.exe</Module>
</FieldInfo>
</MemberInfo>
<Name>class</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>3</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>3</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MemberValue>
</ObjectDump>
<ObjectDump name="localInSubFunction">
<LocalVariable>
<Name>localInSubFunction</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>4</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>4</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</LocalVariable>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="argument">
<MethodArgument>
<Index>0</Index>
<Name>argument</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>1</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>1</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
</ObjectDump>
<ObjectDump name="local">
<LocalVariable>
<Name>local</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>2</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>2</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</LocalVariable>
</ObjectDump>
<ObjectDump name="@class">
<MemberValue>
<MemberInfo>
<FieldInfo>
<IsLiteral>False</IsLiteral>
<IsPrivate>False</IsPrivate>
<IsPublic>True</IsPublic>
<IsStatic>False</IsStatic>
<Name>class</Name>
<DeclaringType>Debugger.Tests.TestPrograms.FunctionVariablesLifetime</DeclaringType>
<Module>FunctionVariablesLifetime.exe</Module>
</FieldInfo>
</MemberInfo>
<Name>class</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>3</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>3</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MemberValue>
</ObjectDump>
<ObjectDump name="localInSubFunction">
<LocalVariable>
<Name>localInSubFunction</Name>
<IsArray exception="Value has expired" />
<ArrayLenght exception="Value has expired" />
<ArrayRank exception="Value has expired" />
<ArrayDimensions exception="Value has expired" />
<IsNull exception="Value has expired" />
<AsString exception="Value has expired" />
<IsObject exception="Value has expired" />
<IsPrimitive exception="Value has expired" />
<IsInteger exception="Value has expired" />
<PrimitiveValue exception="Value has expired" />
<HasExpired>True</HasExpired>
<Type exception="Value has expired" />
</LocalVariable>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="argument">
<MethodArgument>
<Index>0</Index>
<Name>argument</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>1</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>1</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MethodArgument>
</ObjectDump>
<ObjectDump name="local">
<LocalVariable>
<Name>local</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>2</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>2</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</LocalVariable>
</ObjectDump>
<ObjectDump name="@class">
<MemberValue>
<MemberInfo>
<FieldInfo>
<IsLiteral>False</IsLiteral>
<IsPrivate>False</IsPrivate>
<IsPublic>True</IsPublic>
<IsStatic>False</IsStatic>
<Name>class</Name>
<DeclaringType>Debugger.Tests.TestPrograms.FunctionVariablesLifetime</DeclaringType>
<Module>FunctionVariablesLifetime.exe</Module>
</FieldInfo>
</MemberInfo>
<Name>class</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>3</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>3</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</MemberValue>
</ObjectDump>
<ObjectDump name="localInSubFunction">
<LocalVariable>
<Name>localInSubFunction</Name>
<IsArray exception="Value has expired" />
<ArrayLenght exception="Value has expired" />
<ArrayRank exception="Value has expired" />
<ArrayDimensions exception="Value has expired" />
<IsNull exception="Value has expired" />
<AsString exception="Value has expired" />
<IsObject exception="Value has expired" />
<IsPrimitive exception="Value has expired" />
<IsInteger exception="Value has expired" />
<PrimitiveValue exception="Value has expired" />
<HasExpired>True</HasExpired>
<Type exception="Value has expired" />
</LocalVariable>
</ObjectDump>
<ObjectDump name="localInSubFunction(new)">
<LocalVariable>
<Name>localInSubFunction</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>4</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>4</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</LocalVariable>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="argument">
<MethodArgument>
<Index>0</Index>
<Name>argument</Name>
<IsArray exception="Value has expired" />
<ArrayLenght exception="Value has expired" />
<ArrayRank exception="Value has expired" />
<ArrayDimensions exception="Value has expired" />
<IsNull exception="Value has expired" />
<AsString exception="Value has expired" />
<IsObject exception="Value has expired" />
<IsPrimitive exception="Value has expired" />
<IsInteger exception="Value has expired" />
<PrimitiveValue exception="Value has expired" />
<HasExpired>True</HasExpired>
<Type exception="Value has expired" />
</MethodArgument>
</ObjectDump>
<ObjectDump name="local">
<LocalVariable>
<Name>local</Name>
<IsArray exception="Value has expired" />
<ArrayLenght exception="Value has expired" />
<ArrayRank exception="Value has expired" />
<ArrayDimensions exception="Value has expired" />
<IsNull exception="Value has expired" />
<AsString exception="Value has expired" />
<IsObject exception="Value has expired" />
<IsPrimitive exception="Value has expired" />
<IsInteger exception="Value has expired" />
<PrimitiveValue exception="Value has expired" />
<HasExpired>True</HasExpired>
<Type exception="Value has expired" />
</LocalVariable>
</ObjectDump>
<ObjectDump name="@class">
<MemberValue>
<MemberInfo>
<FieldInfo>
<IsLiteral>False</IsLiteral>
<IsPrivate>False</IsPrivate>
<IsPublic>True</IsPublic>
<IsStatic>False</IsStatic>
<Name>class</Name>
<DeclaringType>Debugger.Tests.TestPrograms.FunctionVariablesLifetime</DeclaringType>
<Module>FunctionVariablesLifetime.exe</Module>
</FieldInfo>
</MemberInfo>
<Name>class</Name>
<IsArray exception="Value has expired" />
<ArrayLenght exception="Value has expired" />
<ArrayRank exception="Value has expired" />
<ArrayDimensions exception="Value has expired" />
<IsNull exception="Value has expired" />
<AsString exception="Value has expired" />
<IsObject exception="Value has expired" />
<IsPrimitive exception="Value has expired" />
<IsInteger exception="Value has expired" />
<PrimitiveValue exception="Value has expired" />
<HasExpired>True</HasExpired>
<Type exception="Value has expired" />
</MemberValue>
</ObjectDump>
<ObjectDump name="localInSubFunction">
<LocalVariable>
<Name>localInSubFunction</Name>
<IsArray exception="Value has expired" />
<ArrayLenght exception="Value has expired" />
<ArrayRank exception="Value has expired" />
<ArrayDimensions exception="Value has expired" />
<IsNull exception="Value has expired" />
<AsString exception="Value has expired" />
<IsObject exception="Value has expired" />
<IsPrimitive exception="Value has expired" />
<IsInteger exception="Value has expired" />
<PrimitiveValue exception="Value has expired" />
<HasExpired>True</HasExpired>
<Type exception="Value has expired" />
</LocalVariable>
</ObjectDump>
<ProcessExited />
</Test>
</DebuggerTests>

13
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/HelloWorld.xml

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="HelloWorld">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">HelloWorld.exe</ModuleLoaded>
<ModuleLoaded symbols="False">System.dll</ModuleLoaded>
<ModuleLoaded symbols="False">System.Configuration.dll</ModuleLoaded>
<ModuleLoaded symbols="False">System.Xml.dll</ModuleLoaded>
<LogMessage>Hello world!\r\n</LogMessage>
<ProcessExited />
</Test>
</DebuggerTests>

215
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.xml

@ -0,0 +1,215 @@ @@ -0,0 +1,215 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="ObjectValue">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">ObjectValue.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="val">
<LocalVariable>
<Name>val</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>{Debugger.Tests.TestPrograms.ObjectValue}</AsString>
<IsObject>True</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>Debugger.Tests.TestPrograms.ObjectValue</Type>
</LocalVariable>
</ObjectDump>
<DebuggingPaused>EvalComplete</DebuggingPaused>
<ObjectDump name="val members">
<NamedValueCollection>
<Count>3</Count>
<Items>
<MemberValue>
<MemberInfo>
<FieldInfo>
<IsLiteral>False</IsLiteral>
<IsPrivate>True</IsPrivate>
<IsPublic>False</IsPublic>
<IsStatic>False</IsStatic>
<Name>privateField</Name>
<DeclaringType>Debugger.Tests.TestPrograms.ObjectValue</DeclaringType>
<Module>ObjectValue.exe</Module>
</FieldInfo>
</MemberInfo>
<Name>privateField</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>private</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>private</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MemberValue>
<MemberValue>
<MemberInfo>
<FieldInfo>
<IsLiteral>False</IsLiteral>
<IsPrivate>False</IsPrivate>
<IsPublic>True</IsPublic>
<IsStatic>False</IsStatic>
<Name>publicFiled</Name>
<DeclaringType>Debugger.Tests.TestPrograms.ObjectValue</DeclaringType>
<Module>ObjectValue.exe</Module>
</FieldInfo>
</MemberInfo>
<Name>publicFiled</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>public</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>public</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MemberValue>
<MemberValue>
<MemberInfo>
<PropertyInfo>
<IsPrivate>False</IsPrivate>
<IsPublic>True</IsPublic>
<IsStatic>False</IsStatic>
<Name>PublicProperty</Name>
<DeclaringType>Debugger.Tests.TestPrograms.ObjectValue</DeclaringType>
<Module>ObjectValue.exe</Module>
</PropertyInfo>
</MemberInfo>
<Name>PublicProperty</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>private</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>private</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MemberValue>
</Items>
</NamedValueCollection>
</ObjectDump>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="val">
<LocalVariable>
<Name>val</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>{Debugger.Tests.TestPrograms.ObjectValue}</AsString>
<IsObject>True</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>Debugger.Tests.TestPrograms.ObjectValue</Type>
</LocalVariable>
</ObjectDump>
<DebuggingPaused>EvalComplete</DebuggingPaused>
<ObjectDump name="val members">
<NamedValueCollection>
<Count>3</Count>
<Items>
<MemberValue>
<MemberInfo>
<FieldInfo>
<IsLiteral>False</IsLiteral>
<IsPrivate>True</IsPrivate>
<IsPublic>False</IsPublic>
<IsStatic>False</IsStatic>
<Name>privateField</Name>
<DeclaringType>Debugger.Tests.TestPrograms.ObjectValue</DeclaringType>
<Module>ObjectValue.exe</Module>
</FieldInfo>
</MemberInfo>
<Name>privateField</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>new private</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>new private</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MemberValue>
<MemberValue>
<MemberInfo>
<FieldInfo>
<IsLiteral>False</IsLiteral>
<IsPrivate>False</IsPrivate>
<IsPublic>True</IsPublic>
<IsStatic>False</IsStatic>
<Name>publicFiled</Name>
<DeclaringType>Debugger.Tests.TestPrograms.ObjectValue</DeclaringType>
<Module>ObjectValue.exe</Module>
</FieldInfo>
</MemberInfo>
<Name>publicFiled</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>public</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>public</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MemberValue>
<MemberValue>
<MemberInfo>
<PropertyInfo>
<IsPrivate>False</IsPrivate>
<IsPublic>True</IsPublic>
<IsStatic>False</IsStatic>
<Name>PublicProperty</Name>
<DeclaringType>Debugger.Tests.TestPrograms.ObjectValue</DeclaringType>
<Module>ObjectValue.exe</Module>
</PropertyInfo>
</MemberInfo>
<Name>PublicProperty</Name>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>False</IsNull>
<AsString>new private</AsString>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>new private</PrimitiveValue>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</MemberValue>
</Items>
</NamedValueCollection>
</ObjectDump>
<ProcessExited />
</Test>
</DebuggerTests>

17
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SetIP.xml

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="SetIP">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">SetIP.exe</ModuleLoaded>
<ModuleLoaded symbols="False">System.dll</ModuleLoaded>
<ModuleLoaded symbols="False">System.Configuration.dll</ModuleLoaded>
<ModuleLoaded symbols="False">System.Xml.dll</ModuleLoaded>
<LogMessage>1\r\n</LogMessage>
<DebuggingPaused>Break</DebuggingPaused>
<DebuggingPaused>SetIP</DebuggingPaused>
<LogMessage>1\r\n</LogMessage>
<DebuggingPaused>Break</DebuggingPaused>
<ProcessExited />
</Test>
</DebuggerTests>

9
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SimpleProgram.xml

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="SimpleProgram">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">SimpleProgram.exe</ModuleLoaded>
<ProcessExited />
</Test>
</DebuggerTests>

449
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Stepping.xml

@ -0,0 +1,449 @@ @@ -0,0 +1,449 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="Stepping">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">Stepping.exe</ModuleLoaded>
<ModuleLoaded symbols="False">System.dll</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Main</Name>
<Module>Stepping.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=16,4 End=16,40</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>StepComplete</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Main</Name>
<Module>Stepping.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=17,4 End=17,44</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<ModuleLoaded symbols="False">System.Configuration.dll</ModuleLoaded>
<ModuleLoaded symbols="False">System.Xml.dll</ModuleLoaded>
<LogMessage>1\r\n</LogMessage>
<DebuggingPaused>StepComplete</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Main</Name>
<Module>Stepping.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=18,4 End=18,10</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>StepComplete</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Sub</Name>
<Module>Stepping.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=23,3 End=23,4</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>StepComplete</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Sub</Name>
<Module>Stepping.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=24,4 End=24,44</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<LogMessage>2\r\n</LogMessage>
<DebuggingPaused>StepComplete</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Sub</Name>
<Module>Stepping.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=25,4 End=25,44</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<LogMessage>3\r\n</LogMessage>
<LogMessage>4\r\n</LogMessage>
<DebuggingPaused>StepComplete</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Main</Name>
<Module>Stepping.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=18,4 End=18,10</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<DebuggingPaused>StepComplete</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Main</Name>
<Module>Stepping.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=19,4 End=19,11</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<LogMessage>5\r\n</LogMessage>
<DebuggingPaused>StepComplete</DebuggingPaused>
<ObjectDump name="SelectedFunction">
<Function>
<Name>Main</Name>
<Module>Stepping.exe</Module>
<IsStatic>True</IsStatic>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=20,3 End=20,4</NextStatement>
<ThisValue>
<NamedValue>
<Name>this</Name>
<IsArray exception="Static method does not have 'this'." />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsNull>True</IsNull>
<AsString>
</AsString>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<HasExpired>False</HasExpired>
<Type>null</Type>
</NamedValue>
</ThisValue>
<ContaingClassVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</Arguments>
<LocalVariables>
<NamedValueCollection>
<Count>0</Count>
<Items />
</NamedValueCollection>
</LocalVariables>
</Function>
</ObjectDump>
<ProcessExited />
</Test>
</DebuggerTests>
Loading…
Cancel
Save