次の方法で共有


Debugger.CurrentStackFrame プロパティ

更新 : 2007 年 11 月

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

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

構文

'宣言
Property CurrentStackFrame As StackFrame
'使用
Dim instance As Debugger
Dim value As StackFrame

value = instance.CurrentStackFrame

instance.CurrentStackFrame = value
StackFrame CurrentStackFrame { get; set; }
property StackFrame^ CurrentStackFrame {
    StackFrame^ get ();
    void set (StackFrame^ value);
}
function get CurrentStackFrame () : StackFrame
function set CurrentStackFrame (value : StackFrame)

プロパティ値

型 : EnvDTE.StackFrame

StackFrame オブジェクト。

解説

CurrentStackFrame は、StackFrame オブジェクトを設定するか、または返します。スタック フレームの詳細については、「メモリ管理 : フレーム割り当て」を参照してください。

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

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

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

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

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

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

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

アクセス許可

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

参照

参照

Debugger インターフェイス

Debugger メンバ

EnvDTE 名前空間