TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Using Breakpoints

A breakpoint is a location (a point) in a program where the debugger is instructed to suspend (to break) the program execution. When execution commands are given, the debugger ensures that when execution reaches set breakpoints, the program `breaks' —— that is, the program stops executing.

Note that object values, breakpoints, and exception handling can also be changed while the program is executing. You can set a breakpoint at a program unit ( function, class, package, task, or subprogram), a statement, or a declaration. Breakpoints have a state, a type, and a number.

In Ada, you can set breakpoints in a generic instantiation. To do so, enter a subprogram in the instance (e.g. e foo) and set the breakpoint(s). You can also set breakpoints in a generic instantiation if you are currently executing code inside the instance (e.g., you've stepped into the subprogram of an instance).

If you position yourself in the source of a generic unit through some other method than described above, you cannot set breakpoints in the source of the generic unit. Attempting to do this causes an error message to be displayed: no instructions at this line. This happens, for example, if you position yourself in the source of the generic unit.

The debugger deletes all breakpoints upon exit.

Breakpoint States: Active and Inactive

When a breakpoint is active, it is installed in the program being debugged and will stop a task in which execution reaches the location where the breakpoint is placed (and breakpoint conditions are satisfied). Execution is stopped before the statement is executed. When a breakpoint is inactive, it has no effect on the execution of the program.

Active breakpoints are indicated by a red stop sign in the Source Window of the Debugger Window. Inactive breakpoints are indicated by a green stop sign.

Breakpoint Types: Permanent and Temporary

Permanent breakpoints remain active as long as the program runs under the debugger or until they are explicitly removed. Temporary breakpoints are automatically deactivated after the first time they are encountered.

Breakpoint Numbers

Each breakpoint is numbered. When a breakpoint is encountered, the breakpoint number, location, and task name appear in the Debugger window.

Conditional Breakpoints

Conditional breakpoints are those breakpoints which allow alternate execution paths based on the result of a specified expression. The user can enter a series of statements/commands to be executed depending on the boolean value of the specified conditional expression. If no statements are entered for a given condition result (True or False), execution continues transparently to the user if the expression evaluates to that condition. These commands are listed in Using the Apex Debugger.

Watchpoints

A watchpoint is a special breakpoint attached to a memory location. The Debug > Watch Data command is used to set a watchpoint. On some systems, watchpoints provide an interface to special debugging hardware.

Replacing Existing Breakpoints

If you attempt to add a new breakpoint that matches an existing breakpoint, no new breakpoint is added; rather, the old breakpoint is modified (if necessary) to match the desired new breakpoint.

Two breakpoints match if they specify the same locations, tasks, and count. If either or both have a break condition, then they do not match.

If the old breakpoint is inactive, it is made active if the new breakpoint command specified that the new breakpoint be created active, and vice versa.

Additonal information about breakpoints can be found in Using the Apex Debugger.


Rational Software Corporation 
http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2001, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS