User forums > Using Code::Blocks

gdb doesn't find sources ( No source file named...)

<< < (2/4) > >>

thomas:

--- Quote from: jens on February 17, 2008, 03:46:26 pm ---I just saw that you put the breakpoint into a header file, that does not work.
--- End quote ---
Huh? I do the like all the time, why shouldn't that work?

The only thing that confirmedly doesn't work (to my knowledge) is putting breakpoints in constructors (limitation of gdb).

nenin:

--- Quote from: thomas on February 17, 2008, 05:29:51 pm ---
--- Quote from: jens on February 17, 2008, 03:46:26 pm ---I just saw that you put the breakpoint into a header file, that does not work.
--- End quote ---
Huh? I do the like all the time, why shouldn't that work?

The only thing that confirmedly doesn't work (to my knowledge) is putting breakpoints in constructors (limitation of gdb).

--- End quote ---
It is very odd, but in some cases GDB can not find headers. It was like that, and it do not changes  for me when I move from Dev-C++ to C::B (it was main reason  :D ). Than I move to GDB 6, than to gcc 4, now to gcc with dwarf2... but breakpoint in some headers still are "pending". IMHO, problem is derived from directories project structure. If project has some headers in sub-directories, it is very likely than breakpoints in this files will be lost. I use defines with stub functions to catch breaks.   

erSitzt:
I had this problem too, but with breakpoints in the cpp files and i also had problems with the debugger starting the wrong build target.

But breakpoints in the constructor are working for me.

Jenna:

--- Quote from: thomas on February 17, 2008, 05:29:51 pm ---
--- Quote from: jens on February 17, 2008, 03:46:26 pm ---I just saw that you put the breakpoint into a header file, that does not work.
--- End quote ---
Huh? I do the like all the time, why shouldn't that work?

The only thing that confirmedly doesn't work (to my knowledge) is putting breakpoints in constructors (limitation of gdb).

--- End quote ---

You're partly right.

If the .h-file has (for example) a function in it, it works if the breakpoint is on a declaration, that is before the function or in the function itself.
But if a breakpoint is put into a header after any executable code or in a header withoutout any executable code (just declarations) you get exactly the errormessage the OP had.

By the weay I put breakpoints into my class-constructors and gdb has no problems to stop there.

thomas:
About the constructor thing I am not sure, it may either that either the model was changed in gcc 4.x or the more recent gdb contains a kind of workaround.
The reason why breakpoints on constructors do/did not work is that gcc 3.x always emits two separate constructors, and gdb can't figure out which one to break in. So it is kind of normal, rather than a bug.

If this works for you now, then that's good news (and a sign that I should soon update my compiler/debugger). :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version