views:

3671

answers:

4

Hello!

My problem is that I set some breakpoints in my code and some of them aren't working. In some places it complains about "Unresolved Breakpoint".

Does anyone have any clue why this is happening?? I am using gdb, by the way.

EDIT: Yes, of course is compiled with debug information. It only happens at some classes or points in the code. And I am pretty sure that that part of the code is reached because I can reach it stepping

EDIT: Neither the solution from Richard works, thaks anyway. I am compiling in Debug, without any optimization.

+1  A: 

Check if your executable is compiled with debug information.

MysticSlayer
+1  A: 

"Unresolved Breakpoint" just means that GDB did not find code location corresponding to the file and line on which you attempted to set a breakpoint.

Are you trying to stop in a constructor?

If so, you are likely seeing this cently fixed GCC bug.

+1  A: 

Could it be that you are trying to set breakpoints in a shared library that has not been loaded yet. That won't work until the library has loaded. Newer gdb allow to set deferred breakpoints, but that may not (yet) be supported by CDT. A workaround is to set a breakpoint in a place that is available from the beginning that will be reached when the shared library in question is already loaded. Then set the other breakpoint in the shared library. Now it should work. It's a bit more tedious, but usually works.

From the GDB documentation:

For a pending breakpoint whose address is not yet known, this field will contain 'PENDING'. Such breakpoint won't fire until a shared library that has the symbol or line referred by breakpoint is loaded.

lothar
+1  A: 

I don't have any solution but exactly the same happens to me. :( Damn Eclipse. ;)

AxeEffect