Hitachi

JP1 Version 12 JP1/IT Desktop Management 2 Distribution Function Administration Guide


17.7.2 Debugging

To facilitate debugging an AIT file, you can stop execution of the AIT file at specific points. When execution of an AIT file is stopped, you can reference or update the values of variables in the Watch window.

You can stop execute of an AIT file:

Organization of this subsection

(1) Setting breakpoints

Breakpoints are the points at which the debugging process stops. You can set breakpoints in any lines, and can enable or disable them. Breakpoints are marked with circles displayed on the left of the Edit window. Colored circles indicate enabled breakpoints and white circles indicate disabled breakpoints. You can remove unnecessary breakpoints. All breakpoints you set will be cleared when you close the AIT file.

You can add, remove, enable or disable breakpoints by using the Breakpoints Setup or Add/Remove Breakpoint menu.

(a) Using the Breakpoints Setup dialog box to set breakpoints

The following procedure shows how to use the Breakpoints Setup dialog box to add, remove, enable or disable breakpoints.

To use the Breakpoints Setup dialog box to set breakpoints:

  1. Open the AIT file. Then, from the Debug menu, choose Breakpoints Setup.

    The Breakpoints Setup dialog box appears.

    Figure 17‒33: Breakpoints Setup dialog box

    [Figure]

    Breakpoint line no.

    In this text box, type in the line number of a line where you want to add a breakpoint, and click the Add button. A breakpoint is set on the specified line.

    Breakpoints

    This list box lists all the breakpoints set in the active AIT file. Breakpoints are indicated with line numbers. When the check box of a breakpoint is selected, the breakpoint is enabled. When the check box of a breakpoint is not selected, the breakpoint is disabled.

    Remove button

    Clicking this button removes the breakpoints at the lines selected in the Breakpoints list box.

    Remove All button

    Clicking this button removes all breakpoints you set.

  2. Set breakpoints, then click the OK button.

    Settings in the Breakpoints Setup dialog box are applied to the Edit window. The following figure shows the Edit window.

    Figure 17‒34: Edit window

    [Figure]

(b) Using Add/Remove Breakpoint to set a breakpoint

The following procedure shows how to add, remove or enable a breakpoint in the Edit window without using the Breakpoints Setup dialog box.

To use Add/Remove Breakpoint to set a breakpoint:

  1. Open the AIT file. Then, position the cursor at a line at which you want to stop the debugging process.

  2. From the Debug menu, choose Add/Remove Breakpoint.

    The operation differs depending on the selected line.

    • Line without a breakpoint:

      An enabled breakpoint is added.

    • Line with an enabled breakpoint:

      The breakpoint is removed.

    • Line with a disabled breakpoint:

      The breakpoint is enabled.

    You can also press F9 as a shortcut, instead of choosing Add/Remove Breakpoint.

(2) Stopping execution of the AIT file at a specific point

You can execute the AIT file from the current point and stop at a specific point.

You can stop execution of the AIT file by:

To terminate debugging, from the Debug menu, choose Stop Debugging.

(a) Stopping execution of the AIT file at breakpoints

You can stop execution of the AIT file at the breakpoints you set. If breakpoints are set on blank, comment, and other non-executable lines, the breakpoints will be moved forward to the nearest executable lines when the debugging starts.

The following procedure shows how to execute the AIT file and stop the execution at breakpoints.

To execute the AIT file, and stop the execution at breakpoints:

  1. Set breakpoints at certain positions in the AIT file.

    For details on how to set breakpoints, see 17.7.2(1) Setting breakpoints above.

  2. From the Debug menu, choose Go.

    The statement is executed to the first breakpoint, with the debug cursor moved to the breakpoint line.

  3. Repeat step 2 to execute the AIT file to the next breakpoint, or select another item in the Debug menu.

(b) Stopping execution of the AIT file before the cursor line

You can stop execution of the AIT file before the cursor line.

To stop execution of the AIT file before the cursor line:

  1. In the AIT file, move the cursor to a position at which you want to stop execution of the file.

  2. From the Debug menu, choose Run to Cursor.

    The statements before the cursor line are executed, with the debug cursor moved to the position specified in step 1.

  3. Repeat steps 1 and 2 to execute the AIT file to the next cursor, or select another item in the Debug menu.

(c) Stopping execution of the script in units of statements

You can stop execution of the script in units of statements to the end of the AIT file or until the debug process is stopped by choosing Stop Debug.

To stop execution of the script in units of statements:

  1. Open the AIT file.

  2. From the Debug menu, choose Step by Step.

    The current statement line is executed, with the debug cursor moved to the next statement line.

  3. Repeat step 2 to execute the current statement line, or select another item in the Debug menu.

(3) Monitoring and changing values of variables

During debugging of an AIT file, you can use the Watch window to monitor the values of the specified variables. When execution of the AIT file stops at a specific position, the Watch window displays the current values of the variables. You can also use the Watch window to change variable values.

The following procedure shows how to monitor the specified variables in the Watch window.

To monitor variables in the Watch window:

  1. During debugging of the AIT file, choose Display and then Watch.

    The Watch window appears.

    Figure 17‒35: Watch window

    [Figure]

  2. In the Variable column, specify a variable name, and press Enter.

    You can also enter a variable name by dragging and dropping it from the Edit window to the Watch window.

    The Watch window displays the values of the variables you entered. Numeric data displayed in decimal by default. This data can also be displayed in hexadecimal if you select Hexadecimal in the menu appearing by right-clicking. String data is displayed as string constants.

    If you specify a variable name not defined in the AIT file, an error message appears.

  3. Execute the AIT file to a specific position.

    The current values of the variables are displayed in the Watch window.

  4. If you want to change the value of a variable, in the Watch window, enter a new value, and press Enter.

    The new value is applied to the script in the AIT file.

You can remove the name of a variable from the Watch window if you do not want to monitor it any longer. To remove a variable name, in the Watch window, select the variable name, and press Delete.