Compartir a través de


Debugger.CurrentStackFrame Property

Definition

Sets or gets the current stack frame.

public:
 property EnvDTE::StackFrame ^ CurrentStackFrame { EnvDTE::StackFrame ^ get(); void set(EnvDTE::StackFrame ^ value); };
public:
 property EnvDTE::StackFrame ^ CurrentStackFrame { EnvDTE::StackFrame ^ get(); void set(EnvDTE::StackFrame ^ value); };
[System.Runtime.InteropServices.DispId(106)]
public EnvDTE.StackFrame CurrentStackFrame { [System.Runtime.InteropServices.DispId(106)] get; [System.Runtime.InteropServices.DispId(106)] set; }
[<System.Runtime.InteropServices.DispId(106)>]
[<get: System.Runtime.InteropServices.DispId(106)>]
[<set: System.Runtime.InteropServices.DispId(106)>]
member this.CurrentStackFrame : EnvDTE.StackFrame with get, set
Public Property CurrentStackFrame As StackFrame

Property Value

A StackFrame object.

Attributes

Examples

The following example demonstrates how to use the CurrentStackFrame property.

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);  
}  
Shared Sub CurrentStackFrame(ByRef dte As EnvDTE.DTE)  
    Dim sf As EnvDTE.StackFrame = dte.Debugger.CurrentStackFrame  
    If sf Is Nothing Then  
        MessageBox.Show("No program is being debugged, Stack Frame is empty.", _  
                        "Debugger Test - Current Stack Frame Info")  
    Else  
        MessageBox.Show("Function " + sf.FunctionName + " returns type " + _  
                        sf.ReturnType, "Debugger Test - Current Stack Frame Info")  
    End If  
End Sub  

Remarks

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

Applies to