(gdb) break ../qq/zz/test.h:53
No source file named ../qq/zz/test.h
Make breakpoint pending on future shared library load? (y or [n])
This usually means that the code in question was built into a shared library, and you have not loaded that shared library yet.
You should either answer yes
to the question GDB is asking, or just run the application once (which will make GDB load and retain debugging symbols for all libraries used in that run), and then set a breakpoing for the second run.
Then I did this:
Furious activity is not a substitute for understanding. Since you lack understanding, it's unlikely that typing various "random" commands into GDB will help you.
Update:
again the same error as "No source file named..."
Well, it's also possible that code in someObjFile.o
is not in fact ever loaded into your process. One easy way to confirm this is to put assert(0)
in line 53 of test.h
. If your program still runs, then (assuming you do not use -DNDEBUG
when building) you can be sure that line 53 was in fact never executed.