Progress
Debugger Guide


Sample Session

To begin the session, run the Procedure Editor with the sports database and open p-debug1.p in the buffer. Then, follow these steps:

  1. To start the Debugger for p-debug1.p, choose the Debug option of the Compile menu. The following figure shows starting the Debugger in character mode:
  2. The following figure shows starting the Debugger in Windows:

    The Debugger window opens as the procedure begins and stops at an automatic breakpoint set on the first executable line.

    In Windows, a small octagon indicates a breakpoint and a solid arrow indicates the current executable line on the left side of the procedure listing:

    In Motif, an asterisk indicates a breakpoint and an open arrow indicates the current executable line on the left side of the procedure listing:

    Note how the default buttons appear as the Commands in Queue field decrements; the Debugger executes initial commands to define the buttons.

    The panel above the buttons displays the debug listing of the procedure labeled with a temporary buffer filename. The panel below the buttons displays a command entry area and a list of all entered commands (command history). The Windows command entry area is combined with the command history. The bottom panel displays Debugger data and informational messages.

    NOTE: You might want to size your Debugger window to match the tutorial. You can adjust the vertical size of each panel by dragging the horizontal dividers between the panels in Windows or the tiny boxes between the vertical scroll bars in Motif. Be sure to leave room for both the command history and the command entry area.

  3. To continue, click the mouse pointer on the Step button.
  4. The line pointer advances to the next executable line (line 19) after executing the ON statement that defines a trigger for the space bar ( “ ” ) specified on lines 9 through 17 as shown in the following figure:

    Note the STEP command that scrolled into the command history. You can enter Debugger commands using uppercase or lowercase characters.

  5. Click the mouse anywhere on line 14 and click on the Break button.
  6. This sets a breakpoint on line 14. Note the BREAK command for the current procedure that scrolled into the command history. The Break button definition references the current listing to specify the breakpoint, as shown in the following figure:

  7. Use the mouse to scroll to the bottom of the procedure listing and perform similar actions to set a breakpoint on line 33.
  8. To continue, click on the Cont button.
  9. The application window opens displaying a frame that prompts you for a customer number in the Cust-Num field.

  10. Type 10 in this field, as shown below:
  11. To continue, press Cont.
  12. The Debugger takes control after the procedure retrieves the record for customer number 10 and stops at the breakpoint on line 33, as shown in the figure that follows:

  13. Type display field customer.credit-limit in the command entry area:
  14. Note that the Debugger can reference any field in an accessible record buffer, such as credit-limit, even though it is not referenced in the procedure.

  15. To enter the command, press RETURN.
  16. The Debugger displays the customer credit limit, 22000, in the bottom panel:

  17. Type assign field customer.credit-limit = 15000 in the command entry area and press RETURN.
  18. The Debugger assigns the new credit limit value.

  19. You can use the command history to display the new value. Click the mouse pointer on display field customer.credit-limit in the command history and press RETURN.
  20. The Debugger displays the new credit limit value, as follows:

  21. To continue, click on the Cont button.
  22. The procedure blocks on the UPDATE statement, displaying the specified fields for customer number 10.

  23. Tab to the Sales-Rep field and press the SPACE BAR, as shown below:
  24. This activates the space bar trigger and the Debugger takes control as the procedure stops at the breakpoint on line 14 in the trigger block. Note that the breakpoint for the trigger does not occur on line 9 (the ON statement). The ON statement defines the trigger block (DO statement) on the first executable line where the initial breakpoint is set. The trigger block itself executes in response to the space bar event and stops at the current breakpoint, as shown below:

  25. To see the execution relationship between the procedure and the trigger block, click on the Stack button.
  26. The Stack button enters the SHOW STACK command to display the procedure call stack (see the figure below). The result, in the bottom panel, shows that the trigger is executed as an internal procedure (USER-INTERFACE-TRIGGER( )), stopped at line 14, and that the trigger is invoked by the space bar event while blocked for I/O on line 33 (the UPDATE statement) of the main procedure:

  27. After completing this tutorial and observing the Debugger, you can explore further or type quit in the command entry area to exit both the application and the Debugger.
  28. Press the SPACE BAR in the application window to return to the Procedure Editor.

Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095