// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; namespace Debugger.Tests { public class StackFrame_Lifetime { 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 StackFrame_Lifetime() { StartTest(); StackFrame stackFrame = process.SelectedStackFrame; ObjectDump("SelectedStackFrame", process.SelectedStackFrame); process.Continue(); // Go to the SubFunction ObjectDump("Old StackFrame", stackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame); process.Continue(); // Go back to Function ObjectDump("Old StackFrame", stackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame); process.Continue(); // Setp out of function ObjectDump("Main", process.SelectedStackFrame); ObjectDump("Old StackFrame", stackFrame); ObjectDump("SelectedStackFrame", process.SelectedStackFrame); EndTest(); } } } #endif #if EXPECTED_OUTPUT mscorlib.dll (No symbols) StackFrame_Lifetime.exe (Has symbols) Break StackFrame_Lifetime.cs:18,4-18,40 Break StackFrame_Lifetime.cs:25,4-25,40 Break StackFrame_Lifetime.cs:20,4-20,40 Break StackFrame_Lifetime.cs:13,4-13,40
#endif // EXPECTED_OUTPUT