Partager via


Debugger3.CurrentStackFrame, propriété

Obtient ou définit le frame de pile actuel.

Espace de noms :  EnvDTE90
Assembly :  EnvDTE90 (dans EnvDTE90.dll)

Syntaxe

'Déclaration
Property CurrentStackFrame As StackFrame
    Get
    Set
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)

Valeur de propriété

Type : EnvDTE.StackFrame
Objet StackFrame.

Implémentations

Debugger2.CurrentStackFrame

Notes

Pour plus d'informations sur le frame de pile, consultez Memory Management: Frame Allocation.

Exemples

L'exemple suivant montre comment utiliser la propriété CurrentStackFrame.

Pour tester cette propriété :

  1. Définissez un point d'arrêt dans l'application cible. Exécutez le complément.

    Le frame de pile actuel est vide.

  2. Définissez un point d'arrêt dans l'application cible. Exécutez l'application cible en mode débogage. Lorsque le programme s'arrête au point d'arrêt, exécutez le complément.

    Le frame de pile actuel contient le nom de méthode et le type de retour.

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

Sécurité .NET Framework

Voir aussi

Référence

Debugger3 Interface

CurrentStackFrame, surcharge

EnvDTE90, espace de noms