Debugger.CurrentStackFrame Property

Definition

Sets or gets the current stack frame.

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

Property Value

A StackFrame object.

Attributes

Examples

The following example demonstrates how to use the CurrentStackFrame property.

C#
public static void CurrentStackFrame(DTE dte)  
{  
    // Setup the 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: ");  
    EnvDTE.StackFrame sf = dte.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

CurrentStackFrame sets or returns a StackFrame object. See Memory Management: Frame Allocation for more information about the stack frame.

Applies to

Proizvod Verzije
Visual Studio SDK 2015, 2017, 2019, 2022