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
Encountered the same problem once. You just have to go to your Project Properties, by hitting ALT+ENTR or right click project and scroll down at the bottom and you will find Properties. Expand C/C++ build on the left. Then click on settings. Once you open the settings, then click on tool settings. In the MCU GCC Compiler, there is a debugging option. Click on debugging and add
-g -O0
in the Other debugging flags. Trying debugging the project now.
Here is another reason for this problem. My configuration used -g3 as the option to gcc. Changing it to -g solved the problem. There seems to be some incompatibility between gcc and gdb. I checked that gdb was the latest revision (using apt-get).
For anyone else who may experience this issue,
I installed the linuxtools/valgrind plugin last night to do some memory profiling, and it seems that this broke the normal gdb. when i removed the linuxtools plugins everything started working as normal again.
So you might like to try that.
Go to project Properties, C/C++ Build -> Settings. On the first tab (Tool Settings) under Cross GCC Compiler click Debugging and set Debug Level to Maximum (-g3)
This issue depends on how gdb is being invoked. I found I needed to manually specify the source file locations when I got that error. Even though I'd already configured that under project properties. After doing so, Eclipse no longer had a problem supplying the appropriate source.
Using the release versus debug version of a library may be your specific problem (if you were building a library from source then debugging it). If someone is using a precompiled library, they'd never be able to set breakpoints within it and so that fix wouldn't apply to them.
I would like to add a little new blood to this old thread.
I encountered this problem when I tried to compile and debug a gnu arm project.
I solved the problem by modifying the Makefile: adding "-g -O0" at the end of this line "CFLAGS += -Wall -Werror -O3"