I\'m having trouble debugging a C++ program in Eclipse (the latest RC of Helios, updated with latest CDT from within itself) on OSX.
The program is very simple (esen
Thought to mention, that in case you are using cmake to build the project, one approach to the solution will be to add the "debug flag" to the cmake command, i.e. -
$ cmake /path/to/main/cmake_file -DCMAKE_BUILD_TYPE=Debug
Seems like this message can have plenty of reasons to show.
For me (in the context of micro controller debugging) it was the link-time optimization. With -flto
it broke; removing -flto
from the "Other Options" field fixed this for me.
In Eclipse Neon (4.6) see Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> C Compiler -> Miscellaneous -> Other options.
I had this issue when I compiled the latest gcc, but did not update to the most recent gdb. After the update, it worked properly.
This thread suggests:
-g -O0
for debug flags to be set for Eclipse CDT compilation.
Sometime, it is simple a problem of rebuilding completely the application (like here)
See also this thread describing a similar situation:
I have noticed that sometimes in Eclipse I have to go and specifically add the path to my source files using the "
add filesystem path
" (with "search sub-folders
") in the Debug Dialog (even when they are in the same project I am debugging), but I have not noticed a pattern to when I have to do this. But it may be worth a try.
I just faced with this issue and after take some time to find it out, I realize that the Arguments and Main tab in Debug Configurations dialog are conflicting each other.
Make sure that C/C++ Application and Programs Arguments point to the same binary file.
I found the answer! And it's embarrassingly simple.
The problem was that I was using the Release version of SDL instead of the Debug version! (I had 'libsdl' from MacPorts whereas I should have had 'libsdl-devel'.)
So my generic answer is: make sure the libs you're linking against were compiled with debug flags set too, it's not always enough to just make sure your own code has them set.