Remove parameters from start_psymtab_common
authorTom Tromey <tom@tromey.com>
Thu, 10 May 2018 22:23:45 +0000 (16:23 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 10 Jan 2019 14:08:10 +0000 (07:08 -0700)
start_psymtab_common takes references to the global_psymbols and
static_psymbols vectors, but it also has an objfile parameter.  This
is redundant, so this patch simplifies the function by removing those
reference parameters.

gdb/ChangeLog
2019-01-10  Tom Tromey  <tom@tromey.com>

* xcoffread.c (xcoff_start_psymtab): Remove global_psymbols and
static_psymbols parameters.
(scan_xcoff_symtab): Update.
* psymtab.c (start_psymtab_common): Remove global_psymbols and
static_psymbols parameters.
* psympriv.h (start_psymtab_common): Update.
* mdebugread.c (parse_partial_symbols): Update.
* dwarf2read.c (create_partial_symtab): Update.
* dbxread.c (read_dbx_symtab): Update.
(start_psymtab): Remove global_psymbols and static_psymbols
parameters.

gdb/ChangeLog
gdb/dbxread.c
gdb/dwarf2read.c
gdb/mdebugread.c
gdb/psympriv.h
gdb/psymtab.c
gdb/xcoffread.c

index 99b5afd1026ea6b5c224d3eac3330ffdf337b66a..da78ec52eb23b07a2e400e56bd092e7d9901c93f 100644 (file)
@@ -1,3 +1,17 @@
+2019-01-10  Tom Tromey  <tom@tromey.com>
+
+       * xcoffread.c (xcoff_start_psymtab): Remove global_psymbols and
+       static_psymbols parameters.
+       (scan_xcoff_symtab): Update.
+       * psymtab.c (start_psymtab_common): Remove global_psymbols and
+       static_psymbols parameters.
+       * psympriv.h (start_psymtab_common): Update.
+       * mdebugread.c (parse_partial_symbols): Update.
+       * dwarf2read.c (create_partial_symtab): Update.
+       * dbxread.c (read_dbx_symtab): Update.
+       (start_psymtab): Remove global_psymbols and static_psymbols
+       parameters.
+
 2019-01-10  Tom Tromey  <tom@tromey.com>
 
        * xcoffread.c (xcoff_end_psymtab): Remove some initializations.
index 743fced220f87aa540e01da3673083a434ccd463..21a29273f26fb2fd238ce4ab3e2b94a3b88b214c 100644 (file)
@@ -298,9 +298,7 @@ static void add_old_header_file (const char *, int);
 static void add_this_object_header_file (int);
 
 static struct partial_symtab *start_psymtab (struct objfile *, const char *,
-                                            CORE_ADDR, int,
-                                            std::vector<partial_symbol *> &,
-                                            std::vector<partial_symbol *> &);
+                                            CORE_ADDR, int);
 
 /* Free up old header file tables.  */
 
@@ -1302,9 +1300,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
              {
                pst = start_psymtab (objfile,
                                     namestring, valu,
-                                    first_so_symnum * symbol_size,
-                                    objfile->global_psymbols,
-                                    objfile->static_psymbols);
+                                    first_so_symnum * symbol_size);
                pst->dirname = dirname_nso;
                dirname_nso = NULL;
              }
@@ -1916,12 +1912,10 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
 
 static struct partial_symtab *
 start_psymtab (struct objfile *objfile, const char *filename, CORE_ADDR textlow,
-              int ldsymoff, std::vector<partial_symbol *> &global_psymbols,
-              std::vector<partial_symbol *> &static_psymbols)
+              int ldsymoff)
 {
   struct partial_symtab *result =
-    start_psymtab_common (objfile, filename, textlow,
-                         global_psymbols, static_psymbols);
+    start_psymtab_common (objfile, filename, textlow);
 
   result->read_symtab_private =
     XOBNEW (&objfile->objfile_obstack, struct symloc);
index 40d173aab6f279db5bb091495978842debf38ca9..338b4832daab8736d8d537450e9bb665a01a2a7e 100644 (file)
@@ -7929,9 +7929,7 @@ create_partial_symtab (struct dwarf2_per_cu_data *per_cu, const char *name)
   struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile;
   struct partial_symtab *pst;
 
-  pst = start_psymtab_common (objfile, name, 0,
-                             objfile->global_psymbols,
-                             objfile->static_psymbols);
+  pst = start_psymtab_common (objfile, name, 0);
 
   pst->psymtabs_addrmap_supported = 1;
 
index 0583ce2f3ac123f66bed9ec4bef30ee0aa635219..766a6d15318eac713a23908ff1ba28cb401db147 100644 (file)
@@ -2619,9 +2619,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
        textlow = 0;
       pst = start_psymtab_common (objfile,
                                  fdr_name (fh),
-                                 textlow,
-                                 objfile->global_psymbols,
-                                 objfile->static_psymbols);
+                                 textlow);
       pst->read_symtab_private = XOBNEW (&objfile->objfile_obstack, symloc);
       memset (pst->read_symtab_private, 0, sizeof (struct symloc));
 
index 76893f2bf0681b429f89cf5aa05b65f706a913d3..878be2bdc6fae09c5eb426a649fac5af1bb10b64 100644 (file)
@@ -284,9 +284,7 @@ extern void add_psymbol_to_list (const char *, int,
 extern void init_psymbol_list (struct objfile *, int);
 
 extern struct partial_symtab *start_psymtab_common (struct objfile *,
-                                                   const char *, CORE_ADDR,
-                                                   std::vector<partial_symbol *> &,
-                                                   std::vector<partial_symbol *> &);
+                                                   const char *, CORE_ADDR);
 
 extern void end_psymtab_common (struct objfile *, struct partial_symtab *);
 
index 1a54ea9c8e44c8bd442d21f52eb6698b450b01c1..8e46786095254448bfedf024052056386c0f5f0d 100644 (file)
@@ -1469,17 +1469,15 @@ sort_pst_symbols (struct objfile *objfile, struct partial_symtab *pst)
 struct partial_symtab *
 start_psymtab_common (struct objfile *objfile,
                      const char *filename,
-                     CORE_ADDR textlow,
-                     std::vector<partial_symbol *> &global_psymbols,
-                     std::vector<partial_symbol *> &static_psymbols)
+                     CORE_ADDR textlow)
 {
   struct partial_symtab *psymtab;
 
   psymtab = allocate_psymtab (filename, objfile);
   psymtab->set_text_low (textlow);
   psymtab->set_text_high (psymtab->raw_text_low ()); /* default */
-  psymtab->globals_offset = global_psymbols.size ();
-  psymtab->statics_offset = static_psymbols.size ();
+  psymtab->globals_offset = objfile->global_psymbols.size ();
+  psymtab->statics_offset = objfile->static_psymbols.size ();
   return psymtab;
 }
 
index 41ff583628a5fb83df8ca388ad3108201c81cf81..59de19cf17acface43ca08457fd3eb71d84d5e42 100644 (file)
@@ -2026,16 +2026,13 @@ static unsigned int first_fun_line_offset;
 
 static struct partial_symtab *
 xcoff_start_psymtab (struct objfile *objfile,
-                    const char *filename, int first_symnum,
-                    std::vector<partial_symbol *> &global_psymbols,
-                    std::vector<partial_symbol *> &static_psymbols)
+                    const char *filename, int first_symnum)
 {
   struct partial_symtab *result =
     start_psymtab_common (objfile,
                          filename,
                          /* We fill in textlow later.  */
-                         0,
-                         global_psymbols, static_psymbols);
+                         0);
 
   result->read_symtab_private =
     XOBNEW (&objfile->objfile_obstack, struct symloc);
@@ -2317,9 +2314,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                            pst = xcoff_start_psymtab
                              (objfile,
                               filestring,
-                              symnum_before,
-                              objfile->global_psymbols,
-                              objfile->static_psymbols);
+                              symnum_before);
                          }
                      }
                    /* Activate the misc_func_recorded mechanism for
@@ -2501,9 +2496,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
 
            pst = xcoff_start_psymtab (objfile,
                                       filestring,
-                                      symnum_before,
-                                      objfile->global_psymbols,
-                                      objfile->static_psymbols);
+                                      symnum_before);
            last_csect_name = NULL;
          }
          break;