diff options
author | Tom Tromey <tom@tromey.com> | 2018-05-21 09:12:54 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-07-20 09:42:46 -0600 |
commit | e148f09d75af9e5c6af5136fee3a5a298114d41f (patch) | |
tree | 0f9ca53921bd325bae5d3cd079cead946204ac60 /gdb/coffread.c | |
parent | 93b8bea4143cafae79076076c64aaa4c46a9b73c (diff) | |
download | gdb-e148f09d75af9e5c6af5136fee3a5a298114d41f.zip gdb-e148f09d75af9e5c6af5136fee3a5a298114d41f.tar.gz gdb-e148f09d75af9e5c6af5136fee3a5a298114d41f.tar.bz2 |
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 <tom@tromey.com>
* 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.
<m_file_symbols, m_local_symbols, 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.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r-- | gdb/coffread.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c index 2d7859b..9649db4 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1171,7 +1171,7 @@ coff_symtab_read (minimal_symbol_reader &reader, symnum); break; } - if (local_symbols && !outermost_context_p ()) + if (*get_local_symbols () && !outermost_context_p ()) { tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, @@ -1181,7 +1181,7 @@ coff_symtab_read (minimal_symbol_reader &reader, cstk.start_addr, tmpaddr); } /* Now pop locals of block just finished. */ - local_symbols = cstk.locals; + *get_local_symbols () = cstk.locals; } break; @@ -1647,10 +1647,10 @@ process_coff_symbol (struct coff_symbol *cs, SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK; if (cs->c_sclass == C_STAT || cs->c_sclass == C_THUMBSTAT || cs->c_sclass == C_THUMBSTATFUNC) - add_symbol_to_list (sym, &file_symbols); + add_symbol_to_list (sym, get_file_symbols ()); else if (cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT || cs->c_sclass == C_THUMBEXTFUNC) - add_symbol_to_list (sym, &global_symbols); + add_symbol_to_list (sym, get_global_symbols ()); } else { @@ -1662,7 +1662,7 @@ process_coff_symbol (struct coff_symbol *cs, case C_AUTO: SYMBOL_ACLASS_INDEX (sym) = LOC_LOCAL; - add_symbol_to_list (sym, &local_symbols); + add_symbol_to_list (sym, get_local_symbols ()); break; case C_THUMBEXT: @@ -1672,7 +1672,7 @@ process_coff_symbol (struct coff_symbol *cs, SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value; SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); - add_symbol_to_list (sym, &global_symbols); + add_symbol_to_list (sym, get_global_symbols ()); break; case C_THUMBSTAT: @@ -1685,12 +1685,12 @@ process_coff_symbol (struct coff_symbol *cs, if (within_function) { /* Static symbol of local scope. */ - add_symbol_to_list (sym, &local_symbols); + add_symbol_to_list (sym, get_local_symbols ()); } else { /* Static symbol at top level of file. */ - add_symbol_to_list (sym, &file_symbols); + add_symbol_to_list (sym, get_file_symbols ()); } break; @@ -1700,7 +1700,7 @@ process_coff_symbol (struct coff_symbol *cs, case C_REG: SYMBOL_ACLASS_INDEX (sym) = coff_register_index; SYMBOL_VALUE (sym) = cs->c_value; - add_symbol_to_list (sym, &local_symbols); + add_symbol_to_list (sym, get_local_symbols ()); break; case C_THUMBLABEL: @@ -1710,14 +1710,14 @@ process_coff_symbol (struct coff_symbol *cs, case C_ARG: SYMBOL_ACLASS_INDEX (sym) = LOC_ARG; SYMBOL_IS_ARGUMENT (sym) = 1; - add_symbol_to_list (sym, &local_symbols); + add_symbol_to_list (sym, get_local_symbols ()); break; case C_REGPARM: SYMBOL_ACLASS_INDEX (sym) = coff_register_index; SYMBOL_IS_ARGUMENT (sym) = 1; SYMBOL_VALUE (sym) = cs->c_value; - add_symbol_to_list (sym, &local_symbols); + add_symbol_to_list (sym, get_local_symbols ()); break; case C_TPDEF: @@ -1771,7 +1771,7 @@ process_coff_symbol (struct coff_symbol *cs, SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i]; opaque_type_chain[i] = sym; } - add_symbol_to_list (sym, &file_symbols); + add_symbol_to_list (sym, get_file_symbols ()); break; case C_STRTAG: @@ -1790,7 +1790,7 @@ process_coff_symbol (struct coff_symbol *cs, TYPE_NAME (SYMBOL_TYPE (sym)) = concat (SYMBOL_LINKAGE_NAME (sym), (char *)NULL); - add_symbol_to_list (sym, &file_symbols); + add_symbol_to_list (sym, get_file_symbols ()); break; default: @@ -2154,9 +2154,9 @@ coff_read_enum_type (int index, int length, int lastsym, type = coff_alloc_type (index); if (within_function) - symlist = &local_symbols; + symlist = get_local_symbols (); else - symlist = &file_symbols; + symlist = get_file_symbols (); osyms = *symlist; o_nsyms = osyms ? osyms->nsyms : 0; |