Share via


Breakpoint Setting

Use the Breakpoints dialog box from the Breakpoints command on the Edit menu to set, remove, disable, enable, or view breakpoints. The breakpoints that you set are saved as a part of your project.

You must have a workspace open before you can set a breakpoint. If no workspace is open, the Breakpoints command does not appear on the Edit menu. You cannot add breakpoints while the debugger is in a run state, unless you are using a hardware debug probe that supports adding breakpoints while the target is running.

You can set breakpoints at a source code line or in the Disassembly window or Call Stack window. You can also set breakpoints either by pressing F9 or by choosing the Breakpoint button on the toolbar.

Data breakpoints have the following restrictions:

  • They must be set on global variables.
  • They must be enabled while in the module or context, or while the .exe is running.
  • They must be disabled when outside the module or context, or when the module is no longer running.
  • They must be set in a source file that has no spaces in its path.
  • They can only be instantiated on a new instance of an existing module if the existing breakpoint was instantiated on one module at a time. If the existing breakpoint was instantiated on multiple modules, either simultaneously, or after a secondary module loaded, the breakpoint cannot be split.
  • When a new module loads and a line contains multiple breakpoints, not all of the same state, the breakpoints are displayed in an undefined state.

There are some places where you should not set breakpoints.

  • If you set a breakpoint at a line with an NOP instruction in the Disassembly window, an error occurs. For example, a NOP in the delay slot, after a branch instruction on MIPS processors, will produce an error.
  • If you set a breakpoint outside the code space of your application, the IDE hangs, and sometimes the target device reboots.

See Also

Setting a Breakpoint at a Source Code Line | Setting a Breakpoint at the Beginning of a Function | Setting a Breakpoint at the Return Point of a Function | Setting a Breakpoint at a Label | Breakpoint Viewing and Enabling

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.