2009-12-07 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Mon, 7 Dec 2009 09:36:44 +0000 (09:36 +0000)
committerTristan Gingold <gingold@adacore.com>
Mon, 7 Dec 2009 09:36:44 +0000 (09:36 +0000)
* dbxread.c (dbx_symfile_read): No need to test mainline to call
init_psymbol_list.
* xcoffread.c (xcoff_initial_scan): Ditto;
* coffread.c (coff_symfile_read): Remove call to init_psymbol_list.
* elfread.c (elf_symfile_read): Ditto.
* machoread.c (macho_symfile_read): Ditto.

gdb/ChangeLog
gdb/coffread.c
gdb/dbxread.c
gdb/elfread.c
gdb/machoread.c
gdb/xcoffread.c

index 375f968..075eee7 100644 (file)
@@ -1,3 +1,12 @@
+2009-12-07  Tristan Gingold  <gingold@adacore.com>
+
+       * dbxread.c (dbx_symfile_read): No need to test mainline to call
+       init_psymbol_list.
+       * xcoffread.c (xcoff_initial_scan): Ditto;
+       * coffread.c (coff_symfile_read): Remove call to init_psymbol_list.
+       * elfread.c (elf_symfile_read): Ditto.
+       * machoread.c (macho_symfile_read): Ditto.
+
 2009-12-04  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * valops.c (value_struct_elt_for_reference): Do not rely on
index 84edfc5..1f71db2 100644 (file)
@@ -607,15 +607,6 @@ coff_symfile_read (struct objfile *objfile, int mainline)
   /* Free the installed minimal symbol data.  */
   do_cleanups (cleanup_minimal_symbols);
 
-  /* If we are reinitializing, or if we have not loaded syms yet,
-     empty the psymtab.  "mainline" is cleared so the *_read_psymtab
-     functions do not all re-initialize it.  */
-  if (mainline)
-    {
-      init_psymbol_list (objfile, 0);
-      mainline = 0;
-    }
-
   bfd_map_over_sections (abfd, coff_locate_sections, (void *) info);
 
   if (info->stabsects)
index 771483a..a1bd8e0 100644 (file)
@@ -556,10 +556,8 @@ dbx_symfile_read (struct objfile *objfile, int mainline)
   if (val < 0)
     perror_with_name (objfile->name);
 
-  /* If we are reinitializing, or if we have never loaded syms yet, init */
-  if (mainline
-      || (objfile->global_psymbols.size == 0
-         &&  objfile->static_psymbols.size == 0))
+  /* Size the symbol table.  */
+  if (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)
     init_psymbol_list (objfile, DBX_SYMCOUNT (objfile));
 
   symbol_size = DBX_SYMBOL_SIZE (objfile);
index d143e63..f9052c1 100644 (file)
@@ -691,15 +691,6 @@ elf_symfile_read (struct objfile *objfile, int mainline)
   /* Now process debugging information, which is contained in
      special ELF sections. */
 
-  /* If we are reinitializing, or if we have never loaded syms yet,
-     set table to empty.  MAINLINE is cleared so that *_read_psymtab
-     functions do not all also re-initialize the psymbol table. */
-  if (mainline)
-    {
-      init_psymbol_list (objfile, 0);
-      mainline = 0;
-    }
-
   /* We first have to find them... */
   bfd_map_over_sections (abfd, elf_locate_sections, (void *) & ei);
 
index 8ff899b..e82f12f 100644 (file)
@@ -649,11 +649,6 @@ macho_symfile_read (struct objfile *objfile, int mainline)
        }
     }
 
-  /* If we are reinitializing, or if we have never loaded syms yet,
-     set table to empty.  */
-  if (mainline)
-    init_psymbol_list (objfile, 0);
-
   if (dwarf2_has_info (objfile))
     {
       /* DWARF 2 sections */
index a93fbd2..35d8f1d 100644 (file)
@@ -2948,9 +2948,7 @@ xcoff_initial_scan (struct objfile *objfile, int mainline)
     perror_with_name (_("reading symbol table"));
 
   /* If we are reinitializing, or if we have never loaded syms yet, init */
-  if (mainline
-      || (objfile->global_psymbols.size == 0
-         && objfile->static_psymbols.size == 0))
+  if (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)
     /* I'm not sure how how good num_symbols is; the rule of thumb in
        init_psymbol_list was developed for a.out.  On the one hand,
        num_symbols includes auxents.  On the other hand, it doesn't