Creating A Debug Configuration

Eclipse allows you to maintain configuration options and preferences from debug session to session via the "debug configuration" mechanism. The first step in debugging under Eclipse is to create such a configuration. You can then reuse the configuration indefinitely, unless/until some aspect changes.

First, open the Debug launch dialog. Select "Open Debug Dialog..." from the Run menu, or click on the down-arrow next to the Debug button on the toolbar and make the same selection there. The following dialog box will appear. (In this figure there are no existing launch configurations; yours may have some already.)

initial debug dialog

In the left-hand pane of the Debug dialog, double click on "C/C++ Local Application."

You should see something like the following:

debug dialog with new empty configuration

From the tabbed dialog on the right, you specify various different configuration options. For instance you specify the name of the configuration, the executable you wish to debug, the arguments you wish to pass to it when it's launched, the environment under which it will run, the debugger to use, etc.

Enter the name for the new configuration at the top of the page. Then, in the "Main" tab, enter the project name and the location of the executable. You can manually enter the project name and executable location or you can browse for them. For example, clicking on the "Search Project..." button will invoke this dialog box:

debug dialog search for exe

Once filled in, the "Main" page will appear something like this:

debug dialog main tab complete

Next you will need to change some settings in the "Debugger" page. Initially the page will appear as follows:

debug dialog debugger tab initial

You may have to experiment with the options to find the combination that works best with your operating system and other installed software.

On a typical Windows XP installation, for example, the following settings in the Debugger tab work well:

If you want to debug library unit elaboration, leave the entry point as "main" and let the debugger stop there. You can then step through the elaboration of all the library units.

Once filled in, the "Debugger" page will appear something like this:

debug dialog debugger tab complete

Generally you can leave the other pages with their default values. If you need to pass command-line arguments to your application when it is being debugged, use the "Arguments" page to specify them.

Press the Apply button to save the changes, and then press either Close or Debug, depending upon whether or not you want to use the configuration immediately.