Debugging a project
The debugger lets you control the execution of your program by setting breakpoints, suspending executed programs, stepping through your code, and examining the contents of variables.
To debug a project:
- Click the Run > Debug Configurations... menu option.
The Debug Configurations dialog opens.

- Double-click C/C++ Application to create a new launch configuration.

If a project is selected in the Project Explorer view the following data is automatically entered, take a moment to verify its accuracy or change as needed.
- In the Name edit box, type the project name, like bitreverse.
You can now select this debug launch configuration by name the next time that you debug this project.
- In the C/C++ Application edit box, type the name of the executable if its not already entered.
If not, click the Search Project button to locate the executable in the project.
-
In the Project edit box, type or choose your project, e.g. bitreverse.
- In the Name edit box, type the project name, like bitreverse.
- Click Debug.
You may be prompted to switch to the Debug perspective. Click Yes
The Debug perspective appears with the bitreverse application window open. The C/C++ editor repositions in the perspective.
NOTE: If you see the error "Can't find source file" in the editor view, use the Locate File button to locate your source file.
In the left margin of the main.cpp window, double-click to set a breakpoint on line 37:
__global__ void bitreverse(void *data) {You'll see a blue circle (
) there indicating the breakpoint is set.- Click Run > Resume.
Or, you can use the Resume button (
) on the toolbar of the Debug view
.
The breakpoint will be hit.
- You can now explore your application state.
- Click Run > Resume.
- The application terminates and the debug session ends. The Debug perspective remains open.
To learn more about debugging, see the related debug conceptual topics.
Debug overview
Debug information
Debug view
Debug launch controls