PR ld/16021
[deliverable/binutils-gdb.git] / gdb / buildsym.c
index 823ad411198dd2c95c01266fcf8be543b1d3e804..cee0cc54c880a96eebf07198322c720e8c628da5 100644 (file)
@@ -102,13 +102,24 @@ struct pending_block
    associated symtab.  */
 
 static struct pending_block *pending_blocks;
-\f
+
+struct subfile_stack
+  {
+    struct subfile_stack *next;
+    char *name;
+  };
+
+static struct subfile_stack *subfile_stack;
+
+/* The macro table for the compilation unit whose symbols we're
+   currently reading.  All the symtabs for the CU will point to this.  */
+static struct macro_table *pending_macros;
+
 static int compare_line_numbers (const void *ln1p, const void *ln2p);
 
 static void record_pending_block (struct objfile *objfile,
                                  struct block *block,
                                  struct pending_block *opblock);
-\f
 
 /* Initial sizes of data structures.  These are realloc'd larger if
    needed, and realloc'd down to the size actually used, when
@@ -825,6 +836,19 @@ compare_line_numbers (const void *ln1p, const void *ln2p)
   return ln1->line - ln2->line;
 }
 \f
+/* Return the macro table.
+   Initialize it if this is the first use.  */
+
+struct macro_table *
+get_macro_table (struct objfile *objfile, const char *comp_dir)
+{
+  if (! pending_macros)
+    pending_macros = new_macro_table (&objfile->per_bfd->storage_obstack,
+                                     objfile->per_bfd->macro_cache,
+                                     comp_dir);
+  return pending_macros;
+}
+\f
 /* Start a new symtab for a new source file.  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
@@ -1120,9 +1144,10 @@ end_symtab_from_static_block (struct block *static_block,
       blockvector = make_blockvector (objfile);
     }
 
-  /* Read the line table if it has to be read separately.  */
+  /* Read the line table if it has to be read separately.
+     This is only used by xcoffread.c.  */
   if (objfile->sf->sym_read_linetable != NULL)
-    objfile->sf->sym_read_linetable ();
+    objfile->sf->sym_read_linetable (objfile);
 
   /* Handle the case where the debug info specifies a different path
      for the main source file.  It can cause us to lose track of its
@@ -1538,6 +1563,7 @@ buildsym_init (void)
   pending_blocks = NULL;
   pending_macros = NULL;
   using_directives = NULL;
+  subfile_stack = NULL;
 
   /* We shouldn't have any address map at this point.  */
   gdb_assert (! pending_addrmap);
This page took 0.024316 seconds and 4 git commands to generate.