Export (0) Print
Expand All

Debugger Interface

The Debugger object is used to interrogate and manipulate the state of the debugger and the program being debugged.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

'Declaration
<GuidAttribute("338FB9A0-BAE5-11D2-8AD1-00C04F79E479")> _
Public Interface Debugger
'Usage
Dim instance As Debugger

/** @attribute GuidAttribute("338FB9A0-BAE5-11D2-8AD1-00C04F79E479") */ 
public interface Debugger
GuidAttribute("338FB9A0-BAE5-11D2-8AD1-00C04F79E479") 
public interface Debugger

The debugger is available through the DTE object by way of its Debugger property, as shown in the example below. One debugger object is available for each instance of the development environment.

The following example demonstrates how to use Debugger object.

Imports EnvDTE
Imports System.Diagnostics

Public Module Module1
    ' This function returns true if the debugger is actively debugging.

    Function IsDebugging() As Boolean
        Dim debugger As EnvDTE.Debugger
        debugger = DTE.Debugger

        If (debugger Is Nothing) Then
            MsgBox("Debugger doesn't exist! Fatal error.")
            IsDebugging = false
        Else
            IsDebugging = (debugger.CurrentMode <> dbgDebugMode.dbgDesignMode)
        End If
    End Function
End Module

Community Additions

ADD
Show:
© 2014 Microsoft