gdb: rename start_symtab/end_symtab to start_compunit_symtab/end_compunit_symtab
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 28 Mar 2022 22:17:17 +0000 (18:17 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 4 Apr 2022 16:58:07 +0000 (12:58 -0400)
It's a bit confusing because we have both "compunit_symtab" and "symtab"
types, and many methods and functions containing "start_symtab" or
"end_symtab", which actually deal with compunit_symtabs.  I believe this
comes from the time before compunit_symtab was introduced, where
symtab did the job of both.

Rename everything I found containing start_symtab or end_symtab to use
start_compunit_symtab or end_compunit_symtab.

Change-Id: If3849b156f6433640173085ad479b6a0b085ade2

13 files changed:
gdb/buildsym-legacy.c
gdb/buildsym-legacy.h
gdb/buildsym.c
gdb/buildsym.h
gdb/coffread.c
gdb/ctfread.c
gdb/dbxread.c
gdb/dwarf2/cu.c
gdb/dwarf2/cu.h
gdb/dwarf2/read.c
gdb/mdebugread.c
gdb/stabsread.c
gdb/xcoffread.c

index cfafcc38640893e02b1cfe25c5724f41e6fa6deb..b16c97807ac5752b0be58ff571d0c0acff7b5dbc 100644 (file)
@@ -21,7 +21,7 @@
 #include "symtab.h"
 
 /* The work-in-progress of the compunit we are building.
-   This is created first, before any subfiles by start_symtab.  */
+   This is created first, before any subfiles by start_compunit_symtab.  */
 
 static struct buildsym_compunit *buildsym_compunit;
 
@@ -171,11 +171,11 @@ free_buildsym_compunit (void)
 }
 
 struct compunit_symtab *
-end_symtab (CORE_ADDR end_addr, int section)
+end_compunit_symtab (CORE_ADDR end_addr, int section)
 {
   gdb_assert (buildsym_compunit != nullptr);
   struct compunit_symtab *result
-    = buildsym_compunit->end_symtab (end_addr, section);
+    = buildsym_compunit->end_compunit_symtab (end_addr, section);
   free_buildsym_compunit ();
   return result;
 }
@@ -213,10 +213,10 @@ record_line (struct subfile *subfile, int line, CORE_ADDR pc)
   buildsym_compunit->record_line (subfile, line, pc, true);
 }
 
-/* Start a new symtab for a new source file in OBJFILE.  Called, for example,
-   when a stabs symbol of type N_SO is seen, or when a DWARF
-   TAG_compile_unit DIE is seen.  It indicates the start of data for
-   one original source file.
+/* Start a new compunit_symtab for a new source file in OBJFILE.  Called, for
+   example, when a stabs symbol of type N_SO is seen, or when a DWARF
+   DW_TAG_compile_unit DIE is seen.  It indicates the start of data for one
+   original source file.
 
    NAME is the name of the file (cannot be NULL).  COMP_DIR is the
    directory in which the file was compiled (or NULL if not known).
@@ -226,8 +226,9 @@ record_line (struct subfile *subfile, int line, CORE_ADDR pc)
    the filename.  */
 
 struct compunit_symtab *
-start_symtab (struct objfile *objfile, const char *name, const char *comp_dir,
-             CORE_ADDR start_addr, enum language language)
+start_compunit_symtab (struct objfile *objfile, const char *name,
+                      const char *comp_dir, CORE_ADDR start_addr,
+                      enum language language)
 {
   /* These should have been reset either by successful completion of building
      a symtab, or by the scoped_free_pendings destructor.  */
index b8b5caf076379cd231673b65a0bb70addc06c6db..86e1e1c9b2cb761e9bea112436c6d8821892958c 100644 (file)
    The basic way this module is used is as follows:
 
    scoped_free_pendings free_pending;
-   cust = start_symtab (...);
+   cust = start_compunit_symtab (...);
    ... read debug info ...
-   cust = end_symtab (...);
+   cust = end_compunit_symtab (...);
 
-   The compunit symtab pointer ("cust") is returned from both start_symtab
-   and end_symtab to simplify the debug info readers.
+   The compunit symtab pointer ("cust") is returned from both
+   start_compunit_symtab and end_compunit_symtab to simplify the debug info readers.
 
    dbxread.c and xcoffread.c use another variation:
 
    scoped_free_pendings free_pending;
-   cust = start_symtab (...);
+   cust = start_compunit_symtab (...);
    ... read debug info ...
-   cust = end_symtab (...);
-   ... start_symtab + read + end_symtab repeated ...
+   cust = end_compunit_symtab (...);
+   ... start_compunit_symtab + read + end_compunit_symtab repeated ...
 */
 
 class scoped_free_pendings
@@ -70,7 +70,8 @@ extern void push_subfile ();
 
 extern const char *pop_subfile ();
 
-extern struct compunit_symtab *end_symtab (CORE_ADDR end_addr, int section);
+extern struct compunit_symtab *end_compunit_symtab (CORE_ADDR end_addr,
+                                                   int section);
 
 extern struct context_stack *push_context (int desc, CORE_ADDR valu);
 
@@ -78,11 +79,11 @@ extern struct context_stack pop_context ();
 
 extern void record_line (struct subfile *subfile, int line, CORE_ADDR pc);
 
-extern struct compunit_symtab *start_symtab (struct objfile *objfile,
-                                            const char *name,
-                                            const char *comp_dir,
-                                            CORE_ADDR start_addr,
-                                            enum language language);
+extern struct compunit_symtab *start_compunit_symtab (struct objfile *objfile,
+                                                     const char *name,
+                                                     const char *comp_dir,
+                                                     CORE_ADDR start_addr,
+                                                     enum language language);
 
 /* Record the name of the debug format in the current pending symbol
    table.  FORMAT must be a string with a lifetime at least as long as
@@ -106,12 +107,12 @@ extern void set_last_source_file (const char *name);
 extern const char *get_last_source_file (void);
 
 /* Set the last source start address.  Can only be used between
-   start_symtab and end_symtab* calls.  */
+   start_compunit_symtab and end_compunit_symtab* calls.  */
 
 extern void set_last_source_start_addr (CORE_ADDR addr);
 
 /* Get the last source start address.  Can only be used between
-   start_symtab and end_symtab* calls.  */
+   start_compunit_symtab and end_compunit_symtab* calls.  */
 
 extern CORE_ADDR get_last_source_start_addr ();
 
index 999f632f4013f798addce123bd443f8b65688080..c970762badb606783fea06c1359830712e8f8e0d 100644 (file)
@@ -728,7 +728,7 @@ buildsym_compunit::record_line (struct subfile *subfile, int line,
 }
 
 \f
-/* Subroutine of end_symtab to simplify it.  Look for a subfile that
+/* Subroutine of end_compunit_symtab to simplify it.  Look for a subfile that
    matches the main source file's basename.  If there is only one, and
    if the main source file doesn't have any symbol or line number
    information, then copy this file's symtab and line_vector to the
@@ -796,13 +796,14 @@ buildsym_compunit::watch_main_source_file_lossage ()
     }
 }
 
-/* Implementation of the first part of end_symtab.  It allows modifying
-   STATIC_BLOCK before it gets finalized by end_symtab_from_static_block.
-   If the returned value is NULL there is no blockvector created for
-   this symtab (you still must call end_symtab_from_static_block).
+/* Implementation of the first part of end_compunit_symtab.  It allows modifying
+   STATIC_BLOCK before it gets finalized by
+   end_compunit_symtab_from_static_block.  If the returned value is NULL there
+   is no blockvector created for this symtab (you still must call
+   end_compunit_symtab_from_static_block).
 
-   END_ADDR is the same as for end_symtab: the address of the end of the
-   file's text.
+   END_ADDR is the same as for end_compunit_symtab: the address of the end of
+   the file's text.
 
    If EXPANDABLE is non-zero the STATIC_BLOCK dictionary is made
    expandable.
@@ -811,8 +812,9 @@ buildsym_compunit::watch_main_source_file_lossage ()
    not contain any symbols.  */
 
 struct block *
-buildsym_compunit::end_symtab_get_static_block (CORE_ADDR end_addr,
-                                               int expandable, int required)
+buildsym_compunit::end_compunit_symtab_get_static_block (CORE_ADDR end_addr,
+                                                        int expandable,
+                                                        int required)
 {
   /* Finish the lexical context of the last function in the file; pop
      the context stack.  */
@@ -832,7 +834,7 @@ buildsym_compunit::end_symtab_get_static_block (CORE_ADDR end_addr,
             same.  FIXME: Find out why it is happening.  This is not
             believed to happen in most cases (even for coffread.c);
             it used to be an abort().  */
-         complaint (_("Context stack not empty in end_symtab"));
+         complaint (_("Context stack not empty in end_compunit_symtab"));
          m_context_stack.clear ();
        }
     }
@@ -896,13 +898,14 @@ buildsym_compunit::end_symtab_get_static_block (CORE_ADDR end_addr,
     }
 }
 
-/* Subroutine of end_symtab_from_static_block to simplify it.
+/* Subroutine of end_compunit_symtab_from_static_block to simplify it.
    Handle the "have blockvector" case.
-   See end_symtab_from_static_block for a description of the arguments.  */
+   See end_compunit_symtab_from_static_block for a description of the
+   arguments.  */
 
 struct compunit_symtab *
-buildsym_compunit::end_symtab_with_blockvector (struct block *static_block,
-                                               int section, int expandable)
+buildsym_compunit::end_compunit_symtab_with_blockvector
+  (struct block *static_block, int section, int expandable)
 {
   struct compunit_symtab *cu = m_compunit_symtab;
   struct blockvector *blockvector;
@@ -1057,18 +1060,18 @@ buildsym_compunit::end_symtab_with_blockvector (struct block *static_block,
   return cu;
 }
 
-/* Implementation of the second part of end_symtab.  Pass STATIC_BLOCK
-   as value returned by end_symtab_get_static_block.
+/* Implementation of the second part of end_compunit_symtab.  Pass STATIC_BLOCK
+   as value returned by end_compunit_symtab_get_static_block.
 
-   SECTION is the same as for end_symtab: the section number
+   SECTION is the same as for end_compunit_symtab: the section number
    (in objfile->section_offsets) of the blockvector and linetable.
 
    If EXPANDABLE is non-zero the GLOBAL_BLOCK dictionary is made
    expandable.  */
 
 struct compunit_symtab *
-buildsym_compunit::end_symtab_from_static_block (struct block *static_block,
-                                                int section, int expandable)
+buildsym_compunit::end_compunit_symtab_from_static_block
+  (struct block *static_block, int section, int expandable)
 {
   struct compunit_symtab *cu;
 
@@ -1086,7 +1089,7 @@ buildsym_compunit::end_symtab_from_static_block (struct block *static_block,
       cu = NULL;
     }
   else
-    cu = end_symtab_with_blockvector (static_block, section, expandable);
+    cu = end_compunit_symtab_with_blockvector (static_block, section, expandable);
 
   return cu;
 }
@@ -1100,7 +1103,7 @@ buildsym_compunit::end_symtab_from_static_block (struct block *static_block,
    the section number (in objfile->section_offsets) of the blockvector
    and linetable.
 
-   Note that it is possible for end_symtab() to return NULL.  In
+   Note that it is possible for end_compunit_symtab() to return NULL.  In
    particular, for the DWARF case at least, it will return NULL when
    it finds a compilation unit that has exactly one DIE, a
    TAG_compile_unit DIE.  This can happen when we link in an object
@@ -1109,27 +1112,28 @@ buildsym_compunit::end_symtab_from_static_block (struct block *static_block,
    never know about this empty file (FIXME).
 
    If you need to modify STATIC_BLOCK before it is finalized you should
-   call end_symtab_get_static_block and end_symtab_from_static_block
-   yourself.  */
+   call end_compunit_symtab_get_static_block and
+   end_compunit_symtab_from_static_block yourself.  */
 
 struct compunit_symtab *
-buildsym_compunit::end_symtab (CORE_ADDR end_addr, int section)
+buildsym_compunit::end_compunit_symtab (CORE_ADDR end_addr, int section)
 {
   struct block *static_block;
 
-  static_block = end_symtab_get_static_block (end_addr, 0, 0);
-  return end_symtab_from_static_block (static_block, section, 0);
+  static_block = end_compunit_symtab_get_static_block (end_addr, 0, 0);
+  return end_compunit_symtab_from_static_block (static_block, section, 0);
 }
 
-/* Same as end_symtab except create a symtab that can be later added to.  */
+/* Same as end_compunit_symtab except create a symtab that can be later added
+   to.  */
 
 struct compunit_symtab *
 buildsym_compunit::end_expandable_symtab (CORE_ADDR end_addr, int section)
 {
   struct block *static_block;
 
-  static_block = end_symtab_get_static_block (end_addr, 1, 0);
-  return end_symtab_from_static_block (static_block, section, 1);
+  static_block = end_compunit_symtab_get_static_block (end_addr, 1, 0);
+  return end_compunit_symtab_from_static_block (static_block, section, 1);
 }
 
 /* Subroutine of augment_type_symtab to simplify it.
@@ -1153,7 +1157,7 @@ set_missing_symtab (struct pending *pending_list,
     }
 }
 
-/* Same as end_symtab, but for the case where we're adding more symbols
+/* Same as end_compunit_symtab, but for the case where we're adding more symbols
    to an existing symtab that is known to contain only type information.
    This is the case for DWARF4 Type Units.  */
 
index 003d8a597193842a0a18b13d71031e3fd2199fe0..fa774dbd6fb2768b5b4ce00c521b83fe4c269d9d 100644 (file)
@@ -271,13 +271,13 @@ struct buildsym_compunit
 
   struct context_stack pop_context ();
 
-  struct block *end_symtab_get_static_block (CORE_ADDR end_addr,
-                                            int expandable, int required);
+  struct block *end_compunit_symtab_get_static_block
+    (CORE_ADDR end_addr, int expandable, int required);
 
-  struct compunit_symtab *end_symtab_from_static_block
-      (struct block *static_block, int section, int expandable);
+  struct compunit_symtab *end_compunit_symtab_from_static_block
+    (struct block *static_block, int section, int expandable);
 
-  struct compunit_symtab *end_symtab (CORE_ADDR end_addr, int section);
+  struct compunit_symtab *end_compunit_symtab (CORE_ADDR end_addr, int section);
 
   struct compunit_symtab *end_expandable_symtab (CORE_ADDR end_addr,
                                                 int section);
@@ -299,8 +299,8 @@ private:
 
   void watch_main_source_file_lossage ();
 
-  struct compunit_symtab *end_symtab_with_blockvector
-      (struct block *static_block, int section, int expandable);
+  struct compunit_symtab *end_compunit_symtab_with_blockvector
+    (struct block *static_block, int section, int expandable);
 
   /* The objfile we're reading debug info from.  */
   struct objfile *m_objfile;
index 3ff62bc96c0208dc9038ddc9a3b7ab189919b07f..1de2a79a0d94535958ec8877a0dfaa2a6515884b 100644 (file)
@@ -365,18 +365,18 @@ coff_alloc_type (int index)
    it indicates the start of data for one original source file.  */
 
 static void
-coff_start_symtab (struct objfile *objfile, const char *name)
+coff_start_compunit_symtab (struct objfile *objfile, const char *name)
 {
   within_function = 0;
-  start_symtab (objfile,
-               name,
+  start_compunit_symtab (objfile,
+                        name,
   /* We never know the directory name for COFF.  */
-                NULL,
+                        NULL,
   /* The start address is irrelevant, since we call
-     set_last_source_start_addr in coff_end_symtab.  */
-                0,
+     set_last_source_start_addr in coff_end_compunit_symtab.  */
+                        0,
   /* Let buildsym.c deduce the language for this symtab.  */
-                language_unknown);
+                        language_unknown);
   record_debugformat ("COFF");
 }
 
@@ -400,11 +400,11 @@ complete_symtab (const char *name, CORE_ADDR start_addr, unsigned int size)
    list of all such.  */
 
 static void
-coff_end_symtab (struct objfile *objfile)
+coff_end_compunit_symtab (struct objfile *objfile)
 {
   set_last_source_start_addr (current_source_start_addr);
 
-  end_symtab (current_source_end_addr, SECT_OFF_TEXT (objfile));
+  end_compunit_symtab (current_source_end_addr, SECT_OFF_TEXT (objfile));
 
   /* Reinitialize for beginning of new file.  */
   set_last_source_file (NULL);
@@ -812,7 +812,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
   type_vector_length = INITIAL_TYPE_VECTOR_LENGTH;
   type_vector = XCNEWVEC (struct type *, type_vector_length);
 
-  coff_start_symtab (objfile, "");
+  coff_start_compunit_symtab (objfile, "");
 
   symnum = 0;
   while (symnum < nsyms)
@@ -824,10 +824,10 @@ coff_symtab_read (minimal_symbol_reader &reader,
       if (cs->c_symnum == next_file_symnum && cs->c_sclass != C_FILE)
        {
          if (get_last_source_file ())
-           coff_end_symtab (objfile);
+           coff_end_compunit_symtab (objfile);
 
-         coff_start_symtab (objfile, "_globals_");
-         /* coff_start_symtab will set the language of this symtab to
+         coff_start_compunit_symtab (objfile, "_globals_");
+         /* coff_start_compunit_symtab will set the language of this symtab to
             language_unknown, since such a ``file name'' is not
             recognized.  Override that with the minimal language to
             allow printing values in this symtab.  */
@@ -890,8 +890,8 @@ coff_symtab_read (minimal_symbol_reader &reader,
             containing debugging information.  */
          if (get_last_source_file ())
            {
-             coff_end_symtab (objfile);
-             coff_start_symtab (objfile, filestring);
+             coff_end_compunit_symtab (objfile);
+             coff_start_compunit_symtab (objfile, filestring);
            }
          in_source_file = 1;
          break;
@@ -1170,7 +1170,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
     }
 
   if (get_last_source_file ())
-    coff_end_symtab (objfile);
+    coff_end_compunit_symtab (objfile);
 
   /* Patch up any opaque types (references to types that are not defined
      in the file where they are referenced, e.g. "struct foo *bar").  */
index 7f7e09638a404974906bb22d9b99d635582051aa..87147a16bdf488177cdd5b230bf120971dc6fe6c 100644 (file)
@@ -1246,8 +1246,8 @@ get_objfile_text_range (struct objfile *of, int *tsize)
 /* Start a symtab for OBJFILE in CTF format.  */
 
 static void
-ctf_start_symtab (ctf_psymtab *pst,
-                 struct objfile *of, CORE_ADDR text_offset)
+ctf_start_compunit_symtab (ctf_psymtab *pst,
+                          struct objfile *of, CORE_ADDR text_offset)
 {
   struct ctf_context *ccp;
 
@@ -1263,14 +1263,14 @@ ctf_start_symtab (ctf_psymtab *pst,
    the .text section number.  */
 
 static struct compunit_symtab *
-ctf_end_symtab (ctf_psymtab *pst,
-               CORE_ADDR end_addr, int section)
+ctf_end_compunit_symtab (ctf_psymtab *pst,
+                        CORE_ADDR end_addr, int section)
 {
   struct ctf_context *ccp;
 
   ccp = &pst->context;
   struct compunit_symtab *result
-    = ccp->builder->end_symtab (end_addr, section);
+    = ccp->builder->end_compunit_symtab (end_addr, section);
   delete ccp->builder;
   ccp->builder = nullptr;
   return result;
@@ -1407,13 +1407,13 @@ ctf_psymtab::read_symtab (struct objfile *objfile)
       int tsize;
 
       offset = get_objfile_text_range (objfile, &tsize);
-      ctf_start_symtab (this, objfile, offset);
+      ctf_start_compunit_symtab (this, objfile, offset);
       expand_psymtab (objfile);
 
       set_text_low (offset);
       set_text_high (offset + tsize);
-      compunit_symtab = ctf_end_symtab (this, offset + tsize,
-                                       SECT_OFF_TEXT (objfile));
+      compunit_symtab = ctf_end_compunit_symtab (this, offset + tsize,
+                                                SECT_OFF_TEXT (objfile));
 
       /* Finish up the debug error message.  */
       if (info_verbose)
index 259860e56bc88c13443b7eada4d3b73c4237a741..49bcebd2a815b1ec6a6a890098307719f31da13d 100644 (file)
@@ -2318,8 +2318,8 @@ read_ofile_symtab (struct objfile *objfile, legacy_psymtab *pst)
   if (get_last_source_start_addr () > text_offset)
     set_last_source_start_addr (text_offset);
 
-  pst->compunit_symtab = end_symtab (text_offset + text_size,
-                                    SECT_OFF_TEXT (objfile));
+  pst->compunit_symtab = end_compunit_symtab (text_offset + text_size,
+                                             SECT_OFF_TEXT (objfile));
 
   end_stabs ();
 
@@ -2367,7 +2367,7 @@ cp_set_block_scope (const struct symbol *symbol,
    the pst->section_offsets.  All symbols that refer to memory
    locations need to be offset by these amounts.
    OBJFILE is the object file from which we are reading symbols.  It
-   is used in end_symtab.
+   is used in end_compunit_symtab.
    LANGUAGE is the language of the symtab.
 */
 
@@ -2575,7 +2575,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
              patch_subfile_names (get_current_subfile (), name);
              break;            /* Ignore repeated SOs.  */
            }
-         end_symtab (valu, SECT_OFF_TEXT (objfile));
+         end_compunit_symtab (valu, SECT_OFF_TEXT (objfile));
          end_stabs ();
        }
 
@@ -2587,7 +2587,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
       function_start_offset = 0;
 
       start_stabs ();
-      start_symtab (objfile, name, NULL, valu, language);
+      start_compunit_symtab (objfile, name, NULL, valu, language);
       record_debugformat ("stabs");
       break;
 
index b1fd688188a76fd68bada657ced364d41d91cad6..d70eb0e25f9d0f13f7cddccaee922184176e1907 100644 (file)
@@ -54,8 +54,8 @@ dwarf2_cu::addr_sized_int_type (bool unsigned_p) const
    buildsym_compunit constructor.  */
 
 struct compunit_symtab *
-dwarf2_cu::start_symtab (const char *name, const char *comp_dir,
-                        CORE_ADDR low_pc)
+dwarf2_cu::start_compunit_symtab (const char *name, const char *comp_dir,
+                                 CORE_ADDR low_pc)
 {
   gdb_assert (m_builder == nullptr);
 
index bce0a3de63a41a982019a8dc24c3dc048f211b7d..6b72ec234bfaba2cd9bc4ec0463c244ec5084013 100644 (file)
@@ -59,11 +59,11 @@ struct dwarf2_cu
      We don't need the pc/line-number mapping for type units.  */
   void setup_type_unit_groups (struct die_info *die);
 
-  /* Start a symtab for DWARF.  NAME, COMP_DIR, LOW_PC are passed to the
-     buildsym_compunit constructor.  */
-  struct compunit_symtab *start_symtab (const char *name,
-                                       const char *comp_dir,
-                                       CORE_ADDR low_pc);
+  /* Start a compunit_symtab for DWARF.  NAME, COMP_DIR, LOW_PC are passed to
+     the buildsym_compunit constructor.  */
+  struct compunit_symtab *start_compunit_symtab (const char *name,
+                                                const char *comp_dir,
+                                                CORE_ADDR low_pc);
 
   /* Reset the builder.  */
   void reset_builder () { m_builder.reset (); }
index 68c73c643bf5837dc14d32898806a86fc9eaffe4..cb33171b1a9ffa4c206e7ecf0b0746a4c8ea4ee7 100644 (file)
@@ -9458,7 +9458,8 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language)
   get_scope_pc_bounds (cu->dies, &lowpc, &highpc, cu);
 
   addr = gdbarch_adjust_dwarf2_addr (gdbarch, highpc + baseaddr);
-  static_block = cu->get_builder ()->end_symtab_get_static_block (addr, 0, 1);
+  static_block
+    = cu->get_builder ()->end_compunit_symtab_get_static_block (addr, 0, 1);
 
   /* If the comp unit has DW_AT_ranges, it may have discontiguous ranges.
      Also, DW_AT_ranges may record ranges not belonging to any child DIEs
@@ -9467,9 +9468,8 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language)
      this comp unit.  */
   dwarf2_record_block_ranges (cu->dies, static_block, baseaddr, cu);
 
-  cust = cu->get_builder ()->end_symtab_from_static_block (static_block,
-                                                   SECT_OFF_TEXT (objfile),
-                                                   0);
+  cust = cu->get_builder ()->end_compunit_symtab_from_static_block
+    (static_block, SECT_OFF_TEXT (objfile), 0);
 
   if (cust != NULL)
     {
@@ -10626,7 +10626,8 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
 
   file_and_directory &fnd = find_file_and_directory (die, cu);
 
-  cu->start_symtab (fnd.get_name (), fnd.intern_comp_dir (objfile), lowpc);
+  cu->start_compunit_symtab (fnd.get_name (), fnd.intern_comp_dir (objfile),
+                            lowpc);
 
   gdb_assert (per_objfile->sym_cu == nullptr);
   scoped_restore restore_sym_cu
@@ -10719,7 +10720,7 @@ dwarf2_cu::setup_type_unit_groups (struct die_info *die)
   if (lh == NULL)
     {
       if (first_time)
-       start_symtab ("", NULL, 0);
+       start_compunit_symtab ("", NULL, 0);
       else
        {
          gdb_assert (tug_unshare->symtabs == NULL);
@@ -10740,7 +10741,7 @@ dwarf2_cu::setup_type_unit_groups (struct die_info *die)
 
   if (first_time)
     {
-      struct compunit_symtab *cust = start_symtab ("", NULL, 0);
+      struct compunit_symtab *cust = start_compunit_symtab ("", NULL, 0);
 
       /* Note: We don't assign tu_group->compunit_symtab yet because we're
         still initializing it, and our caller (a few levels up)
index 0db0508deabf21474f07fd2a1ed5829ea4d9b4b8..eae80648e4c3a8fd8e9c1b39f6f12bb0e37bc0ae 100644 (file)
@@ -3961,7 +3961,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
                    {
                      valu += section_offsets[SECT_OFF_TEXT (objfile)];
                      previous_stab_code = N_SO;
-                     cust = end_symtab (valu, SECT_OFF_TEXT (objfile));
+                     cust = end_compunit_symtab (valu, SECT_OFF_TEXT (objfile));
                      end_stabs ();
                      last_symtab_ended = 1;
                    }
@@ -4021,7 +4021,8 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
 
       if (! last_symtab_ended)
        {
-         cust = end_symtab (pst->raw_text_high (), SECT_OFF_TEXT (objfile));
+         cust = end_compunit_symtab (pst->raw_text_high (),
+                                     SECT_OFF_TEXT (objfile));
          end_stabs ();
        }
 
index c6821f893cbdbe1d7621c1bb8a8fca5443048310..5e85c34303c9c06c7c6fe851cd1d814ad4448753 100644 (file)
@@ -4659,7 +4659,7 @@ stabsread_new_init (void)
 }
 
 /* Initialize anything that needs initializing at the same time as
-   start_symtab() is called.  */
+   start_compunit_symtab() is called.  */
 
 void
 start_stabs (void)
@@ -4675,7 +4675,7 @@ start_stabs (void)
   common_block_name = NULL;
 }
 
-/* Call after end_symtab().  */
+/* Call after end_compunit_symtab().  */
 
 void
 end_stabs (void)
index f6db7f9ff7e4481c2873119ea667775f24c57c3f..e45fa275c095e1005597dbab1f14959fcaad97df 100644 (file)
@@ -415,7 +415,7 @@ add_stab_to_list (char *stabname, struct pending_stabs **stabvector)
    and return it in a newly created table.  If the old one is good
    enough, return the old one.  */
 /* FIXME: I think all this stuff can be replaced by just passing
-   sort_linevec = 1 to end_symtab.  */
+   sort_linevec = 1 to end_compunit_symtab.  */
 
 static struct linetable *
 arrange_linetable (struct linetable *oldLineTb)
@@ -514,7 +514,7 @@ arrange_linetable (struct linetable *oldLineTb)
 }
 
 /* include file support: C_BINCL/C_EINCL pairs will be kept in the 
-   following `IncludeChain'.  At the end of each symtab (end_symtab),
+   following `IncludeChain'.  At the end of each symtab (end_compunit_symtab),
    we will determine if we should create additional symtab's to
    represent if (the include files.  */
 
@@ -1042,8 +1042,8 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
   pst_symtab_language = deduce_language_from_filename (filestring);
 
   start_stabs ();
-  start_symtab (objfile, filestring, NULL, file_start_addr,
-               pst_symtab_language);
+  start_compunit_symtab (objfile, filestring, NULL, file_start_addr,
+                        pst_symtab_language);
   record_debugformat (debugfmt);
   symnum = ((struct symloc *) pst->read_symtab_private)->first_symnum;
   max_symnum =
@@ -1130,14 +1130,14 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
        {
          if (get_last_source_file ())
            {
-             pst->compunit_symtab = end_symtab (cur_src_end_addr,
-                                                SECT_OFF_TEXT (objfile));
+             pst->compunit_symtab = end_compunit_symtab
+               (cur_src_end_addr, SECT_OFF_TEXT (objfile));
              end_stabs ();
            }
 
          start_stabs ();
-         start_symtab (objfile, "_globals_", NULL,
-                       0, pst_symtab_language);
+         start_compunit_symtab (objfile, "_globals_", NULL,
+                                0, pst_symtab_language);
          record_debugformat (debugfmt);
          cur_src_end_addr = first_object_file_end;
          /* Done with all files, everything from here on is globals.  */
@@ -1221,12 +1221,13 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
                        {
                          complete_symtab (filestring, file_start_addr);
                          cur_src_end_addr = file_end_addr;
-                         end_symtab (file_end_addr, SECT_OFF_TEXT (objfile));
+                         end_compunit_symtab (file_end_addr,
+                                              SECT_OFF_TEXT (objfile));
                          end_stabs ();
                          start_stabs ();
                          /* Give all csects for this source file the same
                             name.  */
-                         start_symtab (objfile, filestring, NULL,
+                         start_compunit_symtab (objfile, filestring, NULL,
                                        0, pst_symtab_language);
                          record_debugformat (debugfmt);
                        }
@@ -1327,7 +1328,7 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
 
          complete_symtab (filestring, file_start_addr);
          cur_src_end_addr = file_end_addr;
-         end_symtab (file_end_addr, SECT_OFF_TEXT (objfile));
+         end_compunit_symtab (file_end_addr, SECT_OFF_TEXT (objfile));
          end_stabs ();
 
          /* XCOFF, according to the AIX 3.2 documentation, puts the
@@ -1346,7 +1347,8 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
            filestring = cs->c_name;
 
          start_stabs ();
-         start_symtab (objfile, filestring, NULL, 0, pst_symtab_language);
+         start_compunit_symtab (objfile, filestring, NULL, 0,
+                                pst_symtab_language);
          record_debugformat (debugfmt);
          last_csect_name = 0;
 
@@ -1514,7 +1516,7 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst)
 
       complete_symtab (filestring, file_start_addr);
       cur_src_end_addr = file_end_addr;
-      cust = end_symtab (file_end_addr, SECT_OFF_TEXT (objfile));
+      cust = end_compunit_symtab (file_end_addr, SECT_OFF_TEXT (objfile));
       /* When reading symbols for the last C_FILE of the objfile, try
         to make sure that we set pst->compunit_symtab to the symtab for the
         file, not to the _globals_ symtab.  I'm not sure whether this