From patchwork Mon Oct 27 04:36:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 3396 Received: (qmail 31904 invoked by alias); 27 Oct 2014 04:37:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 31892 invoked by uid 89); 27 Oct 2014 04:37:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 X-HELO: mail-pd0-f181.google.com Received: from mail-pd0-f181.google.com (HELO mail-pd0-f181.google.com) (209.85.192.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 27 Oct 2014 04:37:07 +0000 Received: by mail-pd0-f181.google.com with SMTP id y10so534566pdj.26 for ; Sun, 26 Oct 2014 21:37:05 -0700 (PDT) X-Received: by 10.70.96.162 with SMTP id dt2mr21650494pdb.29.1414384625890; Sun, 26 Oct 2014 21:37:05 -0700 (PDT) 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 f7sm9595930pdj.15.2014.10.26.21.37.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Oct 2014 21:37:05 -0700 (PDT) From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH 5/9] Rename some "aux" functions. Date: Sun, 26 Oct 2014 21:36:18 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hi. This patch renames some functions with "aux" in the name. "aux" doesn't provide any descriptive value, and I'm always spending time wondering how to read/interpret "aux". This patch doesn't rename lookup_symbol_aux: the handling of symbol lookup via mangled or natural names is a cleanup topic onto itself. Left for another day. This patch doesn't rename lookup_symbol_aux_symtabs as it is deleted in a later patch. 2014-10-26 Doug Evans * symtab.c (lookup_local_symbol): Renamed from lookup_symbol_aux_local. All callers updated. (lookup_symbol_via_quick_fns): Renamed from lookup_symbol_aux_quick. All callers updated. (lookup_symbol_in_symtabs): Renamed from lookup_symbol_aux_objfile. All callers updated. diff --git a/gdb/symtab.c b/gdb/symtab.c index 5786a8e..17f7499 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -74,10 +74,10 @@ static struct symbol *lookup_symbol_aux (const char *name, struct field_of_this_result *); static -struct symbol *lookup_symbol_aux_local (const char *name, - const struct block *block, - const domain_enum domain, - enum language language); +struct symbol *lookup_local_symbol (const char *name, + const struct block *block, + const domain_enum domain, + enum language language); static struct symbol *lookup_symbol_aux_symtabs (int block_index, @@ -85,10 +85,10 @@ struct symbol *lookup_symbol_aux_symtabs (int block_index, const domain_enum domain); static -struct symbol *lookup_symbol_aux_quick (struct objfile *objfile, - int block_index, - const char *name, - const domain_enum domain); +struct symbol *lookup_symbol_via_quick_fns (struct objfile *objfile, + int block_index, + const char *name, + const domain_enum domain); extern initialize_file_ftype _initialize_symtab; @@ -1424,7 +1424,7 @@ lookup_symbol_aux (const char *name, const struct block *block, /* Search specified block and its superiors. Don't search STATIC_BLOCK or GLOBAL_BLOCK. */ - sym = lookup_symbol_aux_local (name, block, domain, language); + sym = lookup_local_symbol (name, block, domain, language); if (sym != NULL) return sym; @@ -1488,7 +1488,7 @@ lookup_static_symbol (const char *name, const domain_enum domain) ALL_OBJFILES (objfile) { - sym = lookup_symbol_aux_quick (objfile, STATIC_BLOCK, name, domain); + sym = lookup_symbol_via_quick_fns (objfile, STATIC_BLOCK, name, domain); if (sym != NULL) return sym; } @@ -1500,9 +1500,9 @@ lookup_static_symbol (const char *name, const domain_enum domain) Don't search STATIC_BLOCK or GLOBAL_BLOCK. */ static struct symbol * -lookup_symbol_aux_local (const char *name, const struct block *block, - const domain_enum domain, - enum language language) +lookup_local_symbol (const char *name, const struct block *block, + const domain_enum domain, + enum language language) { struct symbol *sym; const struct block *static_block = block_static_block (block); @@ -1610,8 +1610,8 @@ lookup_global_symbol_from_objfile (const struct objfile *main_objfile, } } - sym = lookup_symbol_aux_quick ((struct objfile *) objfile, GLOBAL_BLOCK, - name, domain); + sym = lookup_symbol_via_quick_fns ((struct objfile *) objfile, + GLOBAL_BLOCK, name, domain); if (sym) return sym; } @@ -1625,8 +1625,8 @@ lookup_global_symbol_from_objfile (const struct objfile *main_objfile, static symbols. */ static struct symbol * -lookup_symbol_aux_objfile (struct objfile *objfile, int block_index, - const char *name, const domain_enum domain) +lookup_symbol_in_symtabs (struct objfile *objfile, int block_index, + const char *name, const domain_enum domain) { struct symbol *sym = NULL; const struct blockvector *bv; @@ -1648,8 +1648,8 @@ lookup_symbol_aux_objfile (struct objfile *objfile, int block_index, return NULL; } -/* Same as lookup_symbol_aux_objfile, except that it searches all - objfiles. Return the first match found. */ +/* Wrapper around lookup_symbol_in_symtabs to search all objfiles. + Returns the first match found. */ static struct symbol * lookup_symbol_aux_symtabs (int block_index, const char *name, @@ -1660,7 +1660,7 @@ lookup_symbol_aux_symtabs (int block_index, const char *name, ALL_OBJFILES (objfile) { - sym = lookup_symbol_aux_objfile (objfile, block_index, name, domain); + sym = lookup_symbol_in_symtabs (objfile, block_index, name, domain); if (sym) return sym; } @@ -1668,7 +1668,7 @@ lookup_symbol_aux_symtabs (int block_index, const char *name, return NULL; } -/* Wrapper around lookup_symbol_aux_objfile for search_symbols. +/* Wrapper around lookup_symbol_in_symtabs for search_symbols. Look up LINKAGE_NAME in DOMAIN in the global and static blocks of OBJFILE and all related objfiles. */ @@ -1694,11 +1694,11 @@ lookup_symbol_in_objfile_from_linkage_name (struct objfile *objfile, { struct symbol *sym; - sym = lookup_symbol_aux_objfile (cur_objfile, GLOBAL_BLOCK, - modified_name, domain); + sym = lookup_symbol_in_symtabs (cur_objfile, GLOBAL_BLOCK, + modified_name, domain); if (sym == NULL) - sym = lookup_symbol_aux_objfile (cur_objfile, STATIC_BLOCK, - modified_name, domain); + sym = lookup_symbol_in_symtabs (cur_objfile, STATIC_BLOCK, + modified_name, domain); if (sym != NULL) { do_cleanups (cleanup); @@ -1725,12 +1725,12 @@ Internal: %s symbol `%s' found in %s psymtab but not in symtab.\n\ name, symtab_to_filename_for_display (symtab), name, name); } -/* A helper function for lookup_symbol_aux that interfaces with the - "quick" symbol table functions. */ +/* A helper function for various lookup routines that interfaces with + the "quick" symbol table functions. */ static struct symbol * -lookup_symbol_aux_quick (struct objfile *objfile, int block_index, - const char *name, const domain_enum domain) +lookup_symbol_via_quick_fns (struct objfile *objfile, int block_index, + const char *name, const domain_enum domain) { struct symtab *symtab; const struct blockvector *bv; @@ -1840,11 +1840,11 @@ lookup_symbol_global_iterator_cb (struct objfile *objfile, gdb_assert (data->result == NULL); - data->result = lookup_symbol_aux_objfile (objfile, GLOBAL_BLOCK, - data->name, data->domain); + data->result = lookup_symbol_in_symtabs (objfile, GLOBAL_BLOCK, + data->name, data->domain); if (data->result == NULL) - data->result = lookup_symbol_aux_quick (objfile, GLOBAL_BLOCK, - data->name, data->domain); + data->result = lookup_symbol_via_quick_fns (objfile, GLOBAL_BLOCK, + data->name, data->domain); /* If we found a match, tell the iterator to stop. Otherwise, keep going. */