次の方法で共有


Debugger2.CurrentStackFrame プロパティ

現在のスタック フレームを取得するか、または設定します。

名前空間:  EnvDTE80
アセンブリ:  EnvDTE80 (EnvDTE80.dll 内)

構文

'宣言
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)

プロパティ値

型: EnvDTE.StackFrame
StackFrame オブジェクト。

実装

Debugger.CurrentStackFrame

解説

スタック フレームの詳細については、「メモリ管理 : フレーム割り当て」を参照してください。

CurrentStackFrame プロパティの使用方法を次の例に示します。

このプロパティをテストするには

  1. ターゲット アプリケーションにブレークポイントを設定します。 アドインを実行します。

    現在のスタック フレームは空です。

  2. ターゲット アプリケーションにブレークポイントを設定します。 ターゲット アプリケーションをデバッグ モードで実行します。 ブレークポイントでプログラムが停止したら、アドインを実行します。

    現在のスタック フレームには、メソッド名と戻り値の型が格納されています。

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: ");
    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)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

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

Debugger2 インターフェイス

CurrentStackFrame オーバーロード

EnvDTE80 名前空間