From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8016 invoked by alias); 15 Oct 2004 02:17:43 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8008 invoked from network); 15 Oct 2004 02:17:41 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 15 Oct 2004 02:17:41 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i9F2Hfdn031499 for ; Thu, 14 Oct 2004 22:17:41 -0400 Received: from zenia.home.redhat.com (sebastian-int.corp.redhat.com [172.16.52.221]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9F2Hdr06493; Thu, 14 Oct 2004 22:17:40 -0400 To: Daniel Jacobowitz CC: gdb-patches@sources.redhat.com Subject: [rfa] qSymbol in remote_wait From: Jim Blandy Date: Fri, 15 Oct 2004 02:17:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2004-10/txt/msg00265.txt.bz2 > As Amit Kale mentioned in December, to support NPTL gdbserver needs to > look up symbols during remote_wait. The existing qSymbol model > assumes that only at objfile loads (i.e. during td_ta_new) do we need > to look up symbols; NPTL looks up symbols lazily when it needs them, > which includes at the creation of the first child thread. This patch > (which, I know, needs a matching change for the manual) allows > qSymbol: queries as a response to remote_wait, in much the same way as > the file I/O protocol. > > 2004-01-31 Daniel Jacobowitz >=20 > * remote.c (handle_remote_qsymbol): New function, broken out > from remote_check_symbols. > (remote_check_symbols): Call it. > (remote_wait): Handle qSymbol. > (remote_async_wait): Likewise. I was struggling with this too until I noticed the function td_symbol_list, which gives you an =E0 priori list of all the symbols libthread_db may ever request. Unless I've missed something, this is exactly what's needed to fit ps_pglobal_lookup into the existing remote protocol's qSymbol dance: you can look up all the symbols libthread_db needs as soon as the inferior loads libpthread.so, and then have ps_pglobal_lookup just provide values from a cache. I think this has been present in NPTL's libthread_db from the beginning; it's present in some versions of LinuxThreads' as well, but I don't think it was there initially.