Share via


Debugger2.Break Method

Causes the given process to pause its execution so that its current state can be analyzed.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Syntax

'Declaration
Sub Break ( _
    WaitForBreakMode As Boolean _
)
void Break(
    bool WaitForBreakMode
)
void Break(
    [InAttribute] bool WaitForBreakMode
)
abstract Break : 
        WaitForBreakMode:bool -> unit
function Break(
    WaitForBreakMode : boolean
)

Parameters

  • WaitForBreakMode
    Type: Boolean

    Set to true to return only when the debugger has entered break mode. Set to false to break and return immediately. See How to: Break Execution for more information.

Remarks

Causes the given process to pause its execution so that its current state can be analyzed.

Examples

The following example demonstrates how to use the Break method.

To test this method:

  1. Use the infinite loop in the target application code.

  2. Run the target application in the debug mode.

    You cannot examine any values of variables while the target is running.

  3. Run the add-in. Examine the values of variables.

public static void Break(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("Break Method 
    Test");
    owp.Activate();

    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)dte.Debugger;
    debugger.Break(false);
    owp.OutputString("The process is paused. Examine the values of 
    variables.");
}

.NET Framework Security

See Also

Reference

Debugger2 Interface

EnvDTE80 Namespace