Debugging a batch application with full prompt

To debug a batch application with a full prompt of launch parameters, you create a launch configuration for the debug session.

About this task

To create a launch configuration, do the following:

Procedure

  1. Open the Debug launch configurations dialog box. Instructions for doing this can be found in Starting to debug.
  2. In the left side of the Debug launch configurations dialog box, right-click i: Debug Batch Application and select New from the pop-up menu.
  3. In the launch configuration Name field, enter a unique name of your choice for the configuration that you are creating.
    Tip: This name will show up in the Debug menu for relaunching.
  4. Select the launch configuration tabs and complete them according to the tables in the sections below:
  5. When all information mandatory to the launch configuration has been provided, the Debug and Apply push buttons are enabled. Click Apply to save the launch configuration to run later, or click Debug to launch a debug session with the new settings now. Your application will run in a batch job that is submitted by the debugger.

    After you have saved a debug launch configuration, you may edit it. For further information about editing debug launch configurations, see the related task below.

    Tip: If you have not yet saved launch configuration settings and if you have made entries in the launch configuration settings that you would like to remove or change, clicking Revert removes all changes that you have made.
  6. To dismiss the dialog without starting a debugging session, click Close.

What to Debug tab

About this task

Select the What To Debug tab to bring it to the foreground. Unless otherwise specified, all fields in this tab must be completed before a debug session can be started.

Group Settings
Connection In this section you select the name of an existing Remote System connection from the pull down menu. This connection must be for the IBM® i server that contains the application that you wish to debug. If the connection has not yet been created, click New to launch a wizard that will allow you to create a new connection.
Programs or service programs to be debugged In this section you enter information about the programs and service programs that you will debug. You can specify multiple programs. Click Add to add a program or service program to the list.
  1. Library: In the Add a program or service program dialog, in the Library field, enter the library that contains the program that you want to debug. Valid library name specification information can be found in the related topic below. Select Browse if you want to browse for the library.
  2. Select Program or Service Program and enter the name in the appropriate field. Select Browse if you want to browse a list of the programs or service programs available in the specified library on the IBM i.
  3. Click OK.
Step into If this check box is not selected, the debugger will stop at the first encountered breakpoint. This could be a profile breakpoint (one that you set in a previous debug session) or a source breakpoint (one that you set in the Debugger editor before starting to debug).

If Step into is selected:

  • If you specified programs or service programs to debug in the Programs or service programs to be debugged group, the debugger steps into the first encountered program object (from the list).
  • If you did not specify any program or service program, the debugger stops at the next debuggable entry in the application.
Terminate debug session on program completion If this check box is selected and a valid initial program (but not a service program) is specified in the Programs or service programs to be debugged group, the debug session will end when the program runs to completion.
Update production files If this check box is selected, the application under debug will be allowed to update database records in production libraries.

How To Start tab

About this task

Use this page to specify the IBM i command for submitting your application to batch. You must use the SBMJOB command for this.

In this page, the Prompt button provides a convenient way of supplying SBMJOB parameters. The debugger will use the HOLD(*YES) parameter for the SBMJOB command.

If you completed the What to Debug tab with an initial program, or if you chose the application to debug from the Remote System Explorer or i Project Navigator, the command is automatically created for you.

Source tab

About this task

Group Settings
Source Lookup Path By default, the i Default and Debug engine source containers are listed. The i Default source container allows the debugger to look for the source in the location from which the program object is compiled. The Debug engine source container provides the text for views other than *SOURCE view (for example, *LISTING view or *STATEMENT view). You can specify your own source lookup path:
  1. Click Add to add your own IFS source path.
  2. In the Add Source dialog, click IBM i Source Physical File or Remote Folder.
    • Select IBM i Source Physical File if your source resides in source physical files. Click OK. In the "Select one or more source physical files" dialog, navigate to your source physical files.
    • Select Remote Folder if your source resides in the IFS. Click OK. In the "Browse for a folder" dialog, navigate to the remote folder containing your source.
  3. Click OK. Your source is added to the list under Source Lookup Path.
  4. Click Apply. You can add multiple source paths. The sequence in which they are listed is the sequence in which the debugger searches for the source.
Search for duplicate source files on the path If this check box is not selected, the debugger searches the specified paths in sequence and uses the first occurrence. If this check box is selected, the debugger searches the specified paths and lists all occurrences, allowing you to select one.

Common tab

About this task

Select the Common tab to bring it to the foreground and do the following:

  1. If you want the launch configuration to be stored locally and available for a single user, ensure that the Local radio button is selected. If the launch configuration is to be stored as a file in the workspace and shared in a repository for team use, select the Shared radio button and enter the project location where you wish the launch configuration to be stored in the Location of shared configuration field. Alternatively, you can browse for the project.
  2. If you want the launch configuration to appear in the Debug favorites menu or the Debug menu Debug History list, select the Debug check box in the Display in favorites menu area.

Feedback