Understanding the IBM WebFacing Tool: A Guided Tour (IBM Illustrated Guide series)

The integrated iSeries debugger has its own debug perspective. This perspective will open when the debugger is started.

Starting the Integrated iSeries Debugger

To start the debug session,

A message appears as shown in Figure 15.10.

Figure 15.10: Debug message

The debug perspective displays, as shown in Figure 15.11.

Figure 15.11: Debug perspective

To activate the debug session, use the browser window:

Working with the Debug Perspective

Tip  

If you had a production library instead of the wflabxx test library, you would need to enable the Update Production Files debug option. You can do this for individual debug sessions in the debug Launch Configurations dialog, or you can use the workbench Preferences option under the Window menu option. In the Preferences dialog select the Debug node and then the iSeries debug node. In the corresponding preferences page check the Update production files check box.

The debug session for the active ORDENTR program starts, and you see three different views as shown in Figure 15.12:

  1. The source view, containing the program source being debugged .

  2. The monitor view, with more information about the program. The active view here is the expression monitor, where you can see the content of your program variables .

  3. The Call stack.

Figure 15.12: Debug perspective with source view and monitor view

To work with the program,

Tip  

You can also double-click in the prefix area to set a breakpoint.

You will notice a small blue icon on the left side of the line, indicating that a breakpoint is set for this line, as shown in Figure 15.14.

Figure 15.14: Selecting a variable to be added to the monitor

To monitor for the content of variable *IN03,

The indicator name is highlighted.

Now the variable *IN03 displays in the Monitors view, as shown in Figure 15.15.

Figure 15.15: Monitors view with variable *IN03

Now add *IN04 to the monitor as well, following the same steps as before.

You are ready to run the application:

The execution will stop on line 130, and you will see line 130 highlighted, as shown in Figure 15.17.

Figure 15.17: Debug window with current line highlighted

Now you can step through the program.

You are on the line that conditions *IN04.

You will come to a statement that calls program SLTCUSTR.

Stepping into a Called Program

Now you can decide whether you want to debug the called program or just let the pro-gram run. If you are not interested in debugging the called program, you would select Step Over or F6 ; that would call the program without debugging it. If you need to debug the programs in the call hierarchy, you would select Step Into. I want to show you how to debug programs in the call hierarchy, so select Step Into on this statement.

You will notice that the program source for the called program, in this case SLTCUSTR, is now loaded into the debugger source view, as shown in Figure 15.19.

Figure 15.19: Source of program SLTCUSTR shown in debugger window

You can now step through this program and complete the following tasks :

Ending the Debug Session

I leave it up to you to work more with the debugger. When you are finished, complete the debug session:

Close the debugger perspective:

You have completed the debugging exercise in Development Studio Client Version 5.0 and can now skip to the "Analysis" heading.

Категории