Progress
ADM 2 Guide
The Progress Debugger
The Progress Debugger enables you to move automatically from object to super procedure, and from event publisher to subscriber. You can use this tool to follow the flow of control among the persistent procedures that make up an application.
Here is an effective way to begin a debugging session for a SmartObject application:
- Choose a starting point for a debugging session by picking the event procedure where you want to start tracking the program flow. You can find this procedure in the Procedure Object Viewer.
- Create a local version of that event procedure or function in the SmartObject where you want to begin tracing behavior.
- In that procedure or function, insert the following statements before the RUN SUPER statement:
- Save this object and run the SmartWindow that contains it. The Debugger starts up the first time that procedure or function executes.
- When the Debugger starts up, use the STEP command, which causes the Debugger to step into the super procedure version of that same procedure. This effectively puts a breakpoint at the start of an internal procedure or function in a super procedure without the necessity of editing the super procedure itself.
Alternatively, if you run your Progress session with the -debugalert startup option, you can simply code a message statement in Step 3, instead of explicitly invoking the Debugger; for example:
Then, when you run your application and the message alert box appears, press the HELP button to see a stack trace of the Progress 4GL code and determine where you are in the application. If you now press the Debug button on the stack trace window and the OK button on the original message alert box, Progress invokes the Debugger to allow you to move through the application from that point. (If you do not want to enter the Debugger, do not press the Debug button.)
Debugger Tips
Here are some useful notes for using the Debugger:
- When the Debugger is at a RUN SUPER statement, a STEP command steps into the code in the next super procedure up the chain.
- When the Debugger is at a PUBLISH statement, a STEP command steps into the event procedure in the first subscriber for that event. Continuing to STEP or NEXT through the code walks through all subscribers to that event.
- To display what procedure is executing, use the THIS–PROCEDURE:FILE–NAME expression.
- To display the name of the SmartObject on whose behalf a super procedure routine is executing, use the TARGET–PROCEDURE:FILE–NAME expression.
- To display the name of the calling procedure, use the SOURCE–PROCEDURE:FILE–NAME expression.
- To ensure that the Debugger has access to all procedures you want to walk through, be sure to add the
%DLC/src
directory to the PROPATH after thegui
directory.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |