Progress
Debugger Guide
Executing a Specified Number of Lines
Both the STEP and NEXT commands execute a procedure one or more lines at a time. However, the STEP command “steps into” any called subprocedure, continuing for the specified number of lines in the called subprocedure. The NEXT command “steps over” any called subprocedure, treating it as a statement and continuing execution for the specified number of lines in the current procedure. The NEXT command also honors breakpoints in the current or any called subprocedure, and completes execution at the first breakpoint encountered, stopping in a called subprocedure, if necessary. The STEP command ignores breakpoints; it always executes the number of lines you specify up to the application termination point.
STEP Command Subprocedure Processing
When the STEP command executes any line that calls a subprocedure, it performs these actions:
- Executes any statements on the line before the subprocedure call.
- Pushes the current (calling) procedure onto the procedure call stack, and executes the called subprocedure.
- Continues execution from the first executable line of the called subprocedure up to the last line specified for the STEP command.
- When the STEP command stops in a subprocedure, the subprocedure becomes the current procedure and the Debugger displays its listing with the line pointer on the next line to execute.
For example, suppose you are running the procedure fragments
dbmain.p
anddispmsg.p
. In the Debugger, you are stopped on line 23 ofdbmain.p
and you have set a breakpoint on line 13 ofdispmsg.p
:
You then enter this STEP command:
The procedure
dbmain.p
executes through line 25 (two lines) where it callsdispmsg.p
after executing the assignment toDisplayMsg
. The proceduredispmsg.p
then continues execution for five more executable lines (including the procedure call plus lines 9 through 13), and stops on line 14 displaying the following listing. Note that line 12 is considered nonexecutable and part of line 13 because it contains only part of a statement:
NEXT Command Subprocedure Processing
When the NEXT command executes a line that calls a subprocedure, it performs these actions:
- Executes any statements on the line before the subprocedure call.
- Executes the called subprocedure.
- If there are no breakpoints in the called subprocedure, it completes the called subprocedure and any remaining statements on the line.
If it reaches a breakpoint, it pushes the current (calling) procedure onto the procedure call stack, and stops on the breakpoint line, making the procedure where the breakpoint occurred the current procedure and displaying its listing in the Debugger window.
For example, suppose you are running the procedure fragments
dbmain.p
anddispmsg.p
. In the Debugger, you are stopped on line 23 ofdbmain.p
and you have set a breakpoint on line 13 ofdispmsg.p
:
You then enter this NEXT command:
The procedure
dbmain.p
executes through line 25 (two lines) where it callsdispmsg.p
after executing the assignment toDisplayMsg
. The proceduredispmsg.p
then continues execution through line 12, and stops at the breakpoint on line 13 displaying the following listing:
Without the breakpoint in
dispmsg.p
,dbmain.p
executes three executable lines stopping on line 26 at the RETURN statement.STEP and NEXT Commands Inside a Subprocedure
From the current stopping point in the subprocedure, you can now execute any control flow command. If you invoke a STEP or NEXT command on the last executable line of the subprocedure, it performs these actions:
- Executes the last line of the subprocedure.
- Returns to the calling procedure, executing any remaining statements on the line of the subprocedure call.
- Continues on to the next executable line after the subprocedure call and executes the number of executable lines specified for the STEP or NEXT command minus one.
Thus if you invoke a one-line STEP or NEXT command on the last line of the subprocedure, it stops execution on the next line after the subprocedure call.
For example, suppose you are stopped on the last executable line of
dispmsg.p
:
You then enter the NEXT command:
This both executes the last line in
dispmsg.p
and completes execution of the line indbmain.p
(line 25) that called dispmsg.p, stopping on line 26 ofdbmain.p
and displaying the following listing:
Menu Options for the STEP and NEXT Commands
You can execute the STEP and NEXT commands by choosing the corresponding Debug
Step and Debug
Next options. Each option immediately invokes the specified command to execute a single line.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |