Export (0) Print
Expand All

Using the Breakpoints Window

The Breakpoints window lists all breakpoints currently set in your program and displays their properties. In the Breakpoints window, you can set (create) new breakpoints, delete breakpoints, enable or disable breakpoints, edit a breakpoint's properties, or find the source or disassembly code corresponding to a breakpoint. For more information, see Breakpoints Window.

This topic contains information on:

Displaying the Breakpoints Window

To display the Breakpoints window

  • From the Debug menu, choose Windows and click Breakpoints.

Viewing Breakpoint Information

The Breakpoints window contains a list of all breakpoints currently set in your program. This list contains three columns of information by default. You can view additional information by adding more columns.

To display additional columns

  • In the toolbar at the top of the Breakpoints window, click the Columns tool and select the name of the column you want to display.

To widen or narrow a column

  • Click the column divider and drag the divider left or right.

To hide a column

  • In the toolbar at the top of the Breakpoints window, click the Columns tool and deselect the name of the column you want to hide.

    -or-

    Drag the column divider to narrow the column width to zero.

To rearrange the order of the columns

  • Drag and drop the column header.

Child Breakpoints

When you look at the Breakpoints window, you may notice a tree control in the Name column for certain breakpoints. This control enables you to expand a breakpoint that has children.

Child breakpoints result when two or more breakpoints are created from a single breakpoint request. (A breakpoint request is the act of setting a breakpoint.) These children may be created at the time you set the breakpoint or later on.

If you set a breakpoint on an overloaded function, for example, the debugger creates child breakpoint for each unique function. These children appear immediately.

If you attach to a second instance of a program being debugged, the debugger creates two children for each existing breakpoint. The Program column shows which instance each child belongs to.

You can disable child breakpoints individually, but you cannot remove a child except by removing the parent. If you try to delete a child, it becomes disabled instead. The debugger remembers child breakpoints (enabled/disabled state of each child) between debugging sessions.

Enabling or Disabling Breakpoints

A check box appears in the Name column next to each breakpoint. The state of this check box tells you whether the breakpoint is enabled or disabled.

To enable or disable a single breakpoint

  • Select or clear the check box next to that breakpoint.

If a breakpoint has children, enabling or disabling the breakpoint enables or disables the children.

Setting, Deleting, and Editing Breakpoints

To set a new breakpoint

  1. In the toolbar at the top of the Breakpoints window, choose the New Breakpoint icon.
  2. In the New Breakpoint dialog box, choose the type of breakpoint and the options you want.
  3. Click OK.
    Caution   Avoid setting breakpoints on system components when you are debugging mixed-mode (native and managed) code. Setting a breakpoint on a system component during mixed-mode debugging can cause the common language runtime to break and the debugger to hang. For more information, see Mixed-Mode Debugging.
    Note   In the Visual C++ 6.0 debugger, you needed to specify the names of the DLLs you wanted to debug (in the Additional DLLs dialog box). In the Visual Studio .NET debugger, you can set a breakpoint on a DLL that is not yet loaded. The Additional DLLs dialog box no longer exists.

To delete a breakpoint

  1. In the Breakpoints window, click the breakpoint you want to delete.
  2. In the toolbar at the top of the window, choose the Delete tool.

To edit a breakpoint

  1. In the Breakpoints window, click the breakpoint you want to edit.
  2. In the toolbar at the top of the window, choose the Properties tool.
  3. In the Breakpoint Properties dialog box, choose the type of breakpoint and the options you want.
  4. Click OK.

Viewing the Location of a Breakpoint

For breakpoints that are set on a source file location or memory address, you can view the breakpoint location in the source file or disassembly code. (A breakpoint set on a variable, called a data breakpoint, has no such location.)

To view the location of a breakpoint in the source code

  1. In the Breakpoints window, click the breakpoint you want to view.
  2. In the toolbar at the top of the window, choose the Go To Source Code tool.

    For breakpoints without locations, the Go To Source Code tool is disabled.

To view the location of a breakpoint in the disassembly code

  1. In the Breakpoints window, click the breakpoint you want to view.
  2. In the toolbar at the top of the window, choose the Go To Disassembly tool.

For breakpoints without locations, the Go To Source Code tool is disabled.

You can automate many debugger features by using the Visual Studio extensibility model. For more information, see the Visual Studio Debugger Model.

See Also

Breakpoints | Why Do Breakpoints Fail when Multiple Source Files Have the Same Name?

Show:
© 2014 Microsoft