Debugging ILE programs

To debug your Integrated Language Environment® (ILE) programs, use the ILE source debugger.

You can perform the following tasks:

  • Prepare your ILE program for debugging
  • Start a debug session
  • Add and remove programs from a debug session
  • View the program source from a debug session
  • Set and remove conditional and unconditional breakpoints
  • Step through a program
  • Display the value of variables
  • Change the value of variables
  • Display the attributes of variables
  • Equate a shorthand name to a variable, expression, or debug command.

While debugging and testing your programs, ensure that your library list is changed to direct the programs to a test library containing test data so that any existing real data is not affected.

You can prevent database files in production libraries from being modified unintentionally by using one of the following commands:

  • Use the Start Debug (STRDBG) command and retain the default *NO for the UPDPROD parameter.
  • Use the Change Debug (CHGDBG) command.

The ILE source debugger is used to detect errors in and eliminate errors from program objects and service programs. You can use the source debugger to:

  • Debug any ILE CL or mixed ILE language application
  • Monitor the flow of a program by using the debug commands while the program is running.
  • View the program source
  • Set and remove conditional and unconditional breakpoints
  • Step through a specified number of statements
  • Display or change the value of variables
  • Display the attributes of a variable

When a program stops because of a breakpoint or a step command, the applicable module object's view is shown on the display at the point where the program stopped. At this point you can enter more debug commands.

Before you can use the source debugger, you must use the debug options parameter (DBGVIEW) when you create a module object or program object using Create CL Module (CRTCLMOD) or Create Bound CL (CRTBNDCL). After you set the breakpoints or other ILE source debugger options, you can call the program.