Share via


Debugger.CurrentStackFrame (Propiedad)

Establece u obtiene el marco de pila actual.

Espacio de nombres:  EnvDTE
Ensamblado:  EnvDTE (en EnvDTE.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: EnvDTE.StackFrame
Un objeto StackFrame.

Comentarios

CurrentStackFrame establece o devuelve un objeto StackFrame. Vea Administración de memoria: asignación de marcos para obtener más información acerca del marco de pila.

Ejemplos

En el siguiente ejemplo se muestra cómo utilizar 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(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

Seguridad de .NET Framework

Vea también

Referencia

Debugger Interfaz

EnvDTE (Espacio de nombres)