This is the mail archive of the gdb-patches@sources.redhat.com 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/commit] rename 'mangled_name' to 'linkage_name'


The attached patch renames arguments 'mangled_name' of various
lookup_symbol functions to 'linkage_name', and adds a brief comment at
the start of lookup_symbol_aux.  Tested on GCC 3.2, DWARF 2,
i686-pc-linux-gnu; committed as obvious.

David Carlton
carlton@bactrian.org

2003-05-18  David Carlton  <carlton@bactrian.org>

	* symtab.c (lookup_symbol_aux): Rename 'mangled_name' argument to
	'linkage_name'.  Add comment.
	(lookup_symbol_aux_local): Rename 'mangled_name' argument to
	'linkage_name'.
	(lookup_symbol_aux_block, lookup_symbol_aux_symtabs)
	(lookup_symbol_aux_psymtabs, lookup_symbol_aux_minsyms)
	(lookup_block_symbol): Ditto.

Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.104
diff -u -p -r1.104 symtab.c
--- symtab.c	15 May 2003 14:28:57 -0000	1.104
+++ symtab.c	18 May 2003 15:07:49 -0000
@@ -82,7 +82,7 @@ static struct partial_symbol *lookup_par
 						     domain_enum);
 
 static struct symbol *lookup_symbol_aux (const char *name,
-					 const char *mangled_name,
+					 const char *linkage_name,
 					 const struct block *block,
 					 const domain_enum domain,
 					 int *is_a_field_of_this,
@@ -90,7 +90,7 @@ static struct symbol *lookup_symbol_aux 
 
 static
 struct symbol *lookup_symbol_aux_local (const char *name,
-					const char *mangled_name,
+					const char *linkage_name,
 					const struct block *block,
 					const domain_enum domain,
 					struct symtab **symtab,
@@ -98,7 +98,7 @@ struct symbol *lookup_symbol_aux_local (
 
 static
 struct symbol *lookup_symbol_aux_block (const char *name,
-					const char *mangled_name,
+					const char *linkage_name,
 					const struct block *block,
 					const domain_enum domain,
 					struct symtab **symtab);
@@ -106,21 +106,21 @@ struct symbol *lookup_symbol_aux_block (
 static
 struct symbol *lookup_symbol_aux_symtabs (int block_index,
 					  const char *name,
-					  const char *mangled_name,
+					  const char *linkage_name,
 					  const domain_enum domain,
 					  struct symtab **symtab);
 
 static
 struct symbol *lookup_symbol_aux_psymtabs (int block_index,
 					   const char *name,
-					   const char *mangled_name,
+					   const char *linkage_name,
 					   const domain_enum domain,
 					   struct symtab **symtab);
 
 #if 0
 static
 struct symbol *lookup_symbol_aux_minsyms (const char *name,
-					  const char *mangled_name,
+					  const char *linkage_name,
 					  const domain_enum domain,
 					  int *is_a_field_of_this,
 					  struct symtab **symtab);
@@ -948,7 +948,7 @@ lookup_symbol (const char *name, const s
 }
 
 static struct symbol *
-lookup_symbol_aux (const char *name, const char *mangled_name,
+lookup_symbol_aux (const char *name, const char *linkage_name,
 		   const struct block *block, const domain_enum domain,
 		   int *is_a_field_of_this, struct symtab **symtab)
 {
@@ -958,7 +958,7 @@ lookup_symbol_aux (const char *name, con
   /* Search specified block and its superiors.  Don't search
      STATIC_BLOCK or GLOBAL_BLOCK.  */
 
-  sym = lookup_symbol_aux_local (name, mangled_name, block, domain,
+  sym = lookup_symbol_aux_local (name, linkage_name, block, domain,
 				 symtab, &static_block);
   if (sym != NULL)
     return sym;
@@ -996,7 +996,7 @@ lookup_symbol_aux (const char *name, con
 	if (BLOCK_START (b) <= BLOCK_START (block)
 	    && BLOCK_END (b) > BLOCK_START (block))
 	  {
-	    sym = lookup_block_symbol (b, name, mangled_name, VAR_DOMAIN);
+	    sym = lookup_block_symbol (b, name, linkage_name, VAR_DOMAIN);
 	    if (sym)
 	      {
 		block_found = b;
@@ -1051,7 +1051,7 @@ lookup_symbol_aux (const char *name, con
 
   if (static_block != NULL)
     {
-      sym = lookup_symbol_aux_block (name, mangled_name, static_block,
+      sym = lookup_symbol_aux_block (name, linkage_name, static_block,
 				     domain, symtab);
       if (sym != NULL)
 	return sym;
@@ -1062,12 +1062,12 @@ lookup_symbol_aux (const char *name, con
      of the desired name as a global, then do psymtab-to-symtab
      conversion on the fly and return the found symbol. */
 
-  sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, mangled_name,
+  sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, linkage_name,
 				   domain, symtab);
   if (sym != NULL)
     return sym;
 
-  sym = lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, mangled_name,
+  sym = lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, linkage_name,
 				    domain, symtab);
   if (sym != NULL)
     return sym;
@@ -1078,12 +1078,12 @@ lookup_symbol_aux (const char *name, con
      desired name as a file-level static, then do psymtab-to-symtab
      conversion on the fly and return the found symbol. */
 
-  sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, mangled_name,
+  sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, linkage_name,
 				   domain, symtab);
   if (sym != NULL)
     return sym;
   
-  sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, mangled_name,
+  sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, linkage_name,
 				    domain, symtab);
   if (sym != NULL)
     return sym;
@@ -1098,7 +1098,7 @@ lookup_symbol_aux (const char *name, con
    match, store the address of STATIC_BLOCK in static_block.  */
 
 static struct symbol *
-lookup_symbol_aux_local (const char *name, const char *mangled_name,
+lookup_symbol_aux_local (const char *name, const char *linkage_name,
 			 const struct block *block,
 			 const domain_enum domain,
 			 struct symtab **symtab,
@@ -1116,7 +1116,7 @@ lookup_symbol_aux_local (const char *nam
 
   while (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) != NULL)
     {
-      sym = lookup_symbol_aux_block (name, mangled_name, block, domain,
+      sym = lookup_symbol_aux_block (name, linkage_name, block, domain,
 				     symtab);
       if (sym != NULL)
 	return sym;
@@ -1133,7 +1133,7 @@ lookup_symbol_aux_local (const char *nam
    symbol, and set block_found appropriately.  */
 
 static struct symbol *
-lookup_symbol_aux_block (const char *name, const char *mangled_name,
+lookup_symbol_aux_block (const char *name, const char *linkage_name,
 			 const struct block *block,
 			 const domain_enum domain,
 			 struct symtab **symtab)
@@ -1144,7 +1144,7 @@ lookup_symbol_aux_block (const char *nam
   struct block *b;
   struct symtab *s = NULL;
 
-  sym = lookup_block_symbol (block, name, mangled_name, domain);
+  sym = lookup_block_symbol (block, name, linkage_name, domain);
   if (sym)
     {
       block_found = block;
@@ -1177,7 +1177,7 @@ lookup_symbol_aux_block (const char *nam
 
 static struct symbol *
 lookup_symbol_aux_symtabs (int block_index,
-			   const char *name, const char *mangled_name,
+			   const char *name, const char *linkage_name,
 			   const domain_enum domain,
 			   struct symtab **symtab)
 {
@@ -1191,7 +1191,7 @@ lookup_symbol_aux_symtabs (int block_ind
   {
     bv = BLOCKVECTOR (s);
     block = BLOCKVECTOR_BLOCK (bv, block_index);
-    sym = lookup_block_symbol (block, name, mangled_name, domain);
+    sym = lookup_block_symbol (block, name, linkage_name, domain);
     if (sym)
       {
 	block_found = block;
@@ -1211,7 +1211,7 @@ lookup_symbol_aux_symtabs (int block_ind
 
 static struct symbol *
 lookup_symbol_aux_psymtabs (int block_index, const char *name,
-			    const char *mangled_name,
+			    const char *linkage_name,
 			    const domain_enum domain,
 			    struct symtab **symtab)
 {
@@ -1226,13 +1226,13 @@ lookup_symbol_aux_psymtabs (int block_in
   ALL_PSYMTABS (objfile, ps)
   {
     if (!ps->readin
-	&& lookup_partial_symbol (ps, name, mangled_name,
+	&& lookup_partial_symbol (ps, name, linkage_name,
 				  psymtab_index, domain))
       {
 	s = PSYMTAB_TO_SYMTAB (ps);
 	bv = BLOCKVECTOR (s);
 	block = BLOCKVECTOR_BLOCK (bv, block_index);
-	sym = lookup_block_symbol (block, name, mangled_name, domain);
+	sym = lookup_block_symbol (block, name, linkage_name, domain);
 	if (!sym)
 	  {
 	    /* This shouldn't be necessary, but as a last resort try
@@ -1249,7 +1249,7 @@ lookup_symbol_aux_psymtabs (int block_in
 	    block = BLOCKVECTOR_BLOCK (bv,
 				       block_index == GLOBAL_BLOCK ?
 				       STATIC_BLOCK : GLOBAL_BLOCK);
-	    sym = lookup_block_symbol (block, name, mangled_name, domain);
+	    sym = lookup_block_symbol (block, name, linkage_name, domain);
 	    if (!sym)
 	      error ("Internal: %s symbol `%s' found in %s psymtab but not in symtab.\n%s may be an inlined function, or may be a template function\n(if a template, try specifying an instantiation: %s<type>).",
 		     block_index == GLOBAL_BLOCK ? "global" : "static",
@@ -1285,7 +1285,7 @@ lookup_symbol_aux_psymtabs (int block_in
 
 static struct symbol *
 lookup_symbol_aux_minsyms (const char *name,
-			   const char *mangled_name,
+			   const char *linkage_name,
 			   const domain_enum domain,
 			   int *is_a_field_of_this,
 			   struct symtab **symtab)
@@ -1330,14 +1330,14 @@ lookup_symbol_aux_minsyms (const char *n
 	         to be clearly the wrong thing to pass as the
 	         unmangled name.  */
 	      sym =
-		lookup_block_symbol (block, name, mangled_name, domain);
+		lookup_block_symbol (block, name, linkage_name, domain);
 	      /* We kept static functions in minimal symbol table as well as
 	         in static scope. We want to find them in the symbol table. */
 	      if (!sym)
 		{
 		  block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
 		  sym = lookup_block_symbol (block, name,
-					     mangled_name, domain);
+					     linkage_name, domain);
 		}
 
 	      /* NOTE: carlton/2002-12-04: The following comment was
@@ -1628,13 +1628,13 @@ find_main_psymtab (void)
    symbol (language_cplus or language_objc set) has both the encoded and 
    non-encoded names tested for a match.
 
-   If MANGLED_NAME is non-NULL, verify that any symbol we find has this
+   If LINKAGE_NAME is non-NULL, verify that any symbol we find has this
    particular mangled name.
 */
 
 struct symbol *
 lookup_block_symbol (register const struct block *block, const char *name,
-		     const char *mangled_name,
+		     const char *linkage_name,
 		     const domain_enum domain)
 {
   register int bot, top, inc;
@@ -1650,8 +1650,8 @@ lookup_block_symbol (register const stru
       for (sym = BLOCK_BUCKET (block, hash_index); sym; sym = sym->hash_next)
 	{
 	  if (SYMBOL_DOMAIN (sym) == domain 
-	      && (mangled_name
-		  ? strcmp (DEPRECATED_SYMBOL_NAME (sym), mangled_name) == 0
+	      && (linkage_name
+		  ? strcmp (DEPRECATED_SYMBOL_NAME (sym), linkage_name) == 0
 		  : SYMBOL_MATCHES_NATURAL_NAME (sym, name)))
 	    return sym;
 	}
@@ -1720,8 +1720,8 @@ lookup_block_symbol (register const stru
 	{
 	  sym = BLOCK_SYM (block, bot);
 	  if (SYMBOL_DOMAIN (sym) == domain
-	      && (mangled_name
-		  ? strcmp (DEPRECATED_SYMBOL_NAME (sym), mangled_name) == 0
+	      && (linkage_name
+		  ? strcmp (DEPRECATED_SYMBOL_NAME (sym), linkage_name) == 0
 		  : SYMBOL_MATCHES_NATURAL_NAME (sym, name)))
 	    {
 	      return sym;
@@ -1755,8 +1755,8 @@ lookup_block_symbol (register const stru
 	{
 	  sym = BLOCK_SYM (block, bot);
 	  if (SYMBOL_DOMAIN (sym) == domain
-	      && (mangled_name
-		  ? strcmp (DEPRECATED_SYMBOL_NAME (sym), mangled_name) == 0
+	      && (linkage_name
+		  ? strcmp (DEPRECATED_SYMBOL_NAME (sym), linkage_name) == 0
 		  : SYMBOL_MATCHES_NATURAL_NAME (sym, name)))
 	    {
 	      /* If SYM has aliases, then use any alias that is active


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