Debugging non-IDE code
You can debug code written and compiled outside of the IDE. All you need is a launch configuration—you don't need to create an IDE project to store the code.
-
Create a launch configuration for running the appropriate binary.
In the C/C++ Application field in the Main tab, you must provide the full path to the binary located outside of the workspace.
If you're debugging code that was compiled on another machine, you need to tell the IDE where to find the source files on the host, by defining the appropriate paths in the Source tab.
-
Click the Debug button (
).
The IDE switches to the Debug perspective, which displays the source code being traced and other essential debugging information. Then, it starts running the binary and GDB, which it attaches to the binary. If configured to do so in the Debug settings, the debugger stops on startup (by default, in the first line of main()).
For information on the debugging controls, see Debug perspective controls
.