Browse Source

Added synchronous Continue and Step*.

Use these to simplify the test code.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2888 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
ec2863a837
  1. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  2. 18
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Process-StateControl.cs
  3. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs
  4. 21
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/StackFrame.cs
  5. 26
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs
  6. 6
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.cs
  7. 5
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Break.cs
  8. 14
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Breakpoint.cs
  9. 14
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Callstack.cs
  10. 6
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Exception.cs
  11. 6
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ExceptionCustom.cs
  12. 5
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Expressions.cs
  13. 8
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionArgumentVariables.cs
  14. 15
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLifetime.cs
  15. 6
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLocalVariables.cs
  16. 18
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.cs
  17. 6
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/GenericDictionary.cs
  18. 9
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Generics.cs
  19. 6
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/HelloWorld.cs
  20. 9
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/MetadataIdentity.cs
  21. 10
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.cs
  22. 8
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SetIP.cs
  23. 6
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SimpleProgram.cs
  24. 7
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/StackOverflow.cs
  25. 30
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Stepping.cs
  26. 6
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ValueType.cs
  27. 5
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/_Template.cs

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

@ -206,7 +206,7 @@ namespace ICSharpCode.SharpDevelop.Services
if (debuggedProcess.SelectedStackFrame == null || debuggedProcess.IsRunning) { if (debuggedProcess.SelectedStackFrame == null || debuggedProcess.IsRunning) {
MessageService.ShowMessage(errorCannotStepNoActiveFunction, "${res:XML.MainMenu.DebugMenu.StepInto}"); MessageService.ShowMessage(errorCannotStepNoActiveFunction, "${res:XML.MainMenu.DebugMenu.StepInto}");
} else { } else {
debuggedProcess.StepInto(); debuggedProcess.SelectedStackFrame.StepInto();
} }
} }
@ -219,7 +219,7 @@ namespace ICSharpCode.SharpDevelop.Services
if (debuggedProcess.SelectedStackFrame == null || debuggedProcess.IsRunning) { if (debuggedProcess.SelectedStackFrame == null || debuggedProcess.IsRunning) {
MessageService.ShowMessage(errorCannotStepNoActiveFunction, "${res:XML.MainMenu.DebugMenu.StepOver}"); MessageService.ShowMessage(errorCannotStepNoActiveFunction, "${res:XML.MainMenu.DebugMenu.StepOver}");
} else { } else {
debuggedProcess.StepOver(); debuggedProcess.SelectedStackFrame.StepOver();
} }
} }
@ -232,7 +232,7 @@ namespace ICSharpCode.SharpDevelop.Services
if (debuggedProcess.SelectedStackFrame == null || debuggedProcess.IsRunning) { if (debuggedProcess.SelectedStackFrame == null || debuggedProcess.IsRunning) {
MessageService.ShowMessage(errorCannotStepNoActiveFunction, "${res:XML.MainMenu.DebugMenu.StepOut}"); MessageService.ShowMessage(errorCannotStepNoActiveFunction, "${res:XML.MainMenu.DebugMenu.StepOut}");
} else { } else {
debuggedProcess.StepOut(); debuggedProcess.SelectedStackFrame.StepOut();
} }
} }

18
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Process-StateControl.cs

@ -150,23 +150,5 @@ namespace Debugger
debugger.MTA2STA.PerformAllCalls(); debugger.MTA2STA.PerformAllCalls();
} }
} }
public void StepInto()
{
AssertPaused();
SelectedStackFrame.AsyncStepInto();
}
public void StepOver()
{
AssertPaused();
SelectedStackFrame.AsyncStepOver();
}
public void StepOut()
{
AssertPaused();
SelectedStackFrame.AsyncStepOut();
}
} }
} }

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs

@ -145,6 +145,12 @@ namespace Debugger
Pause(true); Pause(true);
} }
public void Continue()
{
AsyncContinue();
WaitForPause();
}
public void AsyncContinue() public void AsyncContinue()
{ {
AssertPaused(); AssertPaused();

21
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/StackFrame.cs

@ -114,6 +114,27 @@ namespace Debugger
} }
} }
/// <summary> Step into next instruction </summary>
public void StepInto()
{
AsyncStepInto();
this.Process.WaitForPause();
}
/// <summary> Step over next instruction </summary>
public void StepOver()
{
AsyncStepOver();
this.Process.WaitForPause();
}
/// <summary> Step out of the stack frame </summary>
public void StepOut()
{
AsyncStepOut();
this.Process.WaitForPause();
}
/// <summary> Step into next instruction </summary> /// <summary> Step into next instruction </summary>
public void AsyncStepInto() public void AsyncStepInto()
{ {

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

@ -69,7 +69,16 @@ namespace Debugger.Tests
} }
protected void CheckXmlOutput() protected void EndTest()
{
if (!process.HasExpired) {
process.AsyncContinue();
process.WaitForExit();
}
CheckXmlOutput();
}
void CheckXmlOutput()
{ {
string startMark = "#if EXPECTED_OUTPUT\r\n"; string startMark = "#if EXPECTED_OUTPUT\r\n";
string endMark = "#endif // EXPECTED_OUTPUT"; string endMark = "#endif // EXPECTED_OUTPUT";
@ -107,6 +116,11 @@ namespace Debugger.Tests
} }
protected void StartTest(string testName) protected void StartTest(string testName)
{
StartTest(testName, true);
}
protected void StartTest(string testName, bool wait)
{ {
this.testName = testName; this.testName = testName;
string exeFilename = CompileTest(testName); string exeFilename = CompileTest(testName);
@ -139,6 +153,10 @@ namespace Debugger.Tests
}; };
LogEvent("ProcessStarted", null); LogEvent("ProcessStarted", null);
if (wait) {
process.WaitForPause();
}
} }
protected XmlElement LogEvent(string name, string content) protected XmlElement LogEvent(string name, string content)
@ -151,12 +169,6 @@ namespace Debugger.Tests
return eventNode; return eventNode;
} }
protected void WaitForPause()
{
process.WaitForPause();
Assert.AreEqual(true, process.IsPaused);
}
public void ObjectDump(object obj) public void ObjectDump(object obj)
{ {
ObjectDump("Object", obj); ObjectDump("Object", obj);

6
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.cs

@ -30,14 +30,12 @@ namespace Debugger.Tests {
public void ArrayValue() public void ArrayValue()
{ {
StartTest("ArrayValue.cs"); StartTest("ArrayValue.cs");
WaitForPause();
Value array = process.SelectedStackFrame.GetLocalVariableValue("array"); Value array = process.SelectedStackFrame.GetLocalVariableValue("array");
ObjectDump("array", array); ObjectDump("array", array);
ObjectDump("array elements", array.GetArrayElements()); ObjectDump("array elements", array.GetArrayElements());
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

5
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Break.cs

@ -26,11 +26,8 @@ namespace Debugger.Tests {
public void Break() public void Break()
{ {
StartTest("Break.cs"); StartTest("Break.cs");
WaitForPause();
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

14
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Breakpoint.cs

@ -31,21 +31,15 @@ namespace Debugger.Tests {
Breakpoint breakpoint = 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);
StartTest("Breakpoint.cs"); StartTest("Breakpoint.cs");
WaitForPause();
ObjectDump(breakpoint); ObjectDump(breakpoint);
process.Continue();
process.AsyncContinue(); process.Continue();
WaitForPause();
process.AsyncContinue();
WaitForPause();
process.AsyncContinue(); process.AsyncContinue();
process.WaitForExit(); process.WaitForExit();
ObjectDump(breakpoint); ObjectDump(breakpoint);
CheckXmlOutput();
EndTest();
} }
} }
} }

14
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Callstack.cs

@ -36,20 +36,14 @@ namespace Debugger.Tests {
public void Callstack() public void Callstack()
{ {
StartTest("Callstack.cs"); StartTest("Callstack.cs");
WaitForPause();
ObjectDump("Callstack", process.SelectedThread.GetCallstack());
process.StepOut();
WaitForPause();
ObjectDump("Callstack", process.SelectedThread.GetCallstack()); ObjectDump("Callstack", process.SelectedThread.GetCallstack());
process.SelectedStackFrame.StepOut();
process.StepOut(); ObjectDump("Callstack", process.SelectedThread.GetCallstack());
WaitForPause(); process.SelectedStackFrame.StepOut();
ObjectDump("Callstack", process.SelectedThread.GetCallstack()); ObjectDump("Callstack", process.SelectedThread.GetCallstack());
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

6
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Exception.cs

@ -26,10 +26,8 @@ namespace Debugger.Tests {
public void Exception() public void Exception()
{ {
StartTest("Exception.cs"); StartTest("Exception.cs");
WaitForPause();
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

6
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ExceptionCustom.cs

@ -34,10 +34,8 @@ namespace Debugger.Tests {
public void ExceptionCustom() public void ExceptionCustom()
{ {
StartTest("ExceptionCustom.cs"); StartTest("ExceptionCustom.cs");
WaitForPause();
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

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

@ -57,15 +57,12 @@ namespace Debugger.Tests {
public void Expressions() public void Expressions()
{ {
StartTest("Expressions.cs"); StartTest("Expressions.cs");
WaitForPause();
ObjectDump("Arguments", process.SelectedStackFrame.GetArgumentValues()); ObjectDump("Arguments", process.SelectedStackFrame.GetArgumentValues());
ObjectDump("LocalVariables", process.SelectedStackFrame.GetLocalVariableValues()); ObjectDump("LocalVariables", process.SelectedStackFrame.GetLocalVariableValues());
ObjectDump("this", process.SelectedStackFrame.GetThisValue().GetMemberValues()); ObjectDump("this", process.SelectedStackFrame.GetThisValue().GetMemberValues());
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

8
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionArgumentVariables.cs

@ -72,17 +72,13 @@ namespace Debugger.Tests {
public void FunctionArgumentVariables() public void FunctionArgumentVariables()
{ {
StartTest("FunctionArgumentVariables.cs"); StartTest("FunctionArgumentVariables.cs");
WaitForPause();
for(int i = 0; i < 5; i++) { for(int i = 0; i < 5; i++) {
process.AsyncContinue(); process.Continue();
WaitForPause();
ObjectDump("Arguments", process.SelectedStackFrame.GetArgumentValues()); ObjectDump("Arguments", process.SelectedStackFrame.GetArgumentValues());
} }
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

15
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLifetime.cs

@ -39,29 +39,24 @@ namespace Debugger.Tests {
public void FunctionLifetime() public void FunctionLifetime()
{ {
StartTest("FunctionLifetime.cs"); StartTest("FunctionLifetime.cs");
WaitForPause();
StackFrame stackFrame = process.SelectedStackFrame; StackFrame stackFrame = process.SelectedStackFrame;
ObjectDump("SelectedStackFrame", process.SelectedStackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
process.AsyncContinue(); // Go to the SubFunction process.Continue(); // Go to the SubFunction
WaitForPause();
ObjectDump("Old StackFrame", stackFrame); ObjectDump("Old StackFrame", stackFrame);
ObjectDump("SelectedStackFrame", process.SelectedStackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
process.AsyncContinue(); // Go back to Function process.Continue(); // Go back to Function
WaitForPause();
ObjectDump("Old StackFrame", stackFrame); ObjectDump("Old StackFrame", stackFrame);
ObjectDump("SelectedStackFrame", process.SelectedStackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
process.AsyncContinue(); // Setp out of function process.Continue(); // Setp out of function
WaitForPause();
ObjectDump("Main", process.SelectedStackFrame); ObjectDump("Main", process.SelectedStackFrame);
ObjectDump("Old StackFrame", stackFrame); ObjectDump("Old StackFrame", stackFrame);
ObjectDump("SelectedStackFrame", process.SelectedStackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

6
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLocalVariables.cs

@ -31,12 +31,10 @@ namespace Debugger.Tests {
public void FunctionLocalVariables() public void FunctionLocalVariables()
{ {
StartTest("FunctionLocalVariables.cs"); StartTest("FunctionLocalVariables.cs");
WaitForPause();
ObjectDump("LocalVariables", process.SelectedStackFrame.GetLocalVariableValues()); ObjectDump("LocalVariables", process.SelectedStackFrame.GetLocalVariableValues());
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

18
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionVariablesLifetime.cs

@ -49,7 +49,7 @@ namespace Debugger.Tests {
Value @class = null; Value @class = null;
StartTest("FunctionVariablesLifetime.cs"); // 1 - Enter program StartTest("FunctionVariablesLifetime.cs"); // 1 - Enter program
WaitForPause();
argument = process.SelectedStackFrame.GetArgumentValue(0); argument = process.SelectedStackFrame.GetArgumentValue(0);
local = process.SelectedStackFrame.GetLocalVariableValue("local"); local = process.SelectedStackFrame.GetLocalVariableValue("local");
@class = process.SelectedStackFrame.GetThisValue().GetMemberValue("class"); @class = process.SelectedStackFrame.GetThisValue().GetMemberValue("class");
@ -57,23 +57,20 @@ namespace Debugger.Tests {
ObjectDump("local", local); ObjectDump("local", local);
ObjectDump("@class", @class); ObjectDump("@class", @class);
process.AsyncContinue(); // 2 - Go to the SubFunction process.Continue(); // 2 - Go to the SubFunction
WaitForPause();
localInSubFunction = process.SelectedStackFrame.GetLocalVariableValue("localInSubFunction"); localInSubFunction = process.SelectedStackFrame.GetLocalVariableValue("localInSubFunction");
ObjectDump("argument", argument); ObjectDump("argument", argument);
ObjectDump("local", local); ObjectDump("local", local);
ObjectDump("@class", @class); ObjectDump("@class", @class);
ObjectDump("localInSubFunction", @localInSubFunction); ObjectDump("localInSubFunction", @localInSubFunction);
process.AsyncContinue(); // 3 - Go back to Function process.Continue(); // 3 - Go back to Function
WaitForPause();
ObjectDump("argument", argument); ObjectDump("argument", argument);
ObjectDump("local", local); ObjectDump("local", local);
ObjectDump("@class", @class); ObjectDump("@class", @class);
ObjectDump("localInSubFunction", @localInSubFunction); ObjectDump("localInSubFunction", @localInSubFunction);
process.AsyncContinue(); // 4 - Go to the SubFunction process.Continue(); // 4 - Go to the SubFunction
WaitForPause();
ObjectDump("argument", argument); ObjectDump("argument", argument);
ObjectDump("local", local); ObjectDump("local", local);
ObjectDump("@class", @class); ObjectDump("@class", @class);
@ -81,16 +78,13 @@ namespace Debugger.Tests {
localInSubFunction = process.SelectedStackFrame.GetLocalVariableValue("localInSubFunction"); localInSubFunction = process.SelectedStackFrame.GetLocalVariableValue("localInSubFunction");
ObjectDump("localInSubFunction(new)", @localInSubFunction); ObjectDump("localInSubFunction(new)", @localInSubFunction);
process.AsyncContinue(); // 5 - Setp out of both functions process.Continue(); // 5 - Setp out of both functions
WaitForPause();
ObjectDump("argument", argument); ObjectDump("argument", argument);
ObjectDump("local", local); ObjectDump("local", local);
ObjectDump("@class", @class); ObjectDump("@class", @class);
ObjectDump("localInSubFunction", @localInSubFunction); ObjectDump("localInSubFunction", @localInSubFunction);
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

6
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/GenericDictionary.cs

@ -31,13 +31,11 @@ namespace Debugger.Tests {
public void GenericDictionary() public void GenericDictionary()
{ {
StartTest("GenericDictionary.cs"); StartTest("GenericDictionary.cs");
WaitForPause();
ObjectDump("dict", process.SelectedStackFrame.GetLocalVariableValue("dict")); ObjectDump("dict", process.SelectedStackFrame.GetLocalVariableValue("dict"));
ObjectDump("dict members", process.SelectedStackFrame.GetLocalVariableValue("dict").GetMemberValues(null, BindingFlags.All)); ObjectDump("dict members", process.SelectedStackFrame.GetLocalVariableValue("dict").GetMemberValues(null, BindingFlags.All));
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

9
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Generics.cs

@ -110,19 +110,14 @@ namespace Debugger.Tests {
StartTest("Generics.cs"); StartTest("Generics.cs");
for(int i = 0; i < 8; i++) { for(int i = 0; i < 8; i++) {
WaitForPause();
ObjectDump("SelectedStackFrame", process.SelectedStackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
ObjectDump("SelectedStackFrame-GetArguments", process.SelectedStackFrame.GetArgumentValues()); ObjectDump("SelectedStackFrame-GetArguments", process.SelectedStackFrame.GetArgumentValues());
process.AsyncContinue(); process.Continue();
} }
WaitForPause();
ObjectDump("Prop", process.SelectedStackFrame.GetLocalVariableValue("gClass").GetMemberValue("Prop")); ObjectDump("Prop", process.SelectedStackFrame.GetLocalVariableValue("gClass").GetMemberValue("Prop"));
ObjectDump("StaticProp", process.SelectedStackFrame.GetLocalVariableValue("gClass").GetMemberValue("StaticProp")); ObjectDump("StaticProp", process.SelectedStackFrame.GetLocalVariableValue("gClass").GetMemberValue("StaticProp"));
process.AsyncContinue();
process.WaitForExit(); EndTest();
CheckXmlOutput();
} }
} }
} }

6
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/HelloWorld.cs

@ -25,9 +25,11 @@ namespace Debugger.Tests {
[NUnit.Framework.Test] [NUnit.Framework.Test]
public void HelloWorld() public void HelloWorld()
{ {
StartTest("HelloWorld.cs"); StartTest("HelloWorld.cs", false);
process.WaitForExit(); process.WaitForExit();
CheckXmlOutput();
EndTest();
} }
} }
} }

9
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/MetadataIdentity.cs

@ -34,18 +34,15 @@ namespace Debugger.Tests {
public void MetadataIdentity() public void MetadataIdentity()
{ {
StartTest("MetadataIdentity.cs"); StartTest("MetadataIdentity.cs");
WaitForPause();
DebugType type = process.SelectedStackFrame.GetThisValue().Type; DebugType type = process.SelectedStackFrame.GetThisValue().Type;
MethodInfo mainMethod = process.SelectedStackFrame.MethodInfo; MethodInfo mainMethod = process.SelectedStackFrame.MethodInfo;
process.AsyncContinue(); process.Continue();
WaitForPause();
Assert.AreEqual(type, process.SelectedStackFrame.GetThisValue().Type); Assert.AreEqual(type, process.SelectedStackFrame.GetThisValue().Type);
Assert.AreEqual(mainMethod, process.SelectedStackFrame.MethodInfo); Assert.AreEqual(mainMethod, process.SelectedStackFrame.MethodInfo);
process.AsyncContinue();
process.WaitForExit(); EndTest();
CheckXmlOutput();
} }
} }
} }

10
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ObjectValue.cs

@ -46,20 +46,16 @@ namespace Debugger.Tests {
Value val = null; Value val = null;
StartTest("ObjectValue.cs"); StartTest("ObjectValue.cs");
WaitForPause();
val = process.SelectedStackFrame.GetLocalVariableValue("val"); val = process.SelectedStackFrame.GetLocalVariableValue("val");
ObjectDump("val", val); ObjectDump("val", val);
ObjectDump("val members", val.GetMemberValues(null, Debugger.BindingFlags.All)); ObjectDump("val members", val.GetMemberValues(null, Debugger.BindingFlags.All));
//ObjectDump("typeof(val)", val.Type);
process.AsyncContinue(); process.Continue();
WaitForPause();
ObjectDump("val", val); ObjectDump("val", val);
ObjectDump("val members", val.GetMemberValues(null, Debugger.BindingFlags.All)); ObjectDump("val members", val.GetMemberValues(null, Debugger.BindingFlags.All));
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

8
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SetIP.cs

@ -29,18 +29,14 @@ namespace Debugger.Tests {
public void SetIP() public void SetIP()
{ {
StartTest("SetIP.cs"); StartTest("SetIP.cs");
WaitForPause();
Assert.IsNotNull(process.SelectedStackFrame.CanSetIP("SetIP.cs", 16, 0)); Assert.IsNotNull(process.SelectedStackFrame.CanSetIP("SetIP.cs", 16, 0));
Assert.IsNull(process.SelectedStackFrame.CanSetIP("SetIP.cs", 100, 0)); Assert.IsNull(process.SelectedStackFrame.CanSetIP("SetIP.cs", 100, 0));
process.SelectedStackFrame.SetIP("SetIP.cs", 16, 0); process.SelectedStackFrame.SetIP("SetIP.cs", 16, 0);
process.AsyncContinue(); process.Continue();
WaitForPause();
Assert.AreEqual("1\r\n1\r\n", log); Assert.AreEqual("1\r\n1\r\n", log);
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

6
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/SimpleProgram.cs

@ -25,9 +25,11 @@ namespace Debugger.Tests {
[NUnit.Framework.Test] [NUnit.Framework.Test]
public void SimpleProgram() public void SimpleProgram()
{ {
StartTest("SimpleProgram.cs"); StartTest("SimpleProgram.cs", false);
process.WaitForExit(); process.WaitForExit();
CheckXmlOutput();
EndTest();
} }
} }
} }

7
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/StackOverflow.cs

@ -32,13 +32,11 @@ namespace Debugger.Tests {
public void StackOverflow() public void StackOverflow()
{ {
StartTest("StackOverflow.cs"); StartTest("StackOverflow.cs");
WaitForPause();
process.AsyncContinue(); process.Continue();
WaitForPause();
ObjectDump("LastStackFrame", process.SelectedThread.MostRecentStackFrame); ObjectDump("LastStackFrame", process.SelectedThread.MostRecentStackFrame);
CheckXmlOutput(); EndTest();
} }
} }
} }
@ -62,6 +60,7 @@ namespace Debugger.Tests {
<MethodInfo>Fun</MethodInfo> <MethodInfo>Fun</MethodInfo>
<NextStatement>Start=21,3 End=21,4</NextStatement> <NextStatement>Start=21,3 End=21,4</NextStatement>
</LastStackFrame> </LastStackFrame>
<ProcessExited />
</Test> </Test>
</DebuggerTests> </DebuggerTests>
#endif // EXPECTED_OUTPUT #endif // EXPECTED_OUTPUT

30
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Stepping.cs

@ -41,44 +41,34 @@ namespace Debugger.Tests {
public void Stepping() public void Stepping()
{ {
StartTest("Stepping.cs"); StartTest("Stepping.cs");
WaitForPause();
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement); ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepOver(); // Debugger.Break process.SelectedStackFrame.StepOver(); // Debugger.Break
WaitForPause();
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement); ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepOver(); // Debug.WriteLine 1 process.SelectedStackFrame.StepOver(); // Debug.WriteLine 1
WaitForPause();
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement); ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepInto(); // Method Sub process.SelectedStackFrame.StepInto(); // Method Sub
WaitForPause();
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement); ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepInto(); // '{' process.SelectedStackFrame.StepInto(); // '{'
WaitForPause();
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement); ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepInto(); // Debug.WriteLine 2 process.SelectedStackFrame.StepInto(); // Debug.WriteLine 2
WaitForPause();
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement); ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepOut(); // Method Sub process.SelectedStackFrame.StepOut(); // Method Sub
WaitForPause();
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement); ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepOver(); // Method Sub process.SelectedStackFrame.StepOver(); // Method Sub
WaitForPause();
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement); ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepOver(); // Method Sub2 process.SelectedStackFrame.StepOver(); // Method Sub2
WaitForPause();
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement); ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

6
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ValueType.cs

@ -35,12 +35,10 @@ namespace Debugger.Tests {
"DebugType.BaseType" "DebugType.BaseType"
); );
StartTest("ValueType.cs"); StartTest("ValueType.cs");
WaitForPause();
ObjectDump("this", process.SelectedStackFrame.GetThisValue()); ObjectDump("this", process.SelectedStackFrame.GetThisValue());
process.AsyncContinue();
process.WaitForExit(); EndTest();
CheckXmlOutput();
} }
} }
} }

5
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/_Template.cs

@ -26,11 +26,8 @@ namespace Debugger.Tests {
public void Template() public void Template()
{ {
StartTest("_Template.cs"); StartTest("_Template.cs");
WaitForPause();
process.AsyncContinue(); EndTest();
process.WaitForExit();
CheckXmlOutput();
} }
} }
} }

Loading…
Cancel
Save