When debugging a program written in EGL you
use a launch configuration, which specifies where your logic resides
and aspects of the runtime environment. In many cases, you can use
a launch configuration that is provided for you.
The next sections describe how to start debugging a program. In
any case, when you want to end the debugging session, click the Terminate
button of the top of the Debug view and, if you are not in the EGL
perspective, return to the coding task by clicking the EGL perspective
icon at the top right of the workbench.
Starting to debug a program with a provided launch
configuration
You can launch the code in the following
ways:
- Right-click the EGL file that contains the program and click Debug
As > EGL Java Main Application.
- If you are working in the source file that contains the program,
you can do the following procedure instead:
- Use the workbench toolbar. Either click the Debug icon there or
click the down-arrow next to the Debug icon and then click Debug
As > EGL Main Application.
- Alternatively, press F11 or use the topmost menu, where you click .
Creating a launch configuration and starting the debugger
with it
To create a launch configuration:
- Click .The Debug Configurations
dialog is displayed.
- At the left, right click EGL Java Main Application and
click New. You can now create a configuration
by using multiple tabs. The main tab is displayed.
- In the Name field, type a name for the
launch configuration or accept the default. The content of the other
fields are likely to be acceptable, too.
- If you are debugging a program that takes command line arguments,
click the Arguments tab. List the arguments
for the program, in the order that you would use on a command line.
- If you need to use a different JRE than the default for this project,
click the JRE tab and complete the information
there.
- If you need additional Java™ classes
to run the program, specify the paths for those classes on the Classpath tab.
- If you need to add any other source files, specify them on the Source tab.
- To set environment variables for the duration of the debug session,
type the variable names and values on the Environment tab.
- To define general information, for example about input sources,
update the Common tab.
- To save your changes, click Apply. To undo
your changes, click Revert.
To start the debugger with the new launch configuration,
click Debug.
Accessing a launch configuration and starting the
debugger with it
To access an existing launch configuration:
- Click the arrow next to the Debug button on the toolbar. A popup
menu is displayed.
- Click Debug Configurations. The Debug Configurations
dialog is displayed.
- At the left, expand EGL Java Main Applications and
click the launch configuration of interest. If the launch configuration
was created for you, the name is the fully qualified type; for example, myPkg.MyProgram.
After
you select a configuration, the Debug Configurations dialog is displayed.
You can update the configuration, as described in the
earlier section on creating one.
To start the debugger with
the currently selected configuration, click Debug.