From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1476 invoked by alias); 15 Oct 2004 14:46:08 -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 1420 invoked from network); 15 Oct 2004 14:46:03 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 15 Oct 2004 14:46:03 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1CITLF-0006jc-U8; Fri, 15 Oct 2004 10:46:02 -0400 Date: Fri, 15 Oct 2004 14:46:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa] qSymbol in remote_wait Message-ID: <20041015144601.GA25188@nevyn.them.org> Mail-Followup-To: Jim Blandy , gdb-patches@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-10/txt/msg00280.txt.bz2 On Thu, Oct 14, 2004 at 09:16:25PM -0500, Jim Blandy wrote: > > > 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 > > > > * 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 à 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. Woah! I never noticed that was there. Thank you very, very much, Jim. Since I assume that all the symbols in td_symbol_list - or at least, most of them - will be defined, I can just try the first one every time that GDB offers to look up symbols for me. -- Daniel Jacobowitz