When we want to debug shared libraries, we have two main scenarios:
Shared libs linked with the binary - no problem.
Shared libs linked using dlopen().
For the 2nd type of linking - we cannot set a break-point before the
library was loaded...
...but gdb is kind enough to "wait for the symbols" on our behalf:
(gdb) b honolulu
Function "honolulu" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (honolulu) pending.
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y honolulu
As soon as the library will be loaded - gdb will notice this, find the
address to break in, and enable the break-point.