다음을 통해 공유


Debugger3.CurrentProgram 속성

활성 프로그램을 설정하거나 반환합니다.

네임스페이스:  EnvDTE90
어셈블리:  EnvDTE90(EnvDTE90.dll)

구문

‘선언
Property CurrentProgram As Program
    Get
    Set
Program CurrentProgram { get; set; }
property Program^ CurrentProgram {
    Program^ get ();
    void set (Program^ value);
}
abstract CurrentProgram : Program with get, set
function get CurrentProgram () : Program
function set CurrentProgram (value : Program)

속성 값

형식: EnvDTE.Program
Program 개체입니다.

구현

Debugger2.CurrentProgram

설명

활성 프로그램은 디버거를 통해 표시되는 데이터를 정의하는 프로그램입니다. 디버거는 동시에 여러 프로세스를 디버깅할 수 있지만 한 번에 한 프로세스만 활성이 될 수 있습니다. 자세한 내용은 여러 프로세스 디버깅을 참조하십시오.

예제

Sub DumpStacks()
    ' This macro dumps the stack for each thread 
    ' running in the current program to the 
    ' Command window.  The output format is identical 
    ' to that of the call-stack window except the current
    ' line is not printed.
    Dim d As EnvDTE90.Debugger3
    d = dte.Debugger3
    Dim ow As CommandWindow
    ow = dte.Windows.Item(Constants.vsWindowKindCommandWindow).Object

    If d.CurrentProgram Is Nothing Then
        ow.OutputString("No program is currently being debugged." + _
        vbCrLf)
    Else
        Dim MyThread As Thread
        ow.OutputString("Current Program: " + d.CurrentProgram.Name + _
        vbCrLf)

        For Each MyThread In d.CurrentProgram.Threads
            ow.OutputString("" + vbTab + "Thread _
            (" + Str(MyThread.ID) + " ) " + MyThread.Name + vbCrLf)

            Dim MyFrame As EnvDTE.StackFrame
            For Each MyFrame In MyThread.StackFrames
                Dim strModule As String
                Dim pos As Integer = InStrRev(MyFrame.Module, "\")
                If pos > 0 Then
                    strModule = Right(MyFrame.Module, _
                    Len(MyFrame.Module) - pos)
                Else
                    strModule = MyFrame.Module
                End If

                Dim strFName As String = MyFrame.FunctionName
                'Create the argument list.
                Dim strArgs As String
                Dim MyArg As Expression
                Dim i = 0
                For Each MyArg In MyFrame.Arguments
                    If i > 0 Then
                        strArgs = strArgs + ", "
                    End If
                    strArgs = strArgs + MyArg.Type + " " + _
                    MyArg.Name + "=" + MyArg.Value
                    i = i + 1
                Next
                'Output the frame information.
                ow.OutputString("" + vbTab + vbTab + strModule + ": _
                " + strFName + "(" + strArgs + ")" + vbCrLf)
            Next
        Next
    End If
End Sub

.NET Framework 보안

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

참고 항목

참조

Debugger3 인터페이스

CurrentProgram 오버로드

EnvDTE90 네임스페이스