This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Fwd: GDB needs to suspend process to load shared libraries
- From: svk <shreyasvin at gmail dot com>
- To: gdb at sourceware dot org
- Date: Thu, 10 Nov 2016 18:16:03 -0800
- Subject: Fwd: GDB needs to suspend process to load shared libraries
- Authentication-results: sourceware.org; auth=none
- References: <CAFWh_01NauV=qNT3yR1hA+Bhi=KZzJn+dqF-FFb_=APUGx2L5w@mail.gmail.com>
Hi,
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?
Thanks,
Shreyas