Stop on solib events.
gdb
has support to stop when dynamic libraries are loaded or unloaded. It's very useful for setting breakpoints on sources for code that is not yet part of the process' code and of course, debugging things like loading plugins. For more info, see https://visualgdb.com/gdbreference/commands/set_stop-on-solib-events