Fwd: GDB needs to suspend process to load shared libraries

svk shreyasvin@gmail.com
Fri Nov 11 02:16:00 GMT 2016

I am using GDB 7.10.1(Poky distribution) to attach to a running
process. The process is being monitored using a watchdog(systemd)
which requires to be strobed every 10s.

To avoid suspending the process, I am using async mode to attach to
the process. However, I am still hitting the timeout because my
process has a large number of dynamically linked libraries(loaded
using dlopen). It seems that GDB needs the process to be interrupted
while it loads symbols from the shared libraries. This takes ~40s to
complete which causes the timeout.

The only solution I could find was to do "set auto-solib-add off" and
load each and every shared library manually. But this is too tedious
for users as there are 100+ libraries.

I tried scripting gdb to interrupt the process for each shared library
and load it, which did not work due to a GDB bug. Is there any known
solution/workaround to this problem?


More information about the Gdb mailing list