Debugger3.CurrentStackFrame Свойство
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Возвращает или задает текущий кадр стека.
public:
property EnvDTE::StackFrame ^ CurrentStackFrame { EnvDTE::StackFrame ^ get(); void set(EnvDTE::StackFrame ^ value); };
public:
property EnvDTE::StackFrame ^ CurrentStackFrame { EnvDTE::StackFrame ^ get(); void set(EnvDTE::StackFrame ^ value); };
[System.Runtime.InteropServices.DispId(106)]
public EnvDTE.StackFrame CurrentStackFrame { [System.Runtime.InteropServices.DispId(106)] get; [System.Runtime.InteropServices.DispId(106)] set; }
[<System.Runtime.InteropServices.DispId(106)>]
[<get: System.Runtime.InteropServices.DispId(106)>]
[<set: System.Runtime.InteropServices.DispId(106)>]
member this.CurrentStackFrame : EnvDTE.StackFrame with get, set
Public Property CurrentStackFrame As StackFrame
Значение свойства
Объект StackFrame.
Реализации
- Атрибуты
Примеры
В следующем примере показано, как использовать свойство CurrentStackFrame.
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
Комментарии
Дополнительные сведения о кадре стека см. в разделе Управление памятью: выделение кадров.