summaryrefslogtreecommitdiff
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
commit622685115cb850489f823886f3146c2cfbff9a99 (patch)
tree4dd1a17f2d5a8d28a83be957df145380f65241a5 /gdb/dwarf2read.c
parent3a7c0567a6b65a1c4afb5a7bea66fb55f06862d3 (diff)
downloadgdb-622685115cb850489f823886f3146c2cfbff9a99.tar.gz
* 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 d08e8b869f7..7891e32d753 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);