In This Book

Specifying Locations

To set a breakpoint at a speci￿c program location, enter the breakpoint command. For example,

breakpoint sum Sets a breakpoint at the ￿rst executable statement in the procedure sum.

breakpoint 16 Sets a breakpoint at the statement on line 16 of the source ￿le.

Specifying Actions

If you want a speci￿c action to occur automatically when the target program encounters a breakpoint, use the -dooption. For example,

breakpoint 43 -do [print tmp; go] -silent

In this example, the debugger prints the variable tmp in the debugger output area, then issues the go command whenever the target program encounters the breakpoint at line 43. The -silentoption prevents the breakpoint from being reported in the debugger output area; only the value of the variable tmp is printed.

Breaking at Blocks or Routines

If you want to set breakpoints at every routine in a block or ￿le, you can do so with a single breakpoint command. Use the -inoption to specify the block name or ￿le name. File names must be enclosed in double quotation marks, as shown in the following example:

breakpoint -in "iface.c" -do [args; go]

For detailed information on how to specify blocks and ￿les, see the online help regarding specifying locations to the debugger.

Setting Breakpoints in Alternate Source Files

When a target program is compiled from m ultiple source ￿les, the Source Display window displays the ￿le that contains the current point of execution.

You can use the environment command with a "￿lename " argument to display another source ￿le in the Source File Display area. Then y ou can set breakpoints using one of the methods described in this section.

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