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/ob] unify objfile obstacks(2/4)



Move psymbol_obstack to objfile_obstack.


2004-02-06  Elena Zannoni  <ezannoni@redhat.com>
 
        * dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
        coffstab_build_psymtabs, elfstab_build_psymtabs)
        (stabsect_build_psymtabs): Replace psymbol_obstack with
        objfile_obstack.
        * dwarf2-frame.c (decode_frame_entry_1): Ditto.
        * dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
        Ditto.
        * dwarfread.c (scan_compilation_units): Ditto.
        * elfread.c (elfstab_offset_sections): Ditto.
        * hppa-tdep.c (read_unwind_info): Ditto.
        * hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
        (hpread_end_psymtab): Ditto.
        * mdebugread.c (mdebug_build_psymtabs, add_pending)
        (parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
        Ditto.
        * mips-tdep.c (non_heuristic_proc_desc): Ditto.
        * objfiles.c (add_to_objfile_sections)
        (build_objfile_section_table): Ditto.
        (allocate_objfile): Remove init of psymbol_obstack.
        (free_objfile): Remove freeing of psymbol_obstack.
        * objfiles.h (struct objfile): Remove field
        psymbol_obstack. Update comments.
        * pa64solib.c (pa64_solib_add_solib_objfile): Replace
        psymbol_obstack with objfile_obstack.
        * solib-sunos.c (allocate_rt_common_objfile): Remove init of
        psymbol_obstack.
        * somread.c (som_symfile_offsets, init_import_symbols)
        (init_export_symbols): Replace psymbol_obstack with
        objfile_obstack.
        * somsolib.c (som_solib_add_solib_objfile): Ditto.
        * symfile.c (default_symfile_offsets, syms_from_objfile)
        (reread_symbols): Remove freeing and init of psymbol_obstack.
        (cashier_psymtab): Update comment.
        * symmisc.c (print_objfile_statistics): Don't report stats for
        psymbol obstack.
        * symtab.h (struct general_symbol_info, struct partial_symtab):
        Update comments.
        * xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
        (xcoff_symfile_offsets): Replace psymbol_obstack with
        objfile_obstack.


diff -u -p ../../../pristine/src/gdb/dbxread.c ./dbxread.c
--- ../../../pristine/src/gdb/dbxread.c	2004-02-05 18:44:16.000000000 -0500
+++ ./dbxread.c	2004-02-05 19:03:14.000000000 -0500
@@ -651,14 +651,14 @@ dbx_symfile_init (struct objfile *objfil
   DBX_SYMCOUNT (objfile) = bfd_get_symcount (sym_bfd);
   DBX_SYMTAB_OFFSET (objfile) = SYMBOL_TABLE_OFFSET;
 
-  /* Read the string table and stash it away in the psymbol_obstack.  It is
+  /* Read the string table and stash it away in the objfile_obstack.  It is
      only needed as long as we need to expand psymbols into full symbols,
      so when we blow away the psymbol the string table goes away as well.
      Note that gdb used to use the results of attempting to malloc the
      string table, based on the size it read, as a form of sanity check
      for botched byte swapping, on the theory that a byte swapped string
      table size would be so totally bogus that the malloc would fail.  Now
-     that we put in on the psymbol_obstack, we can't do this since gdb gets
+     that we put in on the objfile_obstack, we can't do this since gdb gets
      a fatal error (out of virtual memory) if the size is bogus.  We can
      however at least check to see if the size is less than the size of
      the size field itself, or larger than the size of the entire file.
@@ -710,7 +710,7 @@ dbx_symfile_init (struct objfile *objfil
 		   DBX_STRINGTAB_SIZE (objfile));
 
 	  DBX_STRINGTAB (objfile) =
-	    (char *) obstack_alloc (&objfile->psymbol_obstack,
+	    (char *) obstack_alloc (&objfile->objfile_obstack,
 				    DBX_STRINGTAB_SIZE (objfile));
 	  OBJSTAT (objfile, sz_strtab += DBX_STRINGTAB_SIZE (objfile));
 
@@ -2147,7 +2147,7 @@ start_psymtab (struct objfile *objfile, 
 			filename, textlow, global_syms, static_syms);
 
   result->read_symtab_private = (char *)
-    obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
+    obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc));
   LDSYMOFF (result) = ldsymoff;
   result->read_symtab = dbx_psymtab_to_symtab;
   SYMBOL_SIZE (result) = symbol_size;
@@ -2269,7 +2269,7 @@ end_psymtab (struct partial_symtab *pst,
   if (number_dependencies)
     {
       pst->dependencies = (struct partial_symtab **)
-	obstack_alloc (&objfile->psymbol_obstack,
+	obstack_alloc (&objfile->objfile_obstack,
 		    number_dependencies * sizeof (struct partial_symtab *));
       memcpy (pst->dependencies, dependency_list,
 	      number_dependencies * sizeof (struct partial_symtab *));
@@ -2285,7 +2285,7 @@ end_psymtab (struct partial_symtab *pst,
       /* Copy the sesction_offsets array from the main psymtab. */
       subpst->section_offsets = pst->section_offsets;
       subpst->read_symtab_private =
-	(char *) obstack_alloc (&objfile->psymbol_obstack,
+	(char *) obstack_alloc (&objfile->objfile_obstack,
 				sizeof (struct symloc));
       LDSYMOFF (subpst) =
 	LDSYMLEN (subpst) =
@@ -2295,7 +2295,7 @@ end_psymtab (struct partial_symtab *pst,
       /* We could save slight bits of space by only making one of these,
          shared by the entire set of include files.  FIXME-someday.  */
       subpst->dependencies = (struct partial_symtab **)
-	obstack_alloc (&objfile->psymbol_obstack,
+	obstack_alloc (&objfile->objfile_obstack,
 		       sizeof (struct partial_symtab *));
       subpst->dependencies[0] = pst;
       subpst->number_of_dependencies = 1;
@@ -3344,7 +3344,7 @@ coffstab_build_psymtabs (struct objfile 
   if (stabstrsize > bfd_get_size (sym_bfd))
     error ("ridiculous string table size: %d bytes", stabstrsize);
   DBX_STRINGTAB (objfile) = (char *)
-    obstack_alloc (&objfile->psymbol_obstack, stabstrsize + 1);
+    obstack_alloc (&objfile->objfile_obstack, stabstrsize + 1);
   OBJSTAT (objfile, sz_strtab += stabstrsize + 1);
 
   /* Now read in the string table in one big gulp.  */
@@ -3442,7 +3442,7 @@ elfstab_build_psymtabs (struct objfile *
   if (stabstrsize > bfd_get_size (sym_bfd))
     error ("ridiculous string table size: %d bytes", stabstrsize);
   DBX_STRINGTAB (objfile) = (char *)
-    obstack_alloc (&objfile->psymbol_obstack, stabstrsize + 1);
+    obstack_alloc (&objfile->objfile_obstack, stabstrsize + 1);
   OBJSTAT (objfile, sz_strtab += stabstrsize + 1);
 
   /* Now read in the string table in one big gulp.  */
@@ -3536,7 +3536,7 @@ stabsect_build_psymtabs (struct objfile 
   if (DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
     error ("ridiculous string table size: %d bytes", DBX_STRINGTAB_SIZE (objfile));
   DBX_STRINGTAB (objfile) = (char *)
-    obstack_alloc (&objfile->psymbol_obstack, DBX_STRINGTAB_SIZE (objfile) + 1);
+    obstack_alloc (&objfile->objfile_obstack, DBX_STRINGTAB_SIZE (objfile) + 1);
   OBJSTAT (objfile, sz_strtab += DBX_STRINGTAB_SIZE (objfile) + 1);
 
   /* Now read in the string table in one big gulp.  */
diff -u -p ../../../pristine/src/gdb/dwarf2-frame.c ./dwarf2-frame.c
--- ../../../pristine/src/gdb/dwarf2-frame.c	2004-02-05 15:52:33.000000000 -0500
+++ ./dwarf2-frame.c	2004-02-05 19:03:35.000000000 -0500
@@ -1238,7 +1238,7 @@ decode_frame_entry_1 (struct comp_unit *
 	return end;
 
       cie = (struct dwarf2_cie *)
-	obstack_alloc (&unit->objfile->psymbol_obstack,
+	obstack_alloc (&unit->objfile->objfile_obstack,
 		       sizeof (struct dwarf2_cie));
       cie->initial_instructions = NULL;
       cie->cie_pointer = cie_pointer;
@@ -1354,7 +1354,7 @@ decode_frame_entry_1 (struct comp_unit *
 	return NULL;
 
       fde = (struct dwarf2_fde *)
-	obstack_alloc (&unit->objfile->psymbol_obstack,
+	obstack_alloc (&unit->objfile->objfile_obstack,
 		       sizeof (struct dwarf2_fde));
       fde->cie = find_cie (unit, cie_pointer);
       if (fde->cie == NULL)
diff -u -p ../../../pristine/src/gdb/dwarf2read.c ./dwarf2read.c
--- ../../../pristine/src/gdb/dwarf2read.c	2004-02-05 18:44:49.000000000 -0500
+++ ./dwarf2read.c	2004-02-05 19:04:17.000000000 -0500
@@ -446,7 +446,7 @@ static int isreg;		/* Object lives in re
 /* We put a pointer to this structure in the read_symtab_private field
    of the psymtab.
    The complete dwarf information for an objfile is kept in the
-   psymbol_obstack, so that absolute die references can be handled.
+   objfile_obstack, so that absolute die references can be handled.
    Most of the information in this structure is related to an entire
    object file and could be passed via the sym_private field of the objfile.
    It is however conceivable that dwarf2 might not be the only type
@@ -1256,7 +1256,7 @@ dwarf2_build_psymtabs_hard (struct objfi
 				  objfile->static_psymbols.next);
 
       pst->read_symtab_private = (char *)
-	obstack_alloc (&objfile->psymbol_obstack, sizeof (struct dwarf2_pinfo));
+	obstack_alloc (&objfile->objfile_obstack, sizeof (struct dwarf2_pinfo));
       DWARF_INFO_BUFFER (pst) = dwarf_info_buffer;
       DWARF_INFO_OFFSET (pst) = beg_of_comp_unit - dwarf_info_buffer;
       DWARF_ABBREV_BUFFER (pst) = dwarf_abbrev_buffer;
@@ -4132,7 +4132,7 @@ make_cleanup_free_die_list (struct die_i
 
 
 /* Read the contents of the section at OFFSET and of size SIZE from the
-   object file specified by OBJFILE into the psymbol_obstack and return it.  */
+   object file specified by OBJFILE into the objfile_obstack and return it.  */
 
 char *
 dwarf2_read_section (struct objfile *objfile, asection *sectp)
@@ -4144,7 +4144,7 @@ dwarf2_read_section (struct objfile *obj
   if (size == 0)
     return NULL;
 
-  buf = (char *) obstack_alloc (&objfile->psymbol_obstack, size);
+  buf = (char *) obstack_alloc (&objfile->objfile_obstack, size);
   retbuf
     = (char *) symfile_relocate_debug_section (abfd, sectp, (bfd_byte *) buf);
   if (retbuf != NULL)
diff -u -p ../../../pristine/src/gdb/dwarfread.c ./dwarfread.c
--- ../../../pristine/src/gdb/dwarfread.c	2004-02-06 13:50:35.000000000 -0500
+++ ./dwarfread.c	2004-02-06 13:32:25.000000000 -0500
@@ -2800,7 +2800,7 @@ scan_compilation_units (char *thisdie, c
 
 	  pst->texthigh = di.at_high_pc;
 	  pst->read_symtab_private = (char *)
-	    obstack_alloc (&objfile->psymbol_obstack,
+	    obstack_alloc (&objfile->objfile_obstack,
 			   sizeof (struct dwfinfo));
 	  DBFOFF (pst) = dbfoff;
 	  DBROFF (pst) = curoff;
diff -u -p ../../../pristine/src/gdb/elfread.c ./elfread.c
--- ../../../pristine/src/gdb/elfread.c	2003-12-17 14:18:38.000000000 -0500
+++ ./elfread.c	2004-02-06 13:32:34.000000000 -0500
@@ -1,7 +1,7 @@
 /* Read ELF (Executable and Linking Format) object files for GDB.
 
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    Written by Fred Fish at Cygnus Support.
 
@@ -712,7 +712,7 @@ elfstab_offset_sections (struct objfile 
       /* Found it!  Allocate a new psymtab struct, and fill it in.  */
       maybe->found++;
       pst->section_offsets = (struct section_offsets *)
-	obstack_alloc (&objfile->psymbol_obstack, 
+	obstack_alloc (&objfile->objfile_obstack, 
 		       SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
       for (i = 0; i < maybe->num_sections; i++)
 	(pst->section_offsets)->offsets[i] = maybe->sections[i];
diff -u -p ../../../pristine/src/gdb/hppa-tdep.c ./hppa-tdep.c
--- ../../../pristine/src/gdb/hppa-tdep.c	2004-02-05 15:52:33.000000000 -0500
+++ ./hppa-tdep.c	2004-02-05 19:05:25.000000000 -0500
@@ -510,7 +510,7 @@ read_unwind_info (struct objfile *objfil
   obj_private_data_t *obj_private;
 
   text_offset = ANOFFSET (objfile->section_offsets, 0);
-  ui = (struct obj_unwind_info *) obstack_alloc (&objfile->psymbol_obstack,
+  ui = (struct obj_unwind_info *) obstack_alloc (&objfile->objfile_obstack,
 					   sizeof (struct obj_unwind_info));
 
   ui->table = NULL;
@@ -560,7 +560,7 @@ read_unwind_info (struct objfile *objfil
 
   /* Allocate memory for the unwind table.  */
   ui->table = (struct unwind_table_entry *)
-    obstack_alloc (&objfile->psymbol_obstack, total_size);
+    obstack_alloc (&objfile->objfile_obstack, total_size);
   ui->last = total_entries - 1;
 
   /* Now read in each unwind section and internalize the standard unwind
@@ -623,7 +623,7 @@ read_unwind_info (struct objfile *objfil
   if (objfile->obj_private == NULL)
     {
       obj_private = (obj_private_data_t *)
-	obstack_alloc (&objfile->psymbol_obstack,
+	obstack_alloc (&objfile->objfile_obstack,
 		       sizeof (obj_private_data_t));
       obj_private->unwind_info = NULL;
       obj_private->so_info = NULL;
diff -u -p ../../../pristine/src/gdb/hpread.c ./hpread.c
--- ../../../pristine/src/gdb/hpread.c	2004-02-05 17:28:45.000000000 -0500
+++ ./hpread.c	2004-02-05 19:05:54.000000000 -0500
@@ -1973,7 +1973,7 @@ hpread_build_psymtabs (struct objfile *o
 		    if (!have_name)
 		      {
 			pst->filename = (char *)
-			  obstack_alloc (&pst->objfile->psymbol_obstack,
+			  obstack_alloc (&pst->objfile->objfile_obstack,
 					 strlen (namestring) + 1);
 			strcpy (pst->filename, namestring);
 			have_name = 1;
@@ -2392,7 +2392,7 @@ hpread_start_psymtab (struct objfile *ob
 
   result->textlow += offset;
   result->read_symtab_private = (char *)
-    obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
+    obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc));
   LDSYMOFF (result) = ldsymoff;
   result->read_symtab = hpread_psymtab_to_symtab;
 
@@ -2453,7 +2453,7 @@ hpread_end_psymtab (struct partial_symta
   if (number_dependencies)
     {
       pst->dependencies = (struct partial_symtab **)
-	obstack_alloc (&objfile->psymbol_obstack,
+	obstack_alloc (&objfile->objfile_obstack,
 		    number_dependencies * sizeof (struct partial_symtab *));
       memcpy (pst->dependencies, dependency_list,
 	      number_dependencies * sizeof (struct partial_symtab *));
@@ -2468,7 +2468,7 @@ hpread_end_psymtab (struct partial_symta
 
       subpst->section_offsets = pst->section_offsets;
       subpst->read_symtab_private =
-	(char *) obstack_alloc (&objfile->psymbol_obstack,
+	(char *) obstack_alloc (&objfile->objfile_obstack,
 				sizeof (struct symloc));
       LDSYMOFF (subpst) =
 	LDSYMLEN (subpst) =
@@ -2478,7 +2478,7 @@ hpread_end_psymtab (struct partial_symta
       /* We could save slight bits of space by only making one of these,
          shared by the entire set of include files.  FIXME-someday.  */
       subpst->dependencies = (struct partial_symtab **)
-	obstack_alloc (&objfile->psymbol_obstack,
+	obstack_alloc (&objfile->objfile_obstack,
 		       sizeof (struct partial_symtab *));
       subpst->dependencies[0] = pst;
       subpst->number_of_dependencies = 1;
diff -u -p ../../../pristine/src/gdb/mdebugread.c ./mdebugread.c
--- ../../../pristine/src/gdb/mdebugread.c	2004-02-05 17:29:21.000000000 -0500
+++ ./mdebugread.c	2004-02-05 19:06:12.000000000 -0500
@@ -428,7 +428,7 @@ mdebug_build_psymtabs (struct objfile *o
       char *fdr_end;
       FDR *fdr_ptr;
 
-      info->fdr = (FDR *) obstack_alloc (&objfile->psymbol_obstack,
+      info->fdr = (FDR *) obstack_alloc (&objfile->objfile_obstack,
 					 (info->symbolic_header.ifdMax
 					  * sizeof (FDR)));
       fdr_src = info->external_fdr;
@@ -581,7 +581,7 @@ add_pending (FDR *fh, char *sh, struct t
   if (!p)
     {
       p = ((struct mdebug_pending *)
-	   obstack_alloc (&current_objfile->psymbol_obstack,
+	   obstack_alloc (&current_objfile->objfile_obstack,
 			  sizeof (struct mdebug_pending)));
       p->s = sh;
       p->t = t;
@@ -2262,7 +2262,7 @@ parse_partial_symbols (struct objfile *o
       && (bfd_get_section_flags (cur_bfd, text_sect) & SEC_RELOC))
     relocatable = 1;
 
-  extern_tab = (EXTR *) obstack_alloc (&objfile->psymbol_obstack,
+  extern_tab = (EXTR *) obstack_alloc (&objfile->objfile_obstack,
 				       sizeof (EXTR) * hdr->iextMax);
 
   includes_allocated = 30;
@@ -2306,7 +2306,7 @@ parse_partial_symbols (struct objfile *o
   /* Allocate the global pending list.  */
   pending_list =
     ((struct mdebug_pending **)
-     obstack_alloc (&objfile->psymbol_obstack,
+     obstack_alloc (&objfile->objfile_obstack,
 		    hdr->ifdMax * sizeof (struct mdebug_pending *)));
   memset (pending_list, 0,
 	  hdr->ifdMax * sizeof (struct mdebug_pending *));
@@ -2558,7 +2558,7 @@ parse_partial_symbols (struct objfile *o
 				  objfile->global_psymbols.next,
 				  objfile->static_psymbols.next);
       pst->read_symtab_private = ((char *)
-				  obstack_alloc (&objfile->psymbol_obstack,
+				  obstack_alloc (&objfile->objfile_obstack,
 						 sizeof (struct symloc)));
       memset (pst->read_symtab_private, 0, sizeof (struct symloc));
 
@@ -3661,7 +3661,7 @@ parse_partial_symbols (struct objfile *o
       pst->number_of_dependencies = 0;
       pst->dependencies =
 	((struct partial_symtab **)
-	 obstack_alloc (&objfile->psymbol_obstack,
+	 obstack_alloc (&objfile->objfile_obstack,
 			((fh->crfd - 1)
 			 * sizeof (struct partial_symtab *))));
       for (s_idx = 1; s_idx < fh->crfd; s_idx++)
@@ -4609,7 +4609,7 @@ new_psymtab (char *name, struct objfile 
   /* Keep a backpointer to the file's symbols */
 
   psymtab->read_symtab_private = ((char *)
-				  obstack_alloc (&objfile->psymbol_obstack,
+				  obstack_alloc (&objfile->objfile_obstack,
 						 sizeof (struct symloc)));
   memset (psymtab->read_symtab_private, 0, sizeof (struct symloc));
   CUR_BFD (psymtab) = cur_bfd;
@@ -4740,7 +4740,7 @@ elfmdebug_build_psymtabs (struct objfile
   back_to = make_cleanup_discard_minimal_symbols ();
 
   info = ((struct ecoff_debug_info *)
-	  obstack_alloc (&objfile->psymbol_obstack,
+	  obstack_alloc (&objfile->objfile_obstack,
 			 sizeof (struct ecoff_debug_info)));
 
   if (!(*swap->read_debug_info) (abfd, sec, info))
diff -u -p ../../../pristine/src/gdb/mips-tdep.c ./mips-tdep.c
--- ../../../pristine/src/gdb/mips-tdep.c	2004-02-05 15:52:34.000000000 -0500
+++ ./mips-tdep.c	2004-02-05 19:06:37.000000000 -0500
@@ -2286,7 +2286,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, C
 	     This means that we should not bother with this method on 64-bit
 	     targets (until that is fixed).  */
 
-	  priv = obstack_alloc (&sec->objfile->psymbol_obstack,
+	  priv = obstack_alloc (&sec->objfile->objfile_obstack,
 				sizeof (struct mips_objfile_private));
 	  priv->size = 0;
 	  sec->objfile->obj_private = priv;
@@ -2295,14 +2295,14 @@ non_heuristic_proc_desc (CORE_ADDR pc, C
 	{
 	  asection *bfdsec;
 
-	  priv = obstack_alloc (&sec->objfile->psymbol_obstack,
+	  priv = obstack_alloc (&sec->objfile->objfile_obstack,
 				sizeof (struct mips_objfile_private));
 
 	  bfdsec = bfd_get_section_by_name (sec->objfile->obfd, ".pdr");
 	  if (bfdsec != NULL)
 	    {
 	      priv->size = bfd_section_size (sec->objfile->obfd, bfdsec);
-	      priv->contents = obstack_alloc (&sec->objfile->psymbol_obstack,
+	      priv->contents = obstack_alloc (&sec->objfile->objfile_obstack,
 					      priv->size);
 	      bfd_get_section_contents (sec->objfile->obfd, bfdsec,
 					priv->contents, 0, priv->size);
@@ -2354,7 +2354,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, C
 
 	      /* Fill in what we need of the proc_desc.  */
 	      proc_desc = (mips_extra_func_info_t)
-		obstack_alloc (&sec->objfile->psymbol_obstack,
+		obstack_alloc (&sec->objfile->objfile_obstack,
 			       sizeof (struct mips_extra_func_info));
 	      PROC_LOW_ADDR (proc_desc) = startaddr;
 
diff -u -p ../../../pristine/src/gdb/objfiles.c ./objfiles.c
--- ../../../pristine/src/gdb/objfiles.c	2004-02-06 13:51:41.000000000 -0500
+++ ./objfiles.c	2004-02-06 13:33:08.000000000 -0500
@@ -93,7 +93,7 @@ add_to_objfile_sections (struct bfd *abf
   section.ovly_mapped = 0;
   section.addr = bfd_section_vma (abfd, asect);
   section.endaddr = section.addr + bfd_section_size (abfd, asect);
-  obstack_grow (&objfile->psymbol_obstack, (char *) &section, sizeof (section));
+  obstack_grow (&objfile->objfile_obstack, (char *) &section, sizeof (section));
   objfile->sections_end = (struct obj_section *) (((unsigned long) objfile->sections_end) + 1);
 }
 
@@ -119,13 +119,13 @@ build_objfile_section_table (struct objf
   /* objfile->sections can be already set when reading a mapped symbol
      file.  I believe that we do need to rebuild the section table in
      this case (we rebuild other things derived from the bfd), but we
-     can't free the old one (it's in the psymbol_obstack).  So we just
+     can't free the old one (it's in the objfile_obstack).  So we just
      waste some memory.  */
 
   objfile->sections_end = 0;
   bfd_map_over_sections (objfile->obfd, add_to_objfile_sections, (char *) objfile);
   objfile->sections = (struct obj_section *)
-    obstack_finish (&objfile->psymbol_obstack);
+    obstack_finish (&objfile->objfile_obstack);
   objfile->sections_end = objfile->sections + (unsigned long) objfile->sections_end;
   return (0);
 }
@@ -165,12 +165,10 @@ allocate_objfile (bfd *abfd, int flags)
       objfile->md = NULL;
       objfile->psymbol_cache = bcache_xmalloc ();
       objfile->macro_cache = bcache_xmalloc ();
-      obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
+      obstack_specify_allocation (&objfile->objfile_obstack, 0, 0, xmalloc,
 				  xfree);
       obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
 				  xfree);
-      obstack_specify_allocation (&objfile->objfile_obstack, 0, 0, xmalloc,
-				  xfree);
 
       terminate_minimal_symbol_table (objfile);
     }
@@ -342,7 +340,7 @@ unlink_objfile (struct objfile *objfile)
 
 /* Destroy an objfile and all the symtabs and psymtabs under it.  Note
    that as much as possible is allocated on the symbol_obstack and
-   psymbol_obstack, so that the memory can be efficiently freed.
+   objfile_obstack, so that the memory can be efficiently freed.
 
    Things which we do NOT free because they are not in malloc'd memory
    or not in memory specific to the objfile include:
@@ -431,9 +429,8 @@ free_objfile (struct objfile *objfile)
   bcache_xfree (objfile->macro_cache);
   if (objfile->demangled_names_hash)
     htab_delete (objfile->demangled_names_hash);
-  obstack_free (&objfile->psymbol_obstack, 0);
-  obstack_free (&objfile->symbol_obstack, 0);
   obstack_free (&objfile->objfile_obstack, 0);
+  obstack_free (&objfile->symbol_obstack, 0);
   xmfree (objfile->md, objfile);
   objfile = NULL;
 }
diff -u -p ../../../pristine/src/gdb/objfiles.h ./objfiles.h
--- ../../../pristine/src/gdb/objfiles.h	2004-02-06 13:50:13.000000000 -0500
+++ ./objfiles.h	2004-02-06 13:33:17.000000000 -0500
@@ -294,8 +294,6 @@ struct objfile
 
     /* Obstacks to hold objects that should be freed when we load a new symbol
        table from this object file. */
-
-    struct obstack psymbol_obstack;	/* Partial symbols */
     struct obstack symbol_obstack;	/* Full symbols */
 
     /* A byte cache where we can stash arbitrary "chunks" of bytes that
@@ -312,7 +310,7 @@ struct objfile
     struct htab *demangled_names_hash;
 
     /* Vectors of all partial symbols read in from file.  The actual data
-       is stored in the psymbol_obstack. */
+       is stored in the objfile_obstack. */
 
     struct psymbol_allocation_list global_psymbols;
     struct psymbol_allocation_list static_psymbols;
@@ -402,7 +400,7 @@ struct objfile
     unsigned num_data;
 
     /* Set of relocation offsets to apply to each section.
-       Currently on the psymbol_obstack (which makes no sense, but I'm
+       Currently on the objfile_obstack (which makes no sense, but I'm
        not sure it's harming anything).
 
        These offsets indicate that all symbols (including partial and
@@ -430,7 +428,7 @@ struct objfile
        SECTIONS points to the first entry in the table, and
        SECTIONS_END points to the first location past the last entry
        in the table.  Currently the table is stored on the
-       psymbol_obstack (which makes no sense, but I'm not sure it's
+       objfile_obstack (which makes no sense, but I'm not sure it's
        harming anything).  */
 
     struct obj_section
diff -u -p ../../../pristine/src/gdb/pa64solib.c ./pa64solib.c
--- ../../../pristine/src/gdb/pa64solib.c	2003-11-12 21:12:19.000000000 -0500
+++ ./pa64solib.c	2004-02-06 13:33:28.000000000 -0500
@@ -1,6 +1,6 @@
 /* Handle HP ELF shared libraries for GDB, the GNU Debugger.
 
-   Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation,
    Inc.
 
    This file is part of GDB.
@@ -281,7 +281,7 @@ pa64_solib_add_solib_objfile (struct so_
   if (so->objfile->obj_private == NULL)
     {
       obj_private = (obj_private_data_t *)
-	obstack_alloc (&so->objfile->psymbol_obstack,
+	obstack_alloc (&so->objfile->objfile_obstack,
 		       sizeof (obj_private_data_t));
       obj_private->unwind_info = NULL;
       obj_private->so_info = NULL;
diff -u -p ../../../pristine/src/gdb/solib-sunos.c ./solib-sunos.c
--- ../../../pristine/src/gdb/solib-sunos.c	2004-02-06 13:51:54.000000000 -0500
+++ ./solib-sunos.c	2004-02-06 13:33:58.000000000 -0500
@@ -145,12 +145,10 @@ allocate_rt_common_objfile (void)
   objfile->md = NULL;
   objfile->psymbol_cache = bcache_xmalloc ();
   objfile->macro_cache = bcache_xmalloc ();
-  obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
+  obstack_specify_allocation (&objfile->objfile_obstack, 0, 0, xmalloc,
 			      xfree);
   obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
 			      xfree);
-  obstack_specify_allocation (&objfile->objfile_obstack, 0, 0, xmalloc,
-			      xfree);
   objfile->name = mstrsave (objfile->md, "rt_common");
 
   /* Add this file onto the tail of the linked list of other such files. */
diff -u -p ../../../pristine/src/gdb/somread.c ./somread.c
--- ../../../pristine/src/gdb/somread.c	2003-10-24 19:27:46.000000000 -0400
+++ ./somread.c	2004-02-06 13:34:14.000000000 -0500
@@ -1,6 +1,6 @@
 /* Read HP PA/Risc object files for GDB.
-   Copyright 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-   Free Software Foundation, Inc.
+   Copyright 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
+   2004 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support.
 
    This file is part of GDB.
@@ -432,7 +432,7 @@ som_symfile_offsets (struct objfile *obj
 
   objfile->num_sections = bfd_count_sections (objfile->obfd);
   objfile->section_offsets = (struct section_offsets *)
-    obstack_alloc (&objfile->psymbol_obstack, 
+    obstack_alloc (&objfile->objfile_obstack, 
 		   SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
 
   /* FIXME: ezannoni 2000-04-20 The section names in SOM are not
@@ -534,7 +534,7 @@ init_import_symbols (struct objfile *obj
      to do with psymbols, just a matter of convenience.  We want the
      import list to be freed when the objfile is deallocated */
   objfile->import_list
-    = (ImportEntry *) obstack_alloc (&objfile->psymbol_obstack,
+    = (ImportEntry *) obstack_alloc (&objfile->objfile_obstack,
 				   import_list_size * sizeof (ImportEntry));
 
   /* Read in the import entries, a bunch at a time */
@@ -550,7 +550,7 @@ init_import_symbols (struct objfile *obj
 	  if (buffer[i].type != (unsigned char) 0)
 	    {
 	      objfile->import_list[k]
-		= (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+		= (char *) obstack_alloc (&objfile->objfile_obstack, strlen (string_buffer + buffer[i].name) + 1);
 	      strcpy (objfile->import_list[k], string_buffer + buffer[i].name);
 	      /* Some day we might want to record the type and other information too */
 	    }
@@ -570,7 +570,7 @@ init_import_symbols (struct objfile *obj
       if (buffer[i].type != (unsigned char) 0)
 	{
 	  objfile->import_list[k]
-	    = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+	    = (char *) obstack_alloc (&objfile->objfile_obstack, strlen (string_buffer + buffer[i].name) + 1);
 	  strcpy (objfile->import_list[k], string_buffer + buffer[i].name);
 	  /* Some day we might want to record the type and other information too */
 	}
@@ -657,7 +657,7 @@ init_export_symbols (struct objfile *obj
      to do with psymbols, just a matter of convenience.  We want the
      export list to be freed when the objfile is deallocated */
   objfile->export_list
-    = (ExportEntry *) obstack_alloc (&objfile->psymbol_obstack,
+    = (ExportEntry *) obstack_alloc (&objfile->objfile_obstack,
 				   export_list_size * sizeof (ExportEntry));
 
   /* Read in the export entries, a bunch at a time */
@@ -673,7 +673,7 @@ init_export_symbols (struct objfile *obj
 	  if (buffer[i].type != (unsigned char) 0)
 	    {
 	      objfile->export_list[k].name
-		= (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+		= (char *) obstack_alloc (&objfile->objfile_obstack, strlen (string_buffer + buffer[i].name) + 1);
 	      strcpy (objfile->export_list[k].name, string_buffer + buffer[i].name);
 	      objfile->export_list[k].address = buffer[i].value;
 	      /* Some day we might want to record the type and other information too */
@@ -697,7 +697,7 @@ init_export_symbols (struct objfile *obj
       if (buffer[i].type != (unsigned char) 0)
 	{
 	  objfile->export_list[k].name
-	    = (char *) obstack_alloc (&objfile->psymbol_obstack, strlen (string_buffer + buffer[i].name) + 1);
+	    = (char *) obstack_alloc (&objfile->objfile_obstack, strlen (string_buffer + buffer[i].name) + 1);
 	  strcpy (objfile->export_list[k].name, string_buffer + buffer[i].name);
 	  /* Some day we might want to record the type and other information too */
 	  objfile->export_list[k].address = buffer[i].value;
diff -u -p ../../../pristine/src/gdb/somsolib.c ./somsolib.c
--- ../../../pristine/src/gdb/somsolib.c	2003-11-12 21:12:19.000000000 -0500
+++ ./somsolib.c	2004-02-06 13:34:24.000000000 -0500
@@ -1,7 +1,7 @@
 /* Handle HP SOM shared libraries for GDB, the GNU Debugger.
 
    Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
-   2003 Free Software Foundation, Inc.
+   2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -310,7 +310,7 @@ som_solib_add_solib_objfile (struct so_l
   if (so->objfile->obj_private == NULL)
     {
       obj_private = (obj_private_data_t *)
-	obstack_alloc (&so->objfile->psymbol_obstack,
+	obstack_alloc (&so->objfile->objfile_obstack,
 		       sizeof (obj_private_data_t));
       obj_private->unwind_info = NULL;
       obj_private->so_info = NULL;
diff -u -p ../../../pristine/src/gdb/symfile.c ./symfile.c
--- ../../../pristine/src/gdb/symfile.c	2004-02-05 17:30:55.000000000 -0500
+++ ./symfile.c	2004-02-06 13:36:39.000000000 -0500
@@ -485,7 +485,7 @@ default_symfile_offsets (struct objfile 
 
   objfile->num_sections = bfd_count_sections (objfile->obfd);
   objfile->section_offsets = (struct section_offsets *)
-    obstack_alloc (&objfile->psymbol_obstack, 
+    obstack_alloc (&objfile->objfile_obstack, 
 		   SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
   memset (objfile->section_offsets, 0, 
 	  SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
@@ -690,7 +690,7 @@ syms_from_objfile (struct objfile *objfi
       objfile->num_sections = num_offsets;
       objfile->section_offsets
         = ((struct section_offsets *)
-           obstack_alloc (&objfile->psymbol_obstack, size));
+           obstack_alloc (&objfile->objfile_obstack, size));
       memcpy (objfile->section_offsets, offsets, size);
 
       init_objfile_sect_indices (objfile);
@@ -1879,7 +1879,7 @@ reread_symbols (void)
 		       bfd_errmsg (bfd_get_error ()));
 
 	      /* Save the offsets, we will nuke them with the rest of the
-	         psymbol_obstack.  */
+	         objfile_obstack.  */
 	      num_offsets = objfile->num_sections;
 	      offsets = ((struct section_offsets *) 
 			 alloca (SIZEOF_N_SECTION_OFFSETS (num_offsets)));
@@ -1911,9 +1911,8 @@ reread_symbols (void)
 		  htab_delete (objfile->demangled_names_hash);
 		  objfile->demangled_names_hash = NULL;
 		}
-	      obstack_free (&objfile->psymbol_obstack, 0);
-	      obstack_free (&objfile->symbol_obstack, 0);
 	      obstack_free (&objfile->objfile_obstack, 0);
+	      obstack_free (&objfile->symbol_obstack, 0);
 	      objfile->sections = NULL;
 	      objfile->symtabs = NULL;
 	      objfile->psymtabs = NULL;
@@ -1939,12 +1938,10 @@ reread_symbols (void)
 	         it is empty.  */
 	      objfile->psymbol_cache = bcache_xmalloc ();
 	      objfile->macro_cache = bcache_xmalloc ();
-	      obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0,
+	      obstack_specify_allocation (&objfile->objfile_obstack, 0, 0,
 					  xmalloc, xfree);
 	      obstack_specify_allocation (&objfile->symbol_obstack, 0, 0,
 					  xmalloc, xfree);
-	      obstack_specify_allocation (&objfile->objfile_obstack, 0, 0,
-					  xmalloc, xfree);
 	      if (build_objfile_section_table (objfile))
 		{
 		  error ("Can't find the file sections in `%s': %s",
@@ -1955,7 +1952,7 @@ reread_symbols (void)
 	      /* We use the same section offsets as from last time.  I'm not
 	         sure whether that is always correct for shared libraries.  */
 	      objfile->section_offsets = (struct section_offsets *)
-		obstack_alloc (&objfile->psymbol_obstack, 
+		obstack_alloc (&objfile->objfile_obstack, 
 			       SIZEOF_N_SECTION_OFFSETS (num_offsets));
 	      memcpy (objfile->section_offsets, offsets, 
 		      SIZEOF_N_SECTION_OFFSETS (num_offsets));
@@ -2279,12 +2276,12 @@ allocate_psymtab (char *filename, struct
     }
   else
     psymtab = (struct partial_symtab *)
-      obstack_alloc (&objfile->psymbol_obstack,
+      obstack_alloc (&objfile->objfile_obstack,
 		     sizeof (struct partial_symtab));
 
   memset (psymtab, 0, sizeof (struct partial_symtab));
   psymtab->filename = obsavestring (filename, strlen (filename),
-				    &objfile->psymbol_obstack);
+				    &objfile->objfile_obstack);
   psymtab->symtab = NULL;
 
   /* Prepend it to the psymtab list for the objfile it belongs to.
@@ -2433,7 +2430,7 @@ cashier_psymtab (struct partial_symtab *
          partial_symbol lists (global_psymbols/static_psymbols) that
          this psymtab points to.  These just take up space until all
          the psymtabs are reclaimed.  Ditto the dependencies list and
-         filename, which are all in the psymbol_obstack.  */
+         filename, which are all in the objfile_obstack.  */
 
       /* We need to cashier any psymtab that has this one as a dependency... */
     again:
diff -u -p ../../../pristine/src/gdb/symmisc.c ./symmisc.c
--- ../../../pristine/src/gdb/symmisc.c	2004-02-06 13:52:21.000000000 -0500
+++ ./symmisc.c	2004-02-06 13:36:53.000000000 -0500
@@ -230,8 +230,6 @@ print_objfile_statistics (void)
     if (OBJSTAT (objfile, sz_strtab) > 0)
       printf_filtered ("  Space used by a.out string tables: %d\n",
 		       OBJSTAT (objfile, sz_strtab));
-    printf_filtered ("  Total memory used for psymbol obstack: %d\n",
-		     obstack_memory_used (&objfile->psymbol_obstack));
     printf_filtered ("  Total memory used for psymbol cache: %d\n",
 		     bcache_memory_used (objfile->psymbol_cache));
     printf_filtered ("  Total memory used for macro cache: %d\n",
diff -u -p ../../../pristine/src/gdb/symtab.h ./symtab.h
--- ../../../pristine/src/gdb/symtab.h	2004-02-05 15:52:35.000000000 -0500
+++ ./symtab.h	2004-02-05 19:11:27.000000000 -0500
@@ -88,7 +88,7 @@ struct agent_expr;
 struct general_symbol_info
 {
   /* Name of the symbol.  This is a required field.  Storage for the
-     name is allocated on the psymbol_obstack or symbol_obstack for
+     name is allocated on the objfile_obstack or symbol_obstack for
      the associated objfile.  For languages like C++ that make a
      distinction between the mangled name and demangled name, this is
      the mangled name.  */
@@ -858,7 +858,7 @@ struct symtab
 
    Even after the source file has been read into a symtab, the
    partial_symtab remains around.  They are allocated on an obstack,
-   psymbol_obstack.  FIXME, this is bad for dynamic linking or VxWorks-
+   objfile_obstack.  FIXME, this is bad for dynamic linking or VxWorks-
    style execution of a bunch of .o's.  */
 
 struct partial_symtab
diff -u -p ../../../pristine/src/gdb/xcoffread.c ./xcoffread.c
--- ../../../pristine/src/gdb/xcoffread.c	2003-12-17 14:18:40.000000000 -0500
+++ ./xcoffread.c	2004-02-06 13:37:11.000000000 -0500
@@ -1,6 +1,6 @@
 /* Read AIX xcoff symbol tables and convert to internal format, for GDB.
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Derived from coffread.c, dbxread.c, and a lot of hacking.
    Contributed by IBM Corporation.
@@ -1946,7 +1946,7 @@ xcoff_start_psymtab (struct objfile *obj
 			global_syms, static_syms);
 
   result->read_symtab_private = (char *)
-    obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
+    obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc));
   ((struct symloc *) result->read_symtab_private)->first_symnum = first_symnum;
   result->read_symtab = xcoff_psymtab_to_symtab;
 
@@ -1993,7 +1993,7 @@ xcoff_end_psymtab (struct partial_symtab
   if (number_dependencies)
     {
       pst->dependencies = (struct partial_symtab **)
-	obstack_alloc (&objfile->psymbol_obstack,
+	obstack_alloc (&objfile->objfile_obstack,
 		    number_dependencies * sizeof (struct partial_symtab *));
       memcpy (pst->dependencies, dependency_list,
 	      number_dependencies * sizeof (struct partial_symtab *));
@@ -2008,7 +2008,7 @@ xcoff_end_psymtab (struct partial_symtab
 
       subpst->section_offsets = pst->section_offsets;
       subpst->read_symtab_private =
-	(char *) obstack_alloc (&objfile->psymbol_obstack,
+	(char *) obstack_alloc (&objfile->objfile_obstack,
 				sizeof (struct symloc));
       ((struct symloc *) subpst->read_symtab_private)->first_symnum = 0;
       ((struct symloc *) subpst->read_symtab_private)->numsyms = 0;
@@ -2018,7 +2018,7 @@ xcoff_end_psymtab (struct partial_symtab
       /* We could save slight bits of space by only making one of these,
          shared by the entire set of include files.  FIXME-someday.  */
       subpst->dependencies = (struct partial_symtab **)
-	obstack_alloc (&objfile->psymbol_obstack,
+	obstack_alloc (&objfile->objfile_obstack,
 		       sizeof (struct partial_symtab *));
       subpst->dependencies[0] = pst;
       subpst->number_of_dependencies = 1;
@@ -2081,7 +2081,7 @@ swap_sym (struct internal_syment *symbol
 	  /* FIXME: wastes memory for symbols which we don't end up putting
 	     into the minimal symbols.  */
 	  char *p;
-	  p = obstack_alloc (&objfile->psymbol_obstack, E_SYMNMLEN + 1);
+	  p = obstack_alloc (&objfile->objfile_obstack, E_SYMNMLEN + 1);
 	  strncpy (p, symbol->n_name, E_SYMNMLEN);
 	  p[E_SYMNMLEN] = '\0';
 	  *name = p;
@@ -2959,7 +2959,7 @@ xcoff_symfile_offsets (struct objfile *o
 
   objfile->num_sections = bfd_count_sections (objfile->obfd);
   objfile->section_offsets = (struct section_offsets *)
-    obstack_alloc (&objfile->psymbol_obstack, 
+    obstack_alloc (&objfile->objfile_obstack, 
 		   SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
 
   /* Initialize the section indexes for future use. */



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