The automation object model provides a Debugger
object that enables you to control the Visual Studio debugger. You can obtain a Debugger
instance through the DTE.Debugger
property.
Dim debugger As EnvDTE.Debugger
debugger = DTE.Debugger
With a valid Debugger
object, you can do the following:
Set breakpoints
Start and stop the debugger for a given process
Control the various execution stepping actions supported by the debugger, such as Step Into, Step Over, and Step Out
Issue the Run to Cursor command to the debugger
Query the debugger for its current mode (for example, break mode, design mode, or run mode)
The following code starts the debugger if it isn’t already started.
Debugger2 debugger = (Debugger2)_applicationObject.Debugger;
If (debugger.CurrentMode != dbgDebugMode.dbgRunMode)
{
debugger.Go();
}