gdb: set only inferior_ptid in sparc_{fetch,store}_inferior_registers
[binutils-gdb.git] / gdb / xcoffread.c
index 711d8932706dd0693f2cef06d62e430b2dabb4c5..a854d4daf3740619aee1cdd87b1676e99154fd60 100644 (file)
@@ -482,7 +482,8 @@ arrange_linetable (struct linetable *oldLineTb)
   newline = 0;
   if (oldLineTb->item[0].line != 0)
     for (newline = 0;
-    newline < oldLineTb->nitems && oldLineTb->item[newline].line; ++newline)
+        newline < oldLineTb->nitems && oldLineTb->item[newline].line;
+        ++newline)
       newLineTb->item[newline] = oldLineTb->item[newline];
 
   /* Now copy function lines one by one.  */
@@ -1165,20 +1166,20 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
             to 32(0x20). So we need to read the first function auxiliary entry
             which contains the size. */
          if (cs->c_naux > 1 && ISFCN (cs->c_type))
-         {
-           /* a function entry point.  */
+           {
+             /* a function entry point.  */
 
-           fcn_start_addr = cs->c_value;
+             fcn_start_addr = cs->c_value;
 
-           /* save the function header info, which will be used
-              when `.bf' is seen.  */
-           fcn_cs_saved = *cs;
+             /* save the function header info, which will be used
+                when `.bf' is seen.  */
+             fcn_cs_saved = *cs;
 
-           /* Convert the auxent to something we can access.  */
-           bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
-                                 0, cs->c_naux, &fcn_aux_saved);
-           continue;
-         }
+             /* Convert the auxent to something we can access.  */
+             bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
+                                   0, cs->c_naux, &fcn_aux_saved);
+             continue;
+           }
          /* Read the csect auxiliary header, which is always the last by
             convention. */
          bfd_coff_swap_aux_in (abfd,
@@ -1960,11 +1961,13 @@ static unsigned int first_fun_line_offset;
    (normal).  */
 
 static legacy_psymtab *
-xcoff_start_psymtab (struct objfile *objfile,
+xcoff_start_psymtab (psymtab_storage *partial_symtabs,
+                    struct objfile *objfile,
                     const char *filename, int first_symnum)
 {
   /* We fill in textlow later.  */
-  legacy_psymtab *result = new legacy_psymtab (filename, objfile, 0);
+  legacy_psymtab *result = new legacy_psymtab (filename, partial_symtabs,
+                                              objfile->per_bfd, 0);
 
   result->read_symtab_private =
     XOBNEW (&objfile->objfile_obstack, struct symloc);
@@ -2020,7 +2023,7 @@ xcoff_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
   for (i = 0; i < num_includes; i++)
     {
       legacy_psymtab *subpst =
-       new legacy_psymtab (include_list[i], objfile);
+       new legacy_psymtab (include_list[i], partial_symtabs, objfile->per_bfd);
 
       subpst->read_symtab_private = XOBNEW (&objfile->objfile_obstack, symloc);
       ((struct symloc *) subpst->read_symtab_private)->first_symnum = 0;
@@ -2244,7 +2247,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                            /* Give all psymtabs for this source file the same
                               name.  */
                            pst = xcoff_start_psymtab
-                             (objfile,
+                             (partial_symtabs, objfile,
                               filestring,
                               symnum_before);
                          }
@@ -2427,7 +2430,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
            else
              filestring = namestring;
 
-           pst = xcoff_start_psymtab (objfile,
+           pst = xcoff_start_psymtab (partial_symtabs, objfile,
                                       filestring,
                                       symnum_before);
            last_csect_name = NULL;
@@ -2586,7 +2589,8 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                                  SECT_OFF_DATA (objfile),
                                  psymbol_placement::STATIC,
                                  symbol.n_value,
-                                 psymtab_language, objfile);
+                                 psymtab_language,
+                                 partial_symtabs, objfile);
                continue;
 
              case 'G':
@@ -2598,7 +2602,8 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                                  SECT_OFF_DATA (objfile),
                                  psymbol_placement::GLOBAL,
                                  symbol.n_value,
-                                 psymtab_language, objfile);
+                                 psymtab_language,
+                                 partial_symtabs, objfile);
                continue;
 
              case 'T':
@@ -2616,7 +2621,8 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                                                        p - namestring),
                                      true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
                                      psymbol_placement::STATIC,
-                                     0, psymtab_language, objfile);
+                                     0, psymtab_language,
+                                     partial_symtabs, objfile);
                    if (p[2] == 't')
                      {
                        /* Also a typedef with the same name.  */
@@ -2624,7 +2630,8 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                                                            p - namestring),
                                          true, VAR_DOMAIN, LOC_TYPEDEF, -1,
                                          psymbol_placement::STATIC,
-                                         0, psymtab_language, objfile);
+                                         0, psymtab_language,
+                                         partial_symtabs, objfile);
                        p += 1;
                      }
                  }
@@ -2637,7 +2644,8 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                                                        p - namestring),
                                      true, VAR_DOMAIN, LOC_TYPEDEF, -1,
                                      psymbol_placement::STATIC,
-                                     0, psymtab_language, objfile);
+                                     0, psymtab_language,
+                                     partial_symtabs, objfile);
                  }
              check_enum:
                /* If this is an enumerated type, we need to
@@ -2699,7 +2707,8 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                        pst->add_psymbol (gdb::string_view (p, q - p), true,
                                          VAR_DOMAIN, LOC_CONST, -1,
                                          psymbol_placement::STATIC,
-                                         0, psymtab_language, objfile);
+                                         0, psymtab_language,
+                                         partial_symtabs, objfile);
                        /* Point past the name.  */
                        p = q;
                        /* Skip over the value.  */
@@ -2718,7 +2727,8 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                                                    p - namestring),
                                  true, VAR_DOMAIN, LOC_CONST, -1,
                                  psymbol_placement::STATIC,
-                                 0, psymtab_language, objfile);
+                                 0, psymtab_language,
+                                 partial_symtabs, objfile);
                continue;
 
              case 'f':
@@ -2738,7 +2748,8 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                                  SECT_OFF_TEXT (objfile),
                                  psymbol_placement::STATIC,
                                  symbol.n_value,
-                                 psymtab_language, objfile);
+                                 psymtab_language,
+                                 partial_symtabs, objfile);
                continue;
 
                /* Global functions were ignored here, but now they
@@ -2769,7 +2780,8 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                                  SECT_OFF_TEXT (objfile),
                                  psymbol_placement::GLOBAL,
                                  symbol.n_value,
-                                 psymtab_language, objfile);
+                                 psymtab_language,
+                                 partial_symtabs, objfile);
                continue;
 
                /* Two things show up here (hopefully); static symbols of
@@ -2935,7 +2947,9 @@ xcoff_initial_scan (struct objfile *objfile, symfile_add_flags symfile_flags)
   /* Now that the symbol table data of the executable file are all in core,
      process them and define symbols accordingly.  */
 
-  psymtab_storage *partial_symtabs = objfile->partial_symtabs.get ();
+  psymbol_functions *psf = new psymbol_functions ();
+  psymtab_storage *partial_symtabs = psf->get_partial_symtabs ().get ();
+  objfile->qf.emplace_front (psf);
   scan_xcoff_symtab (reader, partial_symtabs, objfile);
 
   /* Install any minimal symbols that have been collected as the current
@@ -3005,7 +3019,6 @@ static const struct sym_fns xcoff_sym_fns =
   xcoff_new_init,              /* init anything gbl to entire symtab */
   xcoff_symfile_init,          /* read initial info, setup for sym_read() */
   xcoff_initial_scan,          /* read a symbol file into symtab */
-  NULL,                                /* sym_read_psymbols */
   xcoff_symfile_finish,                /* finished with file, cleanup */
   xcoff_symfile_offsets,       /* xlate offsets ext->int form */
   default_symfile_segments,    /* Get segment information from a file.  */