다음을 통해 공유


Debugger3.CurrentStackFrame 속성

현재 스택 프레임을 가져오거나 설정합니다.

네임스페이스:  EnvDTE90
어셈블리:  EnvDTE90(EnvDTE90.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 개체입니다.

구현

Debugger2.CurrentStackFrame

설명

스택 프레임에 대한 자세한 내용은 Memory Management: Frame Allocation을 참조하십시오.

예제

다음 예제에서는 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: ");
    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

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

Debugger3 인터페이스

CurrentStackFrame 오버로드

EnvDTE90 네임스페이스