Here are two simplified test files: ***header.h inline int func1() { return 1000; } inline int func2() { return 10; } ***main.cpp #include "header.h" int main() { func1(); return 0; } To reproduce the bug execute the following commands: g++ -g main.cpp -o test_break gdb ./test_break (gdb) break header.h:7 The result of the last command is "No line 7 in file "header.h"." GDB thinks the code is unused, because the func2 is not used in the current symbols. This might not be the case if a shared library which uses func2 is loaded in the future, therefore GDB should not refuse to set a pending breakpoint.
This issue seems to have been fixed now (tested with 7.6.50.20131009-cvs): (gdb) b header.h:7 No line 7 in file "header.h". Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (header.h:7) pending. I'm going to close this but please reopen if it still doesn't work for you.