Debugger3.CurrentStackFrame Property
Gets or sets the current stack frame.
Assembly: EnvDTE90 (in EnvDTE90.dll)
For more information about the stack frame, see Memory Management: Frame Allocation.
The following example shows how to use the CurrentStackFrame property.
To test this property:
-
Set a breakpoint in the target application. Run the add-in.
The current stack frame is empty.
-
Set a breakpoint in the target application. Run the target application in the debug mode. When the program stops at the breakpoint, run the add-in.
The current stack frame contains the method name and the return type.
public static void CurrentStackFrame(EnvDTE80.DTE2 dte) { // Setup debug Output window. Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput); w.Visible = true; OutputWindow ow = (OutputWindow)w.Object; OutputWindowPane owp = ow.OutputWindowPanes.Add("Current StackFrame Test"); owp.Activate(); owp.OutputString("Current Stack Frame Info: "); EnvDTE90.Debugger3 debugger = (EnvDTE90.Debugger3)dte.Debugger; EnvDTE.StackFrame sf = debugger.CurrentStackFrame; if (sf == null) owp.OutputString("No program is being debugged, Stack Frame is empty."); else owp.OutputString("Function " + sf.FunctionName + " returns type " + sf.ReturnType); }
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.