Compartir a través de


Debugger3.CurrentStackFrame (Propiedad)

Obtiene o establece el marco de pila actual.

Espacio de nombres:  EnvDTE90
Ensamblado:  EnvDTE90 (en EnvDTE90.dll)

Sintaxis

'Declaración
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)

Valor de propiedad

Tipo: StackFrame
Un objeto StackFrame.

Comentarios

Para obtener más información acerca del marco de pila, vea Administración de memoria: asignación de marcos.

Ejemplos

En el siguiente ejemplo se muestra cómo usar la propiedad CurrentStackFrame.

Para probar esta propiedad:

  1. Establezca un punto de interrupción en la aplicación de destino. Ejecute el complemento.

    El marco de pila actual está vacío.

  2. Establezca un punto de interrupción en la aplicación de destino. Ejecute la aplicación de destino en el modo de depuración. Cuando el programa se detenga en el punto de interrupción, ejecute el complemento.

    El marco de pila actual contiene el nombre del método y el tipo de valor devuelto.

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

Seguridad de .NET Framework

Vea también

Referencia

Debugger3 Interfaz

EnvDTE90 (Espacio de nombres)