This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/9] Rename lookup_symbol_static and lookup_static_symbol_aux


Hi.

This patch renames two functions to help distinguish them.
It also removes the _aux as it doesn't add any descriptive value
to the name.

2014-10-26  Doug Evans  <xdje42@gmail.com>

	* symtab.c (lookup_static_symbol): Renamed from
	lookup_static_symbol_aux.  All callers updated.
	(lookup_symbol_in_static_block): Renamed from lookup_symbol_static.
	All callers updated.

diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index c6e1102..76ffee2 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -615,7 +615,7 @@ lookup_symbol_file (const char *name,
 {
   struct symbol *sym = NULL;
 
-  sym = lookup_symbol_static (name, block, domain);
+  sym = lookup_symbol_in_static_block (name, block, domain);
   if (sym != NULL)
     return sym;
 
@@ -771,14 +771,15 @@ find_symbol_in_baseclass (struct type *parent_type, const char *name,
       len = strlen (base_name) + 2 + strlen (name) + 1;
       concatenated_name = xrealloc (concatenated_name, len);
       xsnprintf (concatenated_name, len, "%s::%s", base_name, name);
-      sym = lookup_symbol_static (concatenated_name, block, VAR_DOMAIN);
+      sym = lookup_symbol_in_static_block (concatenated_name, block,
+					   VAR_DOMAIN);
       if (sym != NULL)
 	break;
 
       /* Nope.  We now have to search all static blocks in all objfiles,
 	 even if block != NULL, because there's no guarantees as to which
 	 symtab the symbol we want is in.  */
-      sym = lookup_static_symbol_aux (concatenated_name, VAR_DOMAIN);
+      sym = lookup_static_symbol (concatenated_name, VAR_DOMAIN);
       if (sym != NULL)
 	break;
 
@@ -849,7 +850,7 @@ cp_lookup_nested_symbol (struct type *parent_type,
 	concatenated_name = alloca (size);
 	xsnprintf (concatenated_name, size, "%s::%s",
 		 parent_name, nested_name);
-	sym = lookup_static_symbol_aux (concatenated_name, VAR_DOMAIN);
+	sym = lookup_static_symbol (concatenated_name, VAR_DOMAIN);
 	if (sym != NULL)
 	  return sym;
 
diff --git a/gdb/d-exp.y b/gdb/d-exp.y
index cae3419..91d5309 100644
--- a/gdb/d-exp.y
+++ b/gdb/d-exp.y
@@ -1179,8 +1179,8 @@ push_module_name (struct parser_state *ps, struct type *module,
       char *copy;
 
       copy = copy_name (name);
-      sym = lookup_symbol_static (copy, expression_context_block,
-				  VAR_DOMAIN);
+      sym = lookup_symbol_in_static_block (copy, expression_context_block,
+					   VAR_DOMAIN);
       if (sym != NULL)
 	sym = lookup_symbol_global (copy, expression_context_block,
 				    VAR_DOMAIN);
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 19753bc..02c657e 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1471,13 +1471,13 @@ lookup_symbol_aux (const char *name, const struct block *block,
   /* Now search all static file-level symbols.  Not strictly correct,
      but more useful than an error.  */
 
-  return lookup_static_symbol_aux (name, domain);
+  return lookup_static_symbol (name, domain);
 }
 
 /* See symtab.h.  */
 
 struct symbol *
-lookup_static_symbol_aux (const char *name, const domain_enum domain)
+lookup_static_symbol (const char *name, const domain_enum domain)
 {
   struct objfile *objfile;
   struct symbol *sym;
@@ -1789,7 +1789,7 @@ basic_lookup_symbol_nonlocal (const char *name,
      than that one, so I don't think we should worry about that for
      now.  */
 
-  sym = lookup_symbol_static (name, block, domain);
+  sym = lookup_symbol_in_static_block (name, block, domain);
   if (sym != NULL)
     return sym;
 
@@ -1799,9 +1799,9 @@ basic_lookup_symbol_nonlocal (const char *name,
 /* See symtab.h.  */
 
 struct symbol *
-lookup_symbol_static (const char *name,
-		      const struct block *block,
-		      const domain_enum domain)
+lookup_symbol_in_static_block (const char *name,
+			       const struct block *block,
+			       const domain_enum domain)
 {
   const struct block *static_block = block_static_block (block);
 
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 7fa42a6..1d95258 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1092,9 +1092,9 @@ extern struct symbol *basic_lookup_symbol_nonlocal (const char *,
    Upon success sets BLOCK_FOUND and fixes up the symbol's section
    if necessary.  */
 
-extern struct symbol *lookup_symbol_static (const char *name,
-					    const struct block *block,
-					    const domain_enum domain);
+extern struct symbol *lookup_symbol_in_static_block (const char *name,
+						     const struct block *block,
+						     const domain_enum domain);
 
 /* Lookup a symbol in all files' global blocks.
    Upon success sets BLOCK_FOUND and fixes up the symbol's section
@@ -1122,8 +1122,8 @@ extern struct symbol *lookup_language_this (const struct language_defn *lang,
    Upon success sets BLOCK_FOUND and fixes up the symbol's section
    if necessary.  */
 
-extern struct symbol *lookup_static_symbol_aux (const char *name,
-						const domain_enum domain);
+extern struct symbol *lookup_static_symbol (const char *name,
+					    const domain_enum domain);
 
 /* Lookup a [struct, union, enum] by name, within a specified block.  */
 
diff --git a/gdb/valops.c b/gdb/valops.c
index 7f3e4f5..8d5667e 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3576,7 +3576,7 @@ value_maybe_namespace_elt (const struct type *curtype,
 					+ strlen (name) + 1);
 
       sprintf (concatenated_name, "%s::%s", namespace_name, name);
-      sym = lookup_static_symbol_aux (concatenated_name, VAR_DOMAIN);
+      sym = lookup_static_symbol (concatenated_name, VAR_DOMAIN);
     }
 
   if (sym == NULL)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]