2003-09-12 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / symfile.c
index b1ff445e19893c2770125678e2d58aaa94a2c3d2..e2fbc2ae2eefb5ba7a2fd36cf87d5a6def7d39fe 100644 (file)
@@ -327,8 +327,8 @@ init_entry_point_info (struct objfile *objfile)
       /* Examination of non-executable.o files.  Short-circuit this stuff.  */
       objfile->ei.entry_point = INVALID_ENTRY_POINT;
     }
-  objfile->ei.entry_file_lowpc = INVALID_ENTRY_LOWPC;
-  objfile->ei.entry_file_highpc = INVALID_ENTRY_HIGHPC;
+  objfile->ei.deprecated_entry_file_lowpc = INVALID_ENTRY_LOWPC;
+  objfile->ei.deprecated_entry_file_highpc = INVALID_ENTRY_HIGHPC;
   objfile->ei.entry_func_lowpc = INVALID_ENTRY_LOWPC;
   objfile->ei.entry_func_highpc = INVALID_ENTRY_HIGHPC;
   objfile->ei.main_func_lowpc = INVALID_ENTRY_LOWPC;
@@ -710,7 +710,7 @@ syms_from_objfile (struct objfile *objfile,
       init_objfile_sect_indices (objfile);
     }
 
-#ifndef IBM6000_TARGET
+#ifndef DEPRECATED_IBM6000_TARGET
   /* This is a SVR4/SunOS specific hack, I think.  In any event, it
      screws RS/6000.  sym_offsets should be doing this sort of thing,
      because it knows the mapping between bfd sections and
@@ -758,7 +758,7 @@ syms_from_objfile (struct objfile *objfile,
          s->offset += s_addr;
        }
     }
-#endif /* not IBM6000_TARGET */
+#endif /* not DEPRECATED_IBM6000_TARGET */
 
   (*objfile->sf->sym_read) (objfile, mainline);
 
@@ -854,7 +854,12 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty,
   orig_addrs = alloc_section_addr_info (bfd_count_sections (abfd));
   my_cleanups = make_cleanup (xfree, orig_addrs);
   if (addrs)
-    *orig_addrs = *addrs;
+    {
+      int i;
+      orig_addrs->num_sections = addrs->num_sections;
+      for (i = 0; i < addrs->num_sections; i++)
+       orig_addrs->other[i] = addrs->other[i];
+    }
 
   /* If the objfile uses a mapped symbol file, and we have a psymtab for
      it, then skip reading any symbols at this time. */
@@ -1861,7 +1866,7 @@ reread_symbols (void)
     {
       if (objfile->obfd)
        {
-#ifdef IBM6000_TARGET
+#ifdef DEPRECATED_IBM6000_TARGET
          /* If this object is from a shared library, then you should
             stat on the library name, not member name. */
 
@@ -2627,9 +2632,21 @@ start_psymtab_common (struct objfile *objfile,
 }
 \f
 /* Add a symbol with a long value to a psymtab.
-   Since one arg is a struct, we pass in a ptr and deref it (sigh).  */
-
-void
+   Since one arg is a struct, we pass in a ptr and deref it (sigh).  
+   Return the partial symbol that has been added.  */
+
+/* NOTE: carlton/2003-09-11: The reason why we return the partial
+   symbol is so that callers can get access to the symbol's demangled
+   name, which they don't have any cheap way to determine otherwise.
+   (Currenly, dwarf2read.c is the only file who uses that information,
+   though it's possible that other readers might in the future.)
+   Elena wasn't thrilled about that, and I don't blame her, but we
+   couldn't come up with a better way to get that information.  If
+   it's needed in other situations, we could consider breaking up
+   SYMBOL_SET_NAMES to provide access to the demangled name lookup
+   cache.  */
+
+const struct partial_symbol *
 add_psymbol_to_list (char *name, int namelength, domain_enum domain,
                     enum address_class class,
                     struct psymbol_allocation_list *list, long val,    /* Value as a long */
@@ -2672,6 +2689,8 @@ add_psymbol_to_list (char *name, int namelength, domain_enum domain,
     }
   *list->next++ = psym;
   OBJSTAT (objfile, n_psyms++);
+
+  return psym;
 }
 
 /* Add a symbol with a long value to a psymtab. This differs from
This page took 0.02501 seconds and 4 git commands to generate.