12

I don't use Eclipse as an IDE, and have no interest in doing so. However, I do like its source-level debugging.

Is there any way I can use it to debug a C++ Linux app without going through the ritual of creating a project? (In effect, can I just use it like a frontend to gdb?)

If not, what are the steps I need to follow to create a project that I can use to just debug an existing C++ program that is built using Makefiles or other tools (SCons, CMake, etc.). I don't want to be able to "develop" in Eclipse; all I need to do is debug.

3 Answers 3

10

Take a look at this question. Create a C/C++-project, use your project's source directory as project directory, select to use the external builder, and change "make" to whatever tool you want.

The tricky part is to get the indexer to work correctly and find all your header files.

EDIT: CMake 2.6.x has support for generating CDT project files, which might be a more straightforward solution.

Sign up to request clarification or add additional context in comments.

2 Comments

What does "select to use the external builder" mean?
Change Project properties -> C/C++ Build -> Builder Settings -> Builder type to "External builder", unselect "Use default build command", and modify the "Build command" field to match your external tool's build command.
5

I don't know if this has changed in the 4+ years since the question was posted, but there's a much easier way to do this. I'm on Eclipse Luna (4.4.2).

> eclipse&

then

File > Import > C/C++ > C/C++ Executable > Next > browse to executable > Next > choose a project name > Finish

No other project setup required, no source paths (which should be in the object code). Just like running gdb/insight/etc. Almost makes it worth installing Java.

Comments

0

Configuration for debugging in Eclipse.

In eclipse,

  1. Go to Window->preferences
  2. A popup will appear then select C/C++ , click on drop down arrow ,then select Debug and click on drop down arrow.
  3. Select Source Lookup Path and then click on Add.
  4. After clicking on Add, click on Path Mapping and then click on OK.
  5. Specify the mapping path name and then click on Add .
  6. In compilation path select Cygwin path (need to install) and then click ok .
  7. In debug option,click on source Lookup Path and select Path Mapping:Project source and click on apply and then ok.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.