aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2013-08-20 18:57:00 +0000
committerDoug Evans <dje@google.com>2013-08-20 18:57:00 +0000
commitfc474241b7996b9ebdd4f83f52692096637c5620 (patch)
tree3a1f9390110ec58d04b244e8bade92befc60bd19 /gdb/dwarf2read.c
parentbec71544ee9433508b970323621e4a1d19656ba1 (diff)
downloadgdb-fc474241b7996b9ebdd4f83f52692096637c5620.zip
gdb-fc474241b7996b9ebdd4f83f52692096637c5620.tar.gz
gdb-fc474241b7996b9ebdd4f83f52692096637c5620.tar.bz2
* buildsym.c (subfile_stack): Move here from buildsym.h.
(pending_macros): Ditto. (get_macro_table): New function. (buildsym_init): Initialize subfile_stack. * coffread.c (type_vector,type_vector_length): Moved here from buildsym.h. (INITIAL_TYPE_VECTOR_LENGTH): Ditto. (coff_symtab_read): Use it. * dbxread.c (read_ofile_symtab): Delete init of subfile_stack. * dwarf2read.c (macro_start_file): Replace uses of pending_macros with call to get_macro_table. * stabsread.c (type_vector,type_vector_length): Moved here from buildsym.h. (INITIAL_TYPE_VECTOR_LENGTH): Ditto. * buildsym.h (get_macro_table): Declare.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index d08e8b8..7891e32 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -18943,19 +18943,16 @@ macro_start_file (int file, int line,
/* File name relative to the compilation directory of this source file. */
char *file_name = file_file_name (file, lh);
- /* We don't create a macro table for this compilation unit
- at all until we actually get a filename. */
- if (! pending_macros)
- pending_macros = new_macro_table (&objfile->per_bfd->storage_obstack,
- objfile->per_bfd->macro_cache,
- comp_dir);
-
if (! current_file)
{
+ /* Note: We don't create a macro table for this compilation unit
+ at all until we actually get a filename. */
+ struct macro_table *macro_table = get_macro_table (objfile, comp_dir);
+
/* If we have no current file, then this must be the start_file
directive for the compilation unit's main source file. */
- current_file = macro_set_main (pending_macros, file_name);
- macro_define_special (pending_macros);
+ current_file = macro_set_main (macro_table, file_name);
+ macro_define_special (macro_table);
}
else
current_file = macro_include (current_file, line, file_name);