Added new slot to objfile struct to be shared by all stab-reading formats.
authorStan Shebs <shebs@codesourcery.com>
Sun, 3 Oct 1993 23:04:25 +0000 (23:04 +0000)
committerStan Shebs <shebs@codesourcery.com>
Sun, 3 Oct 1993 23:04:25 +0000 (23:04 +0000)
gdb/ChangeLog
gdb/dbxread.c
gdb/elfread.c
gdb/gdb-stabs.h
gdb/objfiles.h
gdb/paread.c

index 5aa65ea043861d017f967ebee0e00c9781e78b22..a0a07279252b334868127daff941c991e45d9c6c 100644 (file)
@@ -1,3 +1,13 @@
+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
index e55c36a9c3b94d4452e3cdd9c7208883b7fd05c5..9d1a423607f7f94899a702237a253363fd8ef19f 100644 (file)
@@ -594,7 +594,7 @@ dbx_symfile_init (objfile)
   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 */
@@ -696,9 +696,9 @@ static void
 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 ();
 }
@@ -2056,6 +2056,10 @@ copy_pending (beg, endi, end)
   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.
 
@@ -2094,7 +2098,7 @@ coffstab_build_psymtabs (objfile, section_offsets, mainline,
 
   /* 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))
@@ -2172,7 +2176,7 @@ elfstab_build_psymtabs (objfile, section_offsets, mainline,
 
   /* 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))
index 1276deb1557d79e671ea19dea812b871c29d6066..9b9e3646d09876318fd55ca669a82b134076a93d 100644 (file)
@@ -251,7 +251,7 @@ elf_symtab_read (abfd, addr, 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);
@@ -472,13 +472,13 @@ elf_symfile_read (objfile, section_offsets, mainline)
   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.  */
@@ -535,7 +535,7 @@ elf_symfile_read (objfile, section_offsets, mainline)
   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
@@ -544,7 +544,7 @@ free_elfinfo (objp)
 {
   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;
@@ -582,9 +582,9 @@ static void
 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);
     }
 }
 
@@ -642,7 +642,7 @@ elfstab_offset_sections (objfile, pst)
 {
   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;
index c77a23089d96fcb2ce19733fdb8fa037fee10250..706dfd86b84d400f6f5c5dded97d1c17eb5b8fa0 100644 (file)
@@ -51,7 +51,7 @@ struct stab_section_info {
 };
 
 /* 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 {
@@ -65,7 +65,7 @@ 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)
index 19e7981461afac0fb42086767b7b579a0b914c0d..50226ff47e779ffeceddf033b4103155799fcf0d 100644 (file)
@@ -270,6 +270,11 @@ struct objfile
 
   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
index da3ee7d100bebee368ac73c1a825cfcc6342c539..d21aa54d26d9fd1277279d1550cf2f476eafe067 100644 (file)
@@ -325,7 +325,7 @@ pa_symfile_read (objfile, section_offsets, mainline)
   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
@@ -334,7 +334,7 @@ free_painfo (objp)
 {
   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;
@@ -371,9 +371,9 @@ static void
 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);
     }
 }
 
@@ -401,10 +401,10 @@ pa_symfile_init (objfile)
   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;
This page took 0.053872 seconds and 4 git commands to generate.