Export (0) Print
Expand All

Debugger.Break Method

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

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

void Break (
	[OptionalAttribute] [InAttribute] bool WaitForBreakMode
)
void Break (
	/** @attribute InAttribute() */ /** @attribute OptionalAttribute() */ boolean WaitForBreakMode
)
function Break (
	WaitForBreakMode : boolean
)

Parameters

WaitForBreakMode

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

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

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(DTE dte)
{
    // Setup the 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();

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

Community Additions

ADD
Show:
© 2014 Microsoft