In This Book

Using Breakpoints When Debugging Loops

The breakpoint command option -after count is useful for debugging large

 

loops in code. The -after count option speci￿es that the statement asso ciated

 

with the breakpoint must execute count times before execution is interrupted.

3

This lets you control how many iterations of the loop occur before the debugger

 

interrupts target program execution.

 

Also note that if you try to set a breakpoint at the beginning or end of a loop,

 

the following warning may be displayed:

 

(Warning) Due to optimization, address resolved

 

to more than one location

 

Although the code may not be optimized, lines at the beginning and end of

 

loops contain multiple fragments. You will need to follow the instructions on

 

setting breakpoints in optimized code described in the online help.

 

Using the Break Menu

 

A variety of breakpoint commands are available from the Break menu,

 

including support for setting breakpoints in C++ programs. Many entries on

 

the Break menu allow you to set a breakpoint associated with an expression

 

entered in the ( ): input box.

 

An easy way to enter tokens in the ( ): input box is to use the mouse to

 

highlight expressions in the source display. Highlight by dragging with the

 

left mouse button depressed. When you release the left mouse button, the

 

expression appears in the ( ): input box.

 

Using Monitors (Breakpoints, Watchpoints, Traces, and Intercepts) 3-5