Proprietà Debugger2.CurrentStackFrame

ottiene o imposta lo stack frame corrente.

Spazio dei nomi:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Sintassi

'Dichiarazione
Property CurrentStackFrame As StackFrame
StackFrame CurrentStackFrame { get; set; }
property StackFrame^ CurrentStackFrame {
    StackFrame^ get ();
    void set (StackFrame^ value);
}
abstract CurrentStackFrame : StackFrame with get, set
function get CurrentStackFrame () : StackFrame
function set CurrentStackFrame (value : StackFrame)

Valore proprietà

Tipo: EnvDTE.StackFrame
In StackFrame oggetto.

Note

vedere Gestione della memoria: allocazione di frame per ulteriori informazioni sullo stack frame.

Esempi

Nell'esempio seguente viene illustrato come utilizzare CurrentStackFrame proprietà.

Per verificare questa proprietà:

  1. Impostare un punto di interruzione nell'applicazione di destinazione.eseguire il componente aggiuntivo.

    lo stack frame corrente è vuoto.

  2. Impostare un punto di interruzione nell'applicazione di destinazione.Eseguire l'applicazione di destinazione in modalità di debug.Quando il programma si interrompe al punto di interruzione, eseguire il componente aggiuntivo.

    Lo stack frame corrente contiene il nome del metodo e il tipo restituito.

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: ");
    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)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);
}
Sub ShowCurrentProcess()
    ' This function displays the current debugger
    ' mode in the output window.
    Dim ow As OutputWindow
    ow = DTE2.Windows.Item(Constants.vsWindowKindOutput).Object

    Dim proc As EnvDTE.Process2
    proc = DTE2.Debugger.CurrentProcess

    If (proc Is Nothing) Then
        ow.ActivePane.OutputString("No process is being debugged")
    Else
        ow.ActivePane.OutputString("" + Str(proc.ProcessID) + ": " + _
        proc.Name + vbCrLf)
    End If
End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Debugger2 Interfaccia

Overload CurrentStackFrame

Spazio dei nomi EnvDTE80