From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30925 invoked by alias); 1 May 2009 18:53:52 -0000 Received: (qmail 30917 invoked by uid 22791); 1 May 2009 18:53:51 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 May 2009 18:53:46 +0000 Received: from wpaz29.hot.corp.google.com (wpaz29.hot.corp.google.com [172.24.198.93]) by smtp-out.google.com with ESMTP id n41Irg83000696 for ; Fri, 1 May 2009 19:53:43 +0100 Received: from rv-out-0506.google.com (rvbl9.prod.google.com [10.140.88.9]) by wpaz29.hot.corp.google.com with ESMTP id n41Ire66015146 for ; Fri, 1 May 2009 11:53:41 -0700 Received: by rv-out-0506.google.com with SMTP id l9so1703553rvb.57 for ; Fri, 01 May 2009 11:53:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.169.4 with SMTP id r4mr999369wfe.105.1241204020589; Fri, 01 May 2009 11:53:40 -0700 (PDT) In-Reply-To: <200905011817.07571.pedro@codesourcery.com> References: <20090501164905.GA32287@caradoc.them.org> <8ac60eac0905011002r73ced485j5643f9de3a7b0d01@mail.gmail.com> <200905011817.07571.pedro@codesourcery.com> Date: Fri, 01 May 2009 18:53:00 -0000 Message-ID: Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1 From: Doug Evans To: Pedro Alves Cc: gdb-patches@sourceware.org, Paul Pluzhnikov , Eli Zaretskii , brobecker@adacore.com, teawater@gmail.com, tromey@redhat.com, bauerman@br.ibm.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00041.txt.bz2 On Fri, May 1, 2009 at 10:17 AM, Pedro Alves wrote: > The tricker case is if you had just attached to a running > multi-threaded program, and thread_db debugging fails. =A0There'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//task and read in the lwps.