Debugger3.CurrentStackFrame Property

Definition

Gets or sets the current stack frame.

public:
 property EnvDTE::StackFrame ^ CurrentStackFrame { EnvDTE::StackFrame ^ get(); void set(EnvDTE::StackFrame ^ value); };

Property Value

A StackFrame object.

Implements

Attributes

Examples

The following example shows how to use the CurrentStackFrame property.

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);  
}  

Remarks

For more information about the stack frame, see Memory Management: Frame Allocation.

Applies to

Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022