Types of Breakpoints

You can set the following types of breakpoints in your program:

statement breakpoints
Breakpoints that apply to any source language statement that has executable code associated with it. These include compound statements such as for loop blocks. Statement breakpoints that apply to compound statements may be set at both the entry and exit points of the statement. If the compound statement is a constructor with an explicit initialization list, a breakpoint may be set on the initializer.
function breakpoints
Breakpoints that apply to the entry of a function. Execution stops on entry to the function each time it is called.
virtual function breakpoints
Breakpoints that apply to any virtual class method. When you set a virtual function breakpoint, the breakpoint applies to the selected function, and to any overrides of this function in any derived classes. Execution stops each time the method is invoked on a derived class object, whether or not the derived class redefines the virtual function. Execution also stops in methods invoked on instances of the class for which the breakpoint was set.
template class breakpoints
Breakpoints that apply to all methods of a template class. When you set a breakpoint on a template class, a function breakpoint is set for each nonvirtual function of the template, and a virtual function breakpoint is set for each virtual function of the template. Breakpoints are also set for the functions in each instance of template.
class breakpoints
Breakpoints that apply to all methods of a class. When you set a breakpoint on a class, a function breakpoint is set for each nonvirtual function of the class, and a virtual function breakpoint is set for each virtual function of the class. The virtual function breakpoints also apply to virtual function overrides in any derived classes.
class instance breakpoints
Similar to class breakpoints, but a class instance breakpoint applies only to a particular instance of the class. For example, given the class Bicycle and the declaration of an instance of it, Bicycle ModelZ, if you set an instance breakpoint on the ModelZ instance, any time a Bicycle member function is called for the ModelZ object, a breakpoint is encountered. However, these member function breakpoints do not apply to other objects of class Bicycle.
instruction breakpoints
Breakpoints that apply to a disassembly instruction. You set instruction breakpoints in a disassembly view. Execution stops when the instruction at the specified address is encountered.
ngos2.gif (402 bytes)ngwin.gif (1069 bytes)watchpoints
A watchpoint is in essence a storage change breakpoint. You can set a watchpoint on a variable or at a storage address. Execution stops when the storage pointed to by the variable or address is written to. Each watchpoint applies to the first four bytes of storage pointed to.

Two additional breakpoints are automatically created and enabled for you. An entry point breakpoint applies to the start of the main function of your program. This breakpoint causes execution to stop in main when you start debugging your program. A terminate breakpoint applies to the termination of your program. This breakpoint causes execution to stop when the process ends (for example, through a return from main or a call to exit) but before the console window for the process has closed, if a console window exists.

A breakpoint is automatically set and enabled at WinMain

Three additional breakpoints are created for you, but they are initially disabled. They are:

When you remove, enable, or disable a breakpoint that has child breakpoints (for example, a class breakpoint, which has breakpoints set on each of its methods), the change affects the parent breakpoint as well as its children.



Set a Template Class Breakpoint
Set a Class Breakpoint
Set a Class Instance Breakpoint
Set a Function Breakpoint
Set an Instruction Breakpoint
Set a Statement Breakpoint
Set a Statement Entry Breakpoint
Set a Statement Initializer Breakpoint
Set a Statement Exit Breakpoint
Set a Virtual Function Breakpoint
ngos2.gif (402 bytes)ngwin.gif (1069 bytes)Set a Watchpoint
Enable, Disable, or Delete Breakpoints from a Breakpoints View


Tree Structure of the Breakpoints View