From e148f09d75af9e5c6af5136fee3a5a298114d41f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 21 May 2018 09:12:54 -0600 Subject: Move the symbol lists to buildsym_compunit This moves the global symbol lists into buildsym_compunit, adds accessors, and updates all the users. gdb/ChangeLog 2018-07-20 Tom Tromey * xcoffread.c (read_xcoff_symtab, process_xcoff_symbol): Update. * stabsread.c (patch_block_stabs, define_symbol, read_type) (read_enum_type, common_block_start, common_block_end) (cleanup_undefined_types_1, finish_global_stabs): Update. * mdebugread.c (psymtab_to_symtab_1): Update. * dwarf2read.c (fixup_go_packaging, read_func_scope) (read_lexical_block_scope, new_symbol): Update. * dbxread.c (process_one_symbol): Update. * coffread.c (coff_symtab_read, process_coff_symbol) (coff_read_enum_type): Update. * buildsym.h (file_symbols, global_symbols, local_symbols): Don't declare. (get_local_symbols, get_file_symbols, get_global_symbols): New functions. * buildsym.c (~buildsym_compunit): Clean up m_file_symbols and m_global_symbols. : New members. (~scoped_free_pendings): Update. (finish_block, prepare_for_building, reset_symtab_globals) (end_symtab_get_static_block, end_symtab_with_blockvector) (augment_type_symtab, push_context): Update. (get_local_symbols, get_file_symbols, get_global_symbols): New functions. (buildsym_init): Update. --- gdb/buildsym.h | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'gdb/buildsym.h') diff --git a/gdb/buildsym.h b/gdb/buildsym.h index 10dce3edba8..bb4cef095e4 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -77,20 +77,6 @@ struct pending struct symbol *symbol[PENDINGSIZE]; }; -/* Here are the three lists that symbols are put on. */ - -/* static at top level, and types */ - -EXTERN struct pending *file_symbols; - -/* global functions and variables */ - -EXTERN struct pending *global_symbols; - -/* everything local to lexical context */ - -EXTERN struct pending *local_symbols; - /* Stack representing unclosed lexical contexts (that will become blocks, eventually). */ @@ -275,6 +261,18 @@ extern int get_context_stack_depth (); extern struct subfile *get_current_subfile (); +/* Return the local symbol list. */ + +extern struct pending **get_local_symbols (); + +/* Return the file symbol list. */ + +extern struct pending **get_file_symbols (); + +/* Return the global symbol list. */ + +extern struct pending **get_global_symbols (); + #undef EXTERN #endif /* defined (BUILDSYM_H) */ -- cgit v1.2.1