* corelow.c, exec.c, inftarg.c, m3-nat.c, op50-rom.c, procfs.c,
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index 5445c8a0a5c5559cb75f9944c11055f608821d66..a0a9820a6bdb8b051133eb1472c7252a4caf63c0 100644 (file)
@@ -52,7 +52,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "command.h"
 #include "target.h"
 #include "gdbcore.h"           /* for bfd stuff */
-#include "libbfd.h"            /* FIXME Secret internal BFD stuff (bfd_read) */
 #include "libaout.h"           /* FIXME Secret internal BFD stuff for a.out */
 #include "symfile.h"
 #include "objfiles.h"
@@ -177,10 +176,7 @@ struct complaint lbrac_mismatch_complaint =
   {"N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", 0, 0};
 
 struct complaint repeated_header_complaint =
-  {"\"repeated\" header file not previously seen, at symtab pos %d", 0, 0};
-
-struct complaint repeated_header_name_complaint =
-  {"\"repeated\" header file not previously seen, named %s", 0, 0};
+  {"\"repeated\" header file %s not previously seen, at symtab pos %d", 0, 0};
 \f
 /* During initial symbol readin, we need to have a structure to keep
    track of which psymtabs have which bincls in them.  This structure
@@ -346,8 +342,7 @@ add_old_header_file (name, instance)
        add_this_object_header_file (i);
        return;
       }
-  complain (&repeated_header_complaint, symnum);
-  complain (&repeated_header_name_complaint, name);
+  complain (&repeated_header_complaint, name, symnum);
 }
 
 /* Add to this file a "new" header file: definitions for its types follow.
@@ -568,22 +563,15 @@ dbx_symfile_read (objfile, section_offsets, mainline)
                   bfd_section_vma  (sym_bfd, DBX_TEXT_SECT (objfile)),
                   bfd_section_size (sym_bfd, DBX_TEXT_SECT (objfile)));
 
-  /* Add the dynamic symbols if we are reading the main symbol table.  */
+  /* Add the dynamic symbols.  */
 
-  if (mainline)
-    read_dbx_dynamic_symtab (section_offsets, objfile);
+  read_dbx_dynamic_symtab (section_offsets, objfile);
 
   /* Install any minimal symbols that have been collected as the current
      minimal symbols for this objfile. */
 
   install_minimal_symbols (objfile);
 
-  if (!have_partial_symbols ()) {
-    wrap_here ("");
-    printf_filtered ("(no debugging symbols found)...");
-    wrap_here ("");
-  }
-
   do_cleanups (back_to);
 }
 
@@ -876,6 +864,7 @@ find_corresponding_bincl_psymtab (name, instance)
        && STREQ (name, bincl->name))
       return bincl->pst;
 
+  complain (&repeated_header_complaint, name, symnum);
   return (struct partial_symtab *) 0;
 }
 
@@ -909,6 +898,7 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
   long dynrel_count;
   arelent **dynrels;
   CORE_ADDR sym_value;
+  char *name;
 
   /* Check that the symbol file has dynamic symbols that we know about.
      bfd_arch_unknown can happen if we are reading a sun3 symbol file
@@ -971,8 +961,12 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
          if (sym->flags & BSF_GLOBAL)
            type |= N_EXT;
 
-         record_minimal_symbol ((char *) bfd_asymbol_name (sym), sym_value,
-                                type, objfile);
+         name = (char *) bfd_asymbol_name (sym);
+         record_minimal_symbol
+           (obsavestring (name, strlen (name), &objfile -> symbol_obstack),
+            sym_value,
+            type,
+            objfile);
        }
     }
 
@@ -1002,7 +996,8 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
        counter++, relptr++)
     {
       arelent *rel = *relptr;
-      CORE_ADDR address = rel->address;
+      CORE_ADDR address =
+       rel->address + ANOFFSET (section_offsets, SECT_OFF_DATA);
 
       switch (bfd_get_arch (abfd))
        {
@@ -1023,10 +1018,12 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
          continue;
        }
 
-      prim_record_minimal_symbol (bfd_asymbol_name (*rel->sym_ptr_ptr),
-                                 address,
-                                 mst_solib_trampoline,
-                                 objfile);
+      name = bfd_asymbol_name (*rel->sym_ptr_ptr);
+      prim_record_minimal_symbol
+       (obsavestring (name, strlen (name), &objfile -> symbol_obstack),
+        address,
+        mst_solib_trampoline,
+        objfile);
     }
 
   do_cleanups (back_to);
This page took 0.024399 seconds and 4 git commands to generate.