* tui/tui-stack.c, tui/tui-win.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c: Ditto.
+2004-02-07 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.
+
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* objfiles.h (struct objfile): Add objfile_obstack field.
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
- 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.
+ /* Read the string table and stash it away in the objfile_obstack.
+ When we blow away the objfile 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.
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));
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;
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 *));
/* 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) =
/* 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;
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. */
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. */
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. */
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;
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)
/* 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
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;
/* 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)
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)
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;
/* 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.
/* 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];
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;
/* 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
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;
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;
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;
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 *));
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) =
/* 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;
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;
if (!p)
{
p = ((struct mdebug_pending *)
- obstack_alloc (¤t_objfile->psymbol_obstack,
+ obstack_alloc (¤t_objfile->objfile_obstack,
sizeof (struct mdebug_pending)));
p->s = sh;
p->t = t;
&& (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;
/* 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 *));
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));
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++)
/* 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;
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))
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;
{
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);
/* 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;
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 *) §ion, sizeof (section));
+ obstack_grow (&objfile->objfile_obstack, (char *) §ion, sizeof (section));
objfile->sections_end = (struct obj_section *) (((unsigned long) objfile->sections_end) + 1);
}
/* 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);
}
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);
}
/* 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:
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;
}
/* 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
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;
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
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
/* 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.
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;
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. */
/* 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.
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
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 */
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 */
}
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 */
}
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 */
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 */
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;
/* 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.
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;
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));
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);
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)));
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;
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",
/* 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));
}
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.
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:
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",
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. */
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
/* 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.
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;
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 *));
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;
/* 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;
/* 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;
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. */