Move signatured_type::type to unshareable object
[deliverable/binutils-gdb.git] / gdb / xcoffread.c
index 735f8b088258ba78fce61ce4d53c28c5d618e04f..93bdb9b6a6567827205b2a1dfa7d376b2ec40371 100644 (file)
@@ -829,7 +829,7 @@ enter_line_range (struct subfile *subfile, unsigned beginoffset,
                  CORE_ADDR endaddr, unsigned *firstLine)
 {
   struct objfile *objfile = this_symtab_objfile;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   unsigned int curoffset;
   CORE_ADDR addr;
   void *ext_lnno;
@@ -1521,11 +1521,6 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
     }
 }
 
-#define        SYMBOL_DUP(SYMBOL1, SYMBOL2)    \
-  (SYMBOL2) = new (&objfile->objfile_obstack) symbol (); \
-  *(SYMBOL2) = *(SYMBOL1);
-
-
 #define        SYMNAME_ALLOC(NAME, ALLOCED)    \
   ((ALLOCED) ? (NAME) : obstack_strdup (&objfile->objfile_obstack, \
                                        (NAME)))
@@ -1561,8 +1556,6 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
   if (name[0] == '.')
     ++name;
 
-  initialize_objfile_symbol (sym);
-
   /* default assumptions */
   SET_SYMBOL_VALUE_ADDRESS (sym, cs->c_value + off);
   SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
@@ -1578,7 +1571,7 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
       SYMBOL_TYPE (sym) = objfile_type (objfile)->nodebug_text_symbol;
 
       SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
-      SYMBOL_DUP (sym, sym2);
+      sym2 = new (&objfile->objfile_obstack) symbol (*sym);
 
       if (cs->c_sclass == C_EXT || C_WEAKEXT)
        add_symbol_to_list (sym2, get_global_symbols ());
@@ -1821,12 +1814,12 @@ find_linenos (struct bfd *abfd, struct bfd_section *asect, void *vpinfo)
 }
 \f
 static void
-xcoff_psymtab_to_symtab_1 (legacy_psymtab *pst, struct objfile *objfile)
+xcoff_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
 {
   gdb_assert (!pst->readin);
 
   /* Read in all partial symtabs on which this one is dependent.  */
-  pst->read_dependencies (objfile);
+  pst->expand_dependencies (objfile);
 
   if (((struct symloc *) pst->read_symtab_private)->numsyms != 0)
     {
@@ -1974,7 +1967,7 @@ xcoff_start_psymtab (struct objfile *objfile,
     XOBNEW (&objfile->objfile_obstack, struct symloc);
   ((struct symloc *) result->read_symtab_private)->first_symnum = first_symnum;
   result->legacy_read_symtab = xcoff_read_symtab;
-  result->legacy_expand_psymtab = xcoff_psymtab_to_symtab_1;
+  result->legacy_expand_psymtab = xcoff_expand_psymtab;
 
   /* Deduce the source language from the filename for this psymtab.  */
   psymtab_language = deduce_language_from_filename (filename);
@@ -2050,7 +2043,7 @@ xcoff_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
       /* Empty psymtabs happen as a result of header files which don't have
          any symbols in them.  There can be a lot of them.  */
 
-      discard_psymtab (objfile, pst);
+      objfile->partial_symtabs->discard_psymtab (pst);
 
       /* Indicate that psymtab was thrown away.  */
       pst = NULL;
@@ -2121,7 +2114,7 @@ static void
 scan_xcoff_symtab (minimal_symbol_reader &reader,
                   struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   CORE_ADDR toc_offset = 0;    /* toc offset value in data section.  */
   const char *filestring = NULL;
 
This page took 0.0263 seconds and 4 git commands to generate.