Progress
Debugger Guide
Setting Breakpoints
When you set a breakpoint, you can specify it using either the procedure name, line number, or both, depending on whether the procedure is listed in the Debugger window. As you set it, the Debugger identifies each breakpoint by number, starting at 1. The Debugger indicates the breakpoint location in any listed procedure with a breakpoint indicator. The exact format of the breakpoint indicator differs with each window system. The examples in this section use the Motif format. For more information on breakpoint indicators for each supported window system, see Debugger Window."
Breakpoint Settings and References
This example sets a breakpoint on line 16 of the procedure specified by
arrmenu.p
in the BREAK command:
In response, the Debugger displays this message in the data panel:
The
#2
is the breakpoint number. It indicates that the new breakpoint is the second breakpoint set in the session, andarrmenu.p:16
indicates that the breakpoint is set on line 16 ofarrmenu.p
. You can use this information later to reference each breakpoint accurately and efficiently.Effective Breakpoints
When you specify a breakpoint line, the Debugger always resolves it to an effective breakpoint during procedure execution. In general, an effective breakpoint is the closest executable line on or near the specified line number. More specifically, if the line number specifies a nonexecutable line (for example, a comment or DEFINE statement), the effective breakpoint occurs on the next executable line after the specified line. If the line number is less than 1 or greater than the last executable line, the effective breakpoint occurs on the corresponding first or last executable line in the procedure.
This command sets a breakpoint on the first executable line of the procedure specified by
arrmenu.p
:
Using only the procedure name always sets a breakpoint on the first executable line of the specified procedure.
The following example attempts to set a breakpoint on line 16 of the listed procedure (if there is a listed procedure). If there is no listed procedure, this example does not set a breakpoint, and displays a message that there is no source in which to set a breakpoint:
Again, if you use a line number alone, the BREAK command sets an effective breakpoint on the next or closest executable line.
If the procedure where you set a breakpoint is active in the Debugger context, the Debugger always indicates the breakpoint using the line number of the effective breakpoint if it is different from the specified line number. For example, suppose you list the following procedure in the Debugger context using the FILE command:
If you set a breakpoint on line 1, the Debugger indicates the setting on line 3 in the listing and data panels:
If the procedure is inactive, the Debugger always indicates the breakpoint using the specified line number, because it does not, at that point, know how the procedure executes. However, when the procedure is executed, it always breaks on the effective breakpoint line, regardless of the line number used to specify the breakpoint.
The Debug
Break Option
Choosing Debug
Break also invokes the BREAK command. However, the Debugger displays a dialog box that prompts for the procedure name and line number for the breakpoint. This dialog box provides a default procedure name from the procedure displayed in the listing panel and a default line number from the displayed line selected with the text cursor.
For example, if you have
r-runper.p
listed in the Debugger window and placed the text cursor on line 25 in the listing panel, the dialog box displaysr-runper.p
and 25 as the default procedure and line number. Figure 5–1 shows the Set Breakpoint dialog box in Windows; Figure 5–2 shows it in Motif.Figure 5–1: Set Breakpoint Dialog Box in Windows
![]()
Figure 5–2: Set Breakpoint Dialog Box in Motif
![]()
You can change these defaults as needed. Choosing the Browse button opens a dialog box in which you can enter or select a procedure filename. The Help button displays a Help window that describes how to use this dialog box.
When you choose the OK button, the Break option attempts to set the breakpoint using the BREAK command.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |