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]

[rfa] Remove add_psymbol_with_dem_name_to_list and uses


This change should be entirely neutral.  The only caller of this
function passes the result of cplus_demangle for C++ symbols, which is
what add_psymbol_to_list would have done anyway.  The symbol's language
is properly set by the time the psymbol is added.

At that point add_psymbol_with_dem_name_to_list is dead code, and I
remove it to get rid of some deprecated references within it.

OK?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-02-16  Daniel Jacobowitz  <drow@mvista.com>

	* hpread.c (scan_procs): Remove calls to cplus_demangle and
	add_psymbol_with_dem_name_to_list.
	* symfile.c (add_psymbol_with_dem_name_to_list): Remove.
	* symfile.h (add_psymbol_with_dem_name_to_list): Remove prototype.

--- hpread.c	7 Feb 2004 23:13:47 -0000	1.45
+++ hpread.c	15 Feb 2004 23:56:30 -0000
@@ -746,26 +746,24 @@ scan_procs (int *curr_pd_p, quick_proced
       if ((trans_lang ((enum hp_language) qPD[curr_pd].language) == language_cplus) &&
 	  vt_bits[(long) qPD[curr_pd].sbAlias])		/* not a null string */
 	{
-	  /* Get mangled name for the procedure, and demangle it */
+	  /* Get mangled name for the procedure.  */
 	  rtn_name = &vt_bits[(long) qPD[curr_pd].sbAlias];
-	  rtn_dem_name = cplus_demangle (rtn_name, DMGL_ANSI | DMGL_PARAMS);
 	}
       else
 	{
 	  rtn_name = &vt_bits[(long) qPD[curr_pd].sbProc];
-	  rtn_dem_name = NULL;
 	}
 
       /* Hack to get around HP C/C++ compilers' insistence on providing
          "_MAIN_" as an alternate name for "main" */
       if ((strcmp (rtn_name, "_MAIN_") == 0) &&
 	  (strcmp (&vt_bits[(long) qPD[curr_pd].sbProc], "main") == 0))
-	rtn_dem_name = rtn_name = main_string;
+	rtn_name = main_string;
 
 #ifdef DUMPING
       if (dumping)
 	{
-	  printf ("..add %s (demangled %s), index %x to this psymtab\n", rtn_name, rtn_dem_name, curr_pd);
+	  printf ("..add %s, index %x to this psymtab\n", rtn_name, curr_pd);
 	}
 #endif
 
@@ -786,31 +784,23 @@ scan_procs (int *curr_pd_p, quick_proced
          the correct list in the psymtab. - RT */
       dn_bufp = hpread_get_lntt (qPD[curr_pd].isym, objfile);
       if (dn_bufp->dfunc.global)
-	add_psymbol_with_dem_name_to_list (rtn_name,
-					   strlen (rtn_name),
-					   rtn_dem_name,
-					   strlen (rtn_dem_name),
-					   VAR_DOMAIN,
-					   LOC_BLOCK,	/* "I am a routine"        */
-					   &objfile->global_psymbols,
-					   (qPD[curr_pd].adrStart +	/* Starting address of rtn */
-				 ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))),
-					   0,	/* core addr?? */
-		      trans_lang ((enum hp_language) qPD[curr_pd].language),
-					   objfile);
+	add_psymbol_to_list (rtn_name, strlen (rtn_name), VAR_DOMAIN,
+			     LOC_BLOCK,	/* "I am a routine"        */
+			     &objfile->global_psymbols,
+			     (qPD[curr_pd].adrStart +	/* Starting address of rtn */
+			      ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))),
+			     0,	/* core addr?? */
+			     trans_lang ((enum hp_language) qPD[curr_pd].language),
+			     objfile);
       else
-	add_psymbol_with_dem_name_to_list (rtn_name,
-					   strlen (rtn_name),
-					   rtn_dem_name,
-					   strlen (rtn_dem_name),
-					   VAR_DOMAIN,
-					   LOC_BLOCK,	/* "I am a routine"        */
-					   &objfile->static_psymbols,
-					   (qPD[curr_pd].adrStart +	/* Starting address of rtn */
-				 ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))),
-					   0,	/* core addr?? */
-		      trans_lang ((enum hp_language) qPD[curr_pd].language),
-					   objfile);
+	add_psymbol_to_list (rtn_name, strlen (rtn_name), VAR_DOMAIN,
+			     LOC_BLOCK,	/* "I am a routine"        */
+			     &objfile->static_psymbols,
+			     (qPD[curr_pd].adrStart +	/* Starting address of rtn */
+			      ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))),
+			     0,	/* core addr?? */
+			     trans_lang ((enum hp_language) qPD[curr_pd].language),
+			     objfile);
 
       symbol_count++;
       *curr_pd_p = ++curr_pd;	/* bump up count & reflect in caller */
--- symfile.c	15 Feb 2004 15:16:29 -0000	1.123
+++ symfile.c	15 Feb 2004 23:56:36 -0000
@@ -2611,75 +2611,6 @@ add_psymbol_to_list (char *name, int nam
   return psym;
 }
 
-/* Add a symbol with a long value to a psymtab. This differs from
- * add_psymbol_to_list above in taking both a mangled and a demangled
- * name. */
-
-void
-add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name,
-				   int dem_namelength, domain_enum domain,
-				   enum address_class class,
-				   struct psymbol_allocation_list *list, long val,	/* Value as a long */
-				   CORE_ADDR coreaddr,	/* Value as a CORE_ADDR */
-				   enum language language,
-				   struct objfile *objfile)
-{
-  struct partial_symbol *psym;
-  char *buf = alloca (namelength + 1);
-  /* psymbol is static so that there will be no uninitialized gaps in the
-     structure which might contain random data, causing cache misses in
-     bcache. */
-  static struct partial_symbol psymbol;
-
-  /* Create local copy of the partial symbol */
-
-  memcpy (buf, name, namelength);
-  buf[namelength] = '\0';
-  DEPRECATED_SYMBOL_NAME (&psymbol) = deprecated_bcache (buf, namelength + 1,
-							 objfile->psymbol_cache);
-
-  buf = alloca (dem_namelength + 1);
-  memcpy (buf, dem_name, dem_namelength);
-  buf[dem_namelength] = '\0';
-
-  switch (language)
-    {
-    case language_c:
-    case language_cplus:
-      SYMBOL_CPLUS_DEMANGLED_NAME (&psymbol) =
-	deprecated_bcache (buf, dem_namelength + 1, objfile->psymbol_cache);
-      break;
-      /* FIXME What should be done for the default case? Ignoring for now. */
-    }
-
-  /* val and coreaddr are mutually exclusive, one of them *will* be zero */
-  if (val != 0)
-    {
-      SYMBOL_VALUE (&psymbol) = val;
-    }
-  else
-    {
-      SYMBOL_VALUE_ADDRESS (&psymbol) = coreaddr;
-    }
-  SYMBOL_SECTION (&psymbol) = 0;
-  SYMBOL_LANGUAGE (&psymbol) = language;
-  PSYMBOL_DOMAIN (&psymbol) = domain;
-  PSYMBOL_CLASS (&psymbol) = class;
-  SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language);
-
-  /* Stash the partial symbol away in the cache */
-  psym = deprecated_bcache (&psymbol, sizeof (struct partial_symbol),
-			    objfile->psymbol_cache);
-
-  /* Save pointer to partial symbol in psymtab, growing symtab if needed. */
-  if (list->next >= list->list + list->size)
-    {
-      extend_psymbol_list (list, objfile);
-    }
-  *list->next++ = psym;
-  OBJSTAT (objfile, n_psyms++);
-}
-
 /* Initialize storage for partial symbols.  */
 
 void
--- symfile.h	14 Feb 2004 15:46:33 -0000	1.27
+++ symfile.h	15 Feb 2004 23:56:36 -0000
@@ -159,15 +159,6 @@ struct partial_symbol *add_psymbol_to_li
 					    long, CORE_ADDR,
 					    enum language, struct objfile *);
 
-extern void add_psymbol_with_dem_name_to_list (char *, int, char *, int,
-					       domain_enum,
-					       enum address_class,
-					       struct psymbol_allocation_list
-					       *, long, CORE_ADDR,
-					       enum language,
-					       struct objfile *);
-
-
 extern void init_psymbol_list (struct objfile *, int);
 
 extern void sort_pst_symbols (struct partial_symtab *);


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