Share via


Proprietà Debugger.CurrentStackFrame

Imposta o ottiene lo stack frame corrente.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.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

CurrentStackFrame imposta o restituisce a StackFrame oggetto.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(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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Debugger Interfaccia

Spazio dei nomi EnvDTE