From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6627 invoked by alias); 5 Dec 2014 18:03:20 -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 6509 invoked by uid 89); 5 Dec 2014 18:03:19 -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,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f179.google.com Received: from mail-pd0-f179.google.com (HELO mail-pd0-f179.google.com) (209.85.192.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 05 Dec 2014 18:03:18 +0000 Received: by mail-pd0-f179.google.com with SMTP id fp1so800492pdb.24 for ; Fri, 05 Dec 2014 10:03:16 -0800 (PST) X-Received: by 10.66.157.196 with SMTP id wo4mr30854701pab.156.1417802596464; Fri, 05 Dec 2014 10:03:16 -0800 (PST) Received: from seba.sebabeach.org.gmail.com (173-13-178-50-sfba.hfc.comcastbusiness.net. [173.13.178.50]) by mx.google.com with ESMTPSA id fn4sm29852166pab.39.2014.12.05.10.03.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Dec 2014 10:03:15 -0800 (PST) From: Doug Evans To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch +const 2/2] Unify lookup_symbol_in_objfile_symtabs References: <20141203170703.GC25020@host2.jankratochvil.net> Date: Fri, 05 Dec 2014 18:03:00 -0000 In-Reply-To: <20141203170703.GC25020@host2.jankratochvil.net> (Jan Kratochvil's message of "Wed, 3 Dec 2014 18:07:03 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00145.txt.bz2 Jan Kratochvil writes: > 2014-12-03 Jan Kratochvil > > * symtab.c (lookup_symbol_in_objfile_symtabs): New declaration. > (lookup_global_symbol_from_objfile): Call it. > > diff --git a/gdb/symtab.c b/gdb/symtab.c > index 79035f6..1951c97 100644 > --- a/gdb/symtab.c > +++ b/gdb/symtab.c > @@ -79,6 +79,11 @@ struct symbol *lookup_local_symbol (const char *name, > const domain_enum domain, > enum language language); > > +static struct symbol * > + lookup_symbol_in_objfile_symtabs (const struct objfile *objfile, > + int block_index, const char *name, > + const domain_enum domain); > + > static > struct symbol *lookup_symbol_via_quick_fns (struct objfile *objfile, > int block_index, > @@ -1546,24 +1551,12 @@ lookup_global_symbol_from_objfile (const struct objfile *main_objfile, > objfile; > objfile = objfile_separate_debug_iterate (main_objfile, objfile)) > { > - struct compunit_symtab *cust; > struct symbol *sym; > - > - /* Go through symtabs. */ > - ALL_OBJFILE_COMPUNITS (objfile, cust) > - { > - const struct blockvector *bv; > - const struct block *block; > - > - bv = COMPUNIT_BLOCKVECTOR (cust); > - block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); > - sym = block_lookup_symbol (block, name, domain); > - if (sym) > - { > - block_found = block; > - return fixup_symbol_section (sym, objfile); > - } > - } > + > + sym = lookup_symbol_in_objfile_symtabs (objfile, GLOBAL_BLOCK, name, > + domain); > + if (sym != NULL) > + return sym; > > sym = lookup_symbol_via_quick_fns ((struct objfile *) objfile, > GLOBAL_BLOCK, name, domain); LGTM.