Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CurrentStackFrame Property
Collapse the table of content
Expand the table of content

Debugger3.CurrentStackFrame Property

Gets or sets the current stack frame.

Namespace:  EnvDTE90
Assembly:  EnvDTE90 (in EnvDTE90.dll)

StackFrame CurrentStackFrame { get; set; }

Property Value

Type: EnvDTE.StackFrame
A StackFrame object.



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:

  1. Set a breakpoint in the target application. Run the add-in.

    The current stack frame is empty.

  2. 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 = 
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Current StackFrame 

    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 
        owp.OutputString("Function " + sf.FunctionName +
                         " returns type " + sf.ReturnType);

Community Additions

© 2015 Microsoft