Debug the Hello PL/I World Application

Walks you through the process of modifying your application in Eclipse, and then debugging it using the Eclipse debugger.

Enable line numbers

Set breakpoints

Before starting the debugger, set a breakpoint to stop program execution before exiting the console so you can see the output.

  1. In the program editor, double-click in the left-most column on line 8, which reads:
    DO loop = 1 TO 10 BY 1;

    A dot appears in the column to indicate the breakpoint.

  2. Now, double-click in the left-most column on the last line of the program, which reads:
    end HelloPLIWorld;

    Again, a dot appears in the column to indicate the breakpoint.

Debug HelloWorld.pli

Enterprise Developer uses the Eclipse debugger to debug PL/I applications.

  1. In the PL/I Explorer view, select the HelloPLIWorld.pli program.
  2. From the main menu, select Run > Debug.
    Note: If prompted to switch perspective, click Switch.
  3. Press F5 (Step Into) to start stepping through the code.

    The first line in the program executes and the cursor moves to the next line in the code.

  4. Open the Expressions view.
  5. Click the + in it and type SourceString as you are going to monitor this variable during debugging.
  6. Click OK.
  7. Press F5 again.

    This executes the statement that initializes the value for SourceString.

  8. Step through the next few lines in the same way and see how the value of the SourceString variable changes in the Expressions view.
  9. Press F8 to continue to the next breakpoint.
  10. Press F8 again to exit the program.

    Debugging stops.

This completes the tutorial.