Fwd: GDB needs to suspend process to load shared libraries

svk <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAFWh_00zPVrnCOQz9Fx16kahE_jRd8Sc3BazdWyM-M_Wc0X6jw@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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.