Partilhar via


Debugger.Break(Boolean) Method

Definition

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

void Break(bool WaitForBreakMode = true);
[System.Runtime.InteropServices.DispId(7)]
public void Break (bool WaitForBreakMode = true);
[<System.Runtime.InteropServices.DispId(7)>]
abstract member Break : bool -> unit
Public Sub Break (Optional WaitForBreakMode As Boolean = true)

Parameters

WaitForBreakMode
Boolean

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.

Attributes

Examples

The following example demonstrates how to use the Break method.

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.");  
}  
Shared Sub Break(ByRef dte As EnvDTE.DTE)  
    dte.Debugger.Break(False)  
    MessageBox.Show("The process is paused. Examine the values of variables.", _  
                    "Debugger Test - Break Test")  
End Sub  

Remarks

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

Applies to