From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22075 invoked by alias); 4 Dec 2014 16:38:40 -0000 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 Received: (qmail 22064 invoked by uid 89); 4 Dec 2014 16:38:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 04 Dec 2014 16:38:38 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB4GcWQ0016059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 4 Dec 2014 11:38:32 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sB4GcUM0014938; Thu, 4 Dec 2014 11:38:31 -0500 Message-ID: <54808E06.9040200@redhat.com> Date: Thu, 04 Dec 2014 16:38:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Doug Evans , gdb-patches@sourceware.org, brobecker@adacore.com Subject: Re: [RFC] symbol lookup cache References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-12/txt/msg00098.txt.bz2 On 12/01/2014 08:23 AM, Doug Evans wrote: > Hi. > > Holidays are nice for having the time to take on > projects one is interested in but doesn't have > time to otherwise do. > > I looked at a couple of areas for improvement > in gdb's symbol handling over the last couple > of days. One is .gdb_index support for tab > completion, which is the topic for another mail. > This email is about a symbol lookup cache. > > ..gdb_index helps speed things up for one objfile, > but when there are 100s (or 1000s) of shared > libraries, symbol lookup can still take awhile, > even with .gdb_index. > [I'm setting aside a planned change to basic > symbol lookup to use the index better. > We'll still, I think, want a cache even > with that change.] > > This patch still needs more testing > and I need to collect more perf data, > but it's a start at caching symbol lookups. > This first pass is just for the case > where we iterate over all objfiles for > lookups in the global or static blocks. > Low hanging fruit. > At the moment it's just RFC. I don't have particular comments on the patch, but a cache in principle sounds like a great idea to me. You've probably thought this through already, but, my only worry is whether this could affect which symbol is found. E.g., if there are multiple instances of a static global symbol in the program. ISTR expressions find the instance in the current module (or CU?) first. I may be thinking of solib_global_lookup. Could the cache hit the symbol in another module first? Thanks, Pedro Alves