Breakpoints Example

Breakpoints in Eclipse are set in source files, not in programs (as they are in other Micro Focus products ). This means that a single breakpoint may actually be set many times if the source file is used in multiple programs or used multiple times in the same program. For example:

Main.cbl:

Procedure division.
       Copy “code.cpy”.
       …
       Copy “code.cpy”.

Code.cpy:

       Add 1 to count		// set breakpoint here

When a breakpoint is set before debugging is started, or no program that uses the copy file is active, the breakpoint is pending. This means that it has not been resolved to a real code position. When debugging is started or a new program is called, the debugger attempts to resolve all pending breakpoints and bind them to actual code positions.

In the above example, when the main executable is loaded by the debugger it binds the single (pending) breakpoint to two actual (bound) breakpoints. This is shown as a + (plus) added to the breakpoint icon, both in the margin of the editor and in the Breakpoints view. The breakpoints property view shows details of all bound breakpoints, and enables you to configure them.

Related Topics: