Examining the Values of Symbols

In the Source panel:

  1. Make sure your program was compiled using javac -g. You must use the -g flag to get symbol information.

  2. Make sure your program is running and stopped at a breakpoint, with the symbol you want to examine within scope (known to the program at this point in execution).

  3. Make sure the file containing the symbol you want to evaluate is displayed.

    If the file containing the symbol you want to evaluate is not displayed, choose File > Open... to open the file.

    Note: File > Open is not available until you open a project. Do this by double-clicking any project in the Project card.

  4. Find the symbol in the file by scrolling, or by choosing Search > Find...

  5. Select the symbol.

    The value of the symbol appears in a popup label. The popup label is displayed until you move the cursor.

    Note: To switch off symbol evaluation mode in the Source panel, choose File > Preferences... and set the Displayed Delayed Popup Help preference in the Source preferences.

  6. Click the Examine button.

    The symbol is displayed in a table in the Data card. You can examine its value in more detail by double-clicking the symbol, or you can change the view of the symbol using the option menu above the display panel.

  7. To view the value of the same symbol each time a breakpoint is reached or a thread is explicitly suspended, add the symbol to the Expression View table by clicking Add when the symbol is displayed in the Data card.

-or-

In the Command card:

  1. Make sure your program was compiled using javac -g. You must use the -g flag to get symbol information.

  2. Make sure your program is running and stopped at a breakpoint, with the symbol you want to examine within scope (known to the program at this point in execution).

  3. Type print followed by the symbol you want to examine as shown in the following examples:

    print symbol_name

    print object_name

    print array_name

    print array_name[i]

    print object.field_name

See Also

Guide to the Cosmo Code Development Environment
12-96*232