Debugging/tracing inside a shared library during runtime?-Collection of common programming errors

There are two cases to consider (and your question doesn’t make it clear which case you have): – your executable is linked with the shared library directly:

this means that GDB will “see” the symbols (and sources) from shared library when you stop on main

– your executable dynamically loads the shared library (e.g. via dlopen):
in that case, GDB will not “see” your shared library until after dlopen completes.

Since you can’t see the symbols when you stop at main, I am guessing you have the second case. You can do "set stop-on-solib-events 1" at the (gdb) prompt, and GDB will stop every time a new shared library is loaded (or unloaded).

You can see which libraries GDB “knows” about via info shared command.
Just wait until you see your target library in that list, before attempting to set breakpoints in it.