- In a workbench perspective that offers the launch/debug/run action
set (such as the Debug perspective), perform one of the following tasks:
- Select Run > Debug from the workbench menu
bar to open the Debug launch configurations dialog
box.
- Click the down arrow next to the workbench toolbar Debug push
button and choose Debug from the list. This will open
the Debug launch configurations dialog box.
- In the Debug launch configurations dialog
box, perform one of the following tasks:
- Select the Compiled Application node and click
New.
- Right-click the Compiled Application node and
select New from the pop-up menu.
- Double-click the Compiled Application node.
- This will cause the launch configuration tabs and entry fields
to display on the right-hand side of the dialog box.
- In the Name field, enter a name of your
choice for the configuration that you are creating.
- Select the Main tab to bring it to the
foreground.
- In the Main tab Project field,
enter the name of the project that contains the source for the application
that you want to debug. If the application source is not in a workbench project,
enter the name of the project that contains the application that you want
to debug, and then indicate the source search path in the launch configuration
Source tab page.
Rather than enter
a project name in the Project field, you can browse
for the project by clicking Browse.
Completion
of this field is optional but recommended.
- Enter the full path and name of the program that you want to debug
in the Program name field. Alternatively, you can
browse for the program by clicking Browse. Completion
of this field is mandatory.
- In the Program parameters field, enter
any program parameters that are required by the application that you want
to debug. This step is optional.
- Select the Debug initialization check box
to debug code that executes before the main program entry point is called.
You might want to do this if you are debugging C++ code and you need to debug
the constructors for your globally-declared C++ class objects (because such
objects are constructed before main is entered). If the check box is cleared,
the program will run to the main entry point.
- To set the Source Lookup Path, select the Source tab
and perform any of these tasks:
If you want to search for all instances of the source filename in
the source search path, select the Search for duplicate source
files on the path check box. If you select this check box and
the debugger finds multiple instances of the filename, you will be prompted
by a dialog box to choose the correct source file.
- Select the Environment tab to bring it
to the foreground. In the Environment page, you can
set environment variables for your debug session. Settings that you make in
this page will only affect your debug session.
You might need
to set environment variables for a variety of factors, for example, to specify
the location of the executable for an application that is required for the
debug session. To set environment variables in this page, perform any of these tasks:
- By default, the environment variables that are set for your debug session
are as follows:
- If you launched the workbench from your system (for example, from Microsoft® Windows® Explorer),
your system variables are default. These will not display in the Environment page.
- If you launched the workbench from a command line or batch file with environment
variables set, these will be the default environment variables used for the
debug session.
- To add an environment variable for the debug session, click the New button
and then complete the New Environment Variable dialog
box with the appropriate values. The environment variable will be added to
the default environment variables.
- To remove an environment variable for the debug session, select it from
the Environment variables to set list and then choose
the Remove button.
- Select the Common tab to bring it to the
foreground. You can perform any of these tasks in the Common page:
- 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 want the launch configuration
to be stored in the Location of shared configuration field.
Alternatively, you can browse for the project.
- If you want the launch configuration to be displayed as a favorite debug
configuration in the Debug push button favorites menu
or the Debug menu Debug History list,
select the Debug check box.
- If all information mandatory to the launch configuration has been
provided, the Debug and Apply push
buttons will be enabled. Clicking Apply will save
the launch configuration, at which point you can choose to close the dialog
box without launching the debug session or you can click Debug to
launch a debug session using the new launch configuration. If you click Debug,
any changes to the launch configuration will be saved and a debug session
will be launched.
After you have saved a debug launch configuration,
you can edit it. For further information about editing debug launch configurations,
see the related task.
Tip: If you have not yet saved launch
configuration settings and if you have made entries in the launch configuration
settings that you want to remove or change, clicking Revert will
remove all changes that you have made.
- If information mandatory to the launch configuration has not been
provided or if there are errors in the information that you have provided,
messages at the top of the dialog box will indicate what is missing.
- If you did not use the dialog box to launch a debug session (for
example, you used it instead to create and save a launch configuration), click
Close to exit the dialog box when you are finished
working in it.