This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1
On Fri, May 1, 2009 at 10:17 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> The tricker case is if you had just attached to a running
> multi-threaded program, and thread_db debugging fails. ?There'd be
> no PTRACE_EVENT_CLONE for threads that are there already, of
> course, so unless there's a simpler way I don't know about, you'd
> have to extract the lwp list from /proc/ info.
fwiw, I did this in a libgdbserver patch that we use here.
gdbserver needs to call back to gdb to do symbol resolution, which is
needed as part of libthread_db init, but the program that links in
libgdbserver may want to attach to all threads before gdb has
connected, so I opendir /proc/<pid>/task and read in the lwps.