This documentation is archived and is not being maintained.

Breaking Execution

When you are debugging an application with the Visual Studio debugger, your application is either running (executing) or it is in break mode. Many debugger features, such as evaluating expressions in the Watch window, are available only in break mode.

The debugger breaks execution of the program when execution reaches a breakpoint or when an exception occurs. For more information, see Handling Exceptions. You can break execution manually at any time.

To break execution of your program manually

  • From the Debug menu, choose Break All.

    The debugger stops execution of all programs running under the debugger. The programs do not exit and you can resume execution at any time. The debugger and your application are now in break mode.

    Note   If a native program cannot be stopped for some reason (for example, the program is executing in kernel mode), the debugger freezes all threads and simulates a break. This is known as a "soft break." If you choose an execution command such as Go or Step after a soft break, the debugger reactivates (thaws) the threads. As a result, you may need to choose the Go or Step command twice for execution to resume. A message box informs you when a soft break has occurred.

If you are debugging multiple programs, a Break All command or breakpoint affects all programs being debugged by default. You can change this default if you want to break only the current program.

To change break behavior when debugging multiple programs

  1. From the Tools menu, choose Options.
  2. In the Options dialog box, select the Debugging folder.
  3. In the Debugging folder, select the General page.
  4. In the General group, select or clear In break mode, only stop execution of the current process.

See Also

Execution Control | Visual Studio Debugger Model