I did the following:
- imported a Makefile project into Eclipse CDT.
- compiled the program from the command line using the -ggdb option of g++.
- run the programm from the command line
- set some breakpoints in Eclipse CDT
- attached the Eclipse CDT debugger (gdb) to a child process that my program spawned (the child process runs a program from the same project).
At this point I get the error message in the console
No source file named /home/oswald/Eclipse/CDT/Workspace/Project/path/to/header.h.
When I resume the programm, all my breakpoints are skipped. How can I get my breakpoints working?
Some additional notes:
- There are no shared libraries involved.
- Eclipse Indigo, gdb 7.4, Ubuntu 12.04
- Using the command line to attach gdb to the process, I can set a breakpoint to
header.h:257
(header.h
is in folder/home/oswald/Eclipse/CDT/Workspace/Project/path/to/
). gdb then honours this breakpoint. - Using the command line to attach gdb to the process, I cannot set a breakpoint to
/home/oswald/Eclipse/CDT/Workspace/Project/path/to/header.h:257
, I get the same message from gdb as when using Eclipse CDT. - Eclipse CDT uses the GDB (DSF) Attach to Process Launcher. Switching to the Standard Attach to Process Launcher yields an error message that the system cannot list running processes.
- The Source Lookup Path in the debug configuration is set to default (Absolute File Path, Program Realtive File Path, Project). I experimented with various other settings, but none worked.