Debugging a program
You must create a debug launch configuration the first time you debug your program.
To create a debug configuration:
- In C/C++ Projects view, select a project.
- Click Run > Debug.
- In the Debug dialog box, select a debug configuration type from the Configurations list.
Click New.
- In the Name box, type a descriptive name for this debug configuration.
- In the Project box, type the name of the project containing the application you want to debug.
- In the C/C++ Application box, type the name of the executable that you want to run.
- Click Debug.
The debug perspective is opened and the application window opens on top. The C/C++ editor window is repositioned in the perspective.
For more information:
- To specify the execution arguments an application uses and the working directory for a run configuration, see Specifying execution arguments.
- To set the environment variables and values to use when an application runs, see Setting environment variables
- To select a debugger to use when debugging an application, see Selecting a debugger
- To specify the location of source files used when debugging a C or C++ application, see Specifying the location of source files
- To specify where the run configuration is stored, how you access it and what perspective to open when running an application, see Specifying the location of the run configuration
To use a debug configuration:
You can reuse a previously created debug launch configuration to debug your program.
- Click Run > Debug.
- In the Debug dialog box, select a debug configuration from the Configurations list.
- Click Debug.