+Sun Oct 3 15:54:51 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * objfiles.h (objfile): New slot sym_stab_info, use by all
+ stab-reading formats.
+ * gdb-stabs.h (DBX_SYMFILE_INFO): Access sym_stab_info instead of
+ sym_private.
+ * coffread.c (coff_symfile_init): Alloc struct for sym_stab_info.
+ * dbxread.c, elfread.c, paread.c: Change sym_private references to
+ sym_stab_info references.
+
Sat Oct 2 19:28:35 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* mipsread.c, objfiles.c, utils.c: Use PTR not void *. RISC/OS
unsigned char size_temp[DBX_STRINGTAB_SIZE_SIZE];
/* Allocate struct to keep track of the symfile */
- objfile->sym_private = (PTR)
+ objfile->sym_stab_info = (PTR)
xmmalloc (objfile -> md, sizeof (struct dbx_symfile_info));
/* FIXME POKING INSIDE BFD DATA STRUCTURES */
dbx_symfile_finish (objfile)
struct objfile *objfile;
{
- if (objfile->sym_private != NULL)
+ if (objfile->sym_stab_info != NULL)
{
- mfree (objfile -> md, objfile->sym_private);
+ mfree (objfile -> md, objfile->sym_stab_info);
}
free_header_files ();
}
return new;
}
\f
+/* FIXME: The only difference between this and elfstab_build_psymtabs is
+ the call to install_minimal_symbols for elf. If the differences are
+ really that small, the code should be shared. */
+
/* Scan and build partial symbols for an coff symbol file.
The coff file has already been processed to get its minimal symbols.
/* There is already a dbx_symfile_info allocated by our caller.
It might even contain some info from the coff symtab to help us. */
- info = (struct dbx_symfile_info *) objfile->sym_private;
+ info = (struct dbx_symfile_info *) objfile->sym_stab_info;
DBX_TEXT_SECT (objfile) = bfd_get_section_by_name (sym_bfd, ".text");
if (!DBX_TEXT_SECT (objfile))
/* There is already a dbx_symfile_info allocated by our caller.
It might even contain some info from the ELF symtab to help us. */
- info = (struct dbx_symfile_info *) objfile->sym_private;
+ info = (struct dbx_symfile_info *) objfile->sym_stab_info;
DBX_TEXT_SECT (objfile) = bfd_get_section_by_name (sym_bfd, ".text");
if (!DBX_TEXT_SECT (objfile))
seen any section info for it yet. */
asymbol *filesym = 0;
struct dbx_symfile_info *dbx = (struct dbx_symfile_info *)
- objfile->sym_private;
+ objfile->sym_stab_info;
unsigned long size;
storage_needed = get_symtab_upper_bound (abfd);
memset ((char *) &ei, 0, sizeof (ei));
/* Allocate struct to keep track of the symfile */
- objfile->sym_private = (PTR)
+ objfile->sym_stab_info = (PTR)
xmmalloc (objfile -> md, sizeof (struct dbx_symfile_info));
- memset ((char *) objfile->sym_private, 0, sizeof (struct dbx_symfile_info));
+ memset ((char *) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info));
make_cleanup (free_elfinfo, (PTR) objfile);
/* Process the normal ELF symbol table first. This may write some
- chain of info into the dbx_symfile_info in objfile->sym_private,
+ chain of info into the dbx_symfile_info in objfile->sym_stab_info,
which can later be used by elfstab_offset_sections. */
/* FIXME, should take a section_offsets param, not just an offset. */
do_cleanups (back_to);
}
-/* This cleans up the objfile's sym_private pointer, and the chain of
+/* This cleans up the objfile's sym_stab_info pointer, and the chain of
stab_section_info's, that might be dangling from it. */
static void
{
struct objfile *objfile = (struct objfile *)objp;
struct dbx_symfile_info *dbxinfo = (struct dbx_symfile_info *)
- objfile->sym_private;
+ objfile->sym_stab_info;
struct stab_section_info *ssi, *nssi;
ssi = dbxinfo->stab_section_info;
elf_symfile_finish (objfile)
struct objfile *objfile;
{
- if (objfile -> sym_private != NULL)
+ if (objfile -> sym_stab_info != NULL)
{
- mfree (objfile -> md, objfile -> sym_private);
+ mfree (objfile -> md, objfile -> sym_stab_info);
}
}
{
char *filename = pst->filename;
struct dbx_symfile_info *dbx = (struct dbx_symfile_info *)
- objfile->sym_private;
+ objfile->sym_stab_info;
struct stab_section_info *maybe = dbx->stab_section_info;
struct stab_section_info *questionable = 0;
int i;
};
/* Information is passed among various dbxread routines for accessing
- symbol files. A pointer to this structure is kept in the sym_private
+ symbol files. A pointer to this structure is kept in the sym_stab_info
field of the objfile struct. */
struct dbx_symfile_info {
of the original .o files before linking. */
};
-#define DBX_SYMFILE_INFO(o) ((struct dbx_symfile_info *)((o)->sym_private))
+#define DBX_SYMFILE_INFO(o) ((struct dbx_symfile_info *)((o)->sym_stab_info))
#define DBX_TEXT_SECT(o) (DBX_SYMFILE_INFO(o)->text_sect)
#define DBX_SYMCOUNT(o) (DBX_SYMFILE_INFO(o)->symcount)
#define DBX_STRINGTAB(o) (DBX_SYMFILE_INFO(o)->stringtab)
struct entry_info ei;
+ /* Information about stabs. Will be filled in with a dbx_symfile_info
+ struct by those readers that need it. */
+
+ PTR sym_stab_info;
+
/* Hook for information for use by the symbol reader (currently used
for information shared by sym_init and sym_read). It is
typically a pointer to malloc'd memory. The symbol reader's finish
do_cleanups (back_to);
}
-/* This cleans up the objfile's sym_private pointer, and the chain of
+/* This cleans up the objfile's sym_stab_info pointer, and the chain of
stab_section_info's, that might be dangling from it. */
static void
{
struct objfile *objfile = (struct objfile *)objp;
struct dbx_symfile_info *dbxinfo = (struct dbx_symfile_info *)
- objfile->sym_private;
+ objfile->sym_stab_info;
struct stab_section_info *ssi, *nssi;
ssi = dbxinfo->stab_section_info;
pa_symfile_finish (objfile)
struct objfile *objfile;
{
- if (objfile -> sym_private != NULL)
+ if (objfile -> sym_stab_info != NULL)
{
- mfree (objfile -> md, objfile -> sym_private);
+ mfree (objfile -> md, objfile -> sym_stab_info);
}
}
stringsect = bfd_get_section_by_name (sym_bfd, "$GDB_STRINGS$");
/* Allocate struct to keep track of the symfile */
- objfile->sym_private = (PTR)
+ objfile->sym_stab_info = (PTR)
xmmalloc (objfile -> md, sizeof (struct dbx_symfile_info));
- memset ((PTR) objfile->sym_private, 0, sizeof (struct dbx_symfile_info));
+ memset ((PTR) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info));
if (!stabsect)
return;