Debugging an Existing Executable

Use the import feature to import and debug an executable you have already built. This feature will automatically create a project and debug configuration for you. This is helpful if you have an executable built with debug symbols but may not have the project used to build the executable.

Importing Executables for Debugging

  1. Select the File > Import... menu item to open the Import wizard dialog:

  2. Select C/C++ Executable, then click Next to open the Import Executable wizard.
  3. Enter the executable path in the Select Executable field or click Browse to locate the executable.
  4. Use Select Executable to choose a single executable or Search Directory to select one or more executables to import from the specified directory.

    NOTE You can import any executable, but only those built with debug symbols will be let you step through source code and see variable values.

  5. Click Next to see the Choose Project page
  6. Use the Choose Project page to create a new project (you can use the default name assigned) and debug configuration. You can import executables into a new project or an existing one. The new project is configured to hold the executable, but not to build anything.

    Select from the menu of launch configuration types to select one for debugging. This launch configuration will be created for you with default settings for debugging your executable.

  7. Click Finish
  8. The executable is added to the C/C++ Projects view and the Launch configuration window appears..

  9. Click Debug
  10. The debugger launches and you can begin debugging the executable.

  11. Setting breakpoints
  12. Expand the executable in the C++ Projects view to see the list of source files. Only executables built with debug symbols will show a list of source files. The source files can be opened in the editor so you can set breakpoints. Use these files only for debugging, you can not change them and rebuild the executable with this project.

    C++ Projects View

Related concepts
Debug overview
Debug information

Related tasks
Debugging

Related reference
Run and Debug dialog box