// // // // // $Revision$ // using System; namespace Debugger.Tests.TestPrograms { public class FunctionLifetime { public static void Main() { Function(1); System.Diagnostics.Debugger.Break(); // 4 } static void Function(int i) { System.Diagnostics.Debugger.Break(); // 1 SubFunction(); System.Diagnostics.Debugger.Break(); // 3 } static void SubFunction() { System.Diagnostics.Debugger.Break(); // 2 } } } #if TEST_CODE namespace Debugger.Tests { public partial class DebuggerTests { [NUnit.Framework.Test] public void FunctionLifetime() { StartTest("FunctionLifetime.cs"); WaitForPause(); StackFrame stackFrame = process.SelectedStackFrame; ObjectDump("SelectedStackFrame", process.SelectedStackFrame); process.Continue(); // Go to the SubFunction WaitForPause(); ObjectDump("Old StackFrame", stackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame); process.Continue(); // Go back to Function WaitForPause(); ObjectDump("Old StackFrame", stackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame); process.Continue(); // Setp out of function WaitForPause(); ObjectDump("Main", process.SelectedStackFrame); ObjectDump("Old StackFrame", stackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame); process.Continue(); process.WaitForExit(); CheckXmlOutput(); } } } #endif #if EXPECTED_OUTPUT mscorlib.dll FunctionLifetime.exe Break 1 0 False True Function Start=22,4 End=22,40 Break 0 True True Function 0 0 False True SubFunction Start=29,4 End=29,40 Break 0 True True Function 1 0 False True Function Start=24,4 End=24,40 Break
0 0 False True Main Start=17,4 End=17,40
0 True True Function 0 0 False True Main Start=17,4 End=17,40
#endif // EXPECTED_OUTPUT