diff options
author | Keith Seitz <keiths@redhat.com> | 2019-01-10 13:57:08 -0800 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2019-01-10 13:57:08 -0800 |
commit | b026f59345a336cabf74719fce9f96cab7c7ab4d (patch) | |
tree | 206e3e42bdc820ddd089ef01bcefb4b73a936460 /gdb/buildsym.c | |
parent | c7748ee9ceb5a394658cd07aeb0445924599e442 (diff) | |
download | gdb-b026f59345a336cabf74719fce9f96cab7c7ab4d.zip gdb-b026f59345a336cabf74719fce9f96cab7c7ab4d.tar.gz gdb-b026f59345a336cabf74719fce9f96cab7c7ab4d.tar.bz2 |
gdb/23712: Use new multidictionary API
This patch builds on the previous by enabling the `new' multidictionary
API. A lot of the hunks are simply textual replacements of "dict_"
with "mdict_" and similar transformations.
A word of warning, even with the use of multidictionaries, the code
still does not satisfactorily fix the reported problems with gdb/23712
(or gdb/23010). We still have additional changes to make before that
happens.
gdb/ChangeLog:
PR gdb/23712
PR symtab/23010
* dictionary.h (struct dictionary): Replace declaration with
multidictionary.
(dict_create_hashed, dict_create_hashed_expandable)
(dict_create_linear, dict_create_linear_expandable)
(dict_free, dict_add_symbol, dict_add_pending, dict_empty)
(dict_iterator_first, dict_iterator_next, dict_iter_match_first)
(dict_iter_match_next, dict_size): Rename to "mdict_" versions
taking multidictionary argument.
[ALL_DICT_SYMBOLS]: Update for multidictionary.
* block.h (struct block) <dict>: Change to multidictionary
and rename `multidict'.
* block.c, buildsym.c, jit.c, mdebugread.c, objfiles.c,
symmisc.c: Update all dictionary references to multidictionary.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r-- | gdb/buildsym.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 1afff3d..bd0f25e 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -227,22 +227,20 @@ buildsym_compunit::finish_block_internal if (symbol) { - BLOCK_DICT (block) - = dict_create_linear (&m_objfile->objfile_obstack, - m_language, *listhead); + BLOCK_MULTIDICT (block) + = mdict_create_linear (&m_objfile->objfile_obstack, *listhead); } else { if (expandable) { - BLOCK_DICT (block) = dict_create_hashed_expandable (m_language); - dict_add_pending (BLOCK_DICT (block), *listhead); + BLOCK_MULTIDICT (block) = mdict_create_hashed_expandable (m_language); + mdict_add_pending (BLOCK_MULTIDICT (block), *listhead); } else { - BLOCK_DICT (block) = - dict_create_hashed (&m_objfile->objfile_obstack, - m_language, *listhead); + BLOCK_MULTIDICT (block) = + mdict_create_hashed (&m_objfile->objfile_obstack, *listhead); } } @@ -254,7 +252,7 @@ buildsym_compunit::finish_block_internal if (symbol) { struct type *ftype = SYMBOL_TYPE (symbol); - struct dict_iterator iter; + struct mdict_iterator miter; SYMBOL_BLOCK_VALUE (symbol) = block; BLOCK_FUNCTION (block) = symbol; @@ -268,7 +266,7 @@ buildsym_compunit::finish_block_internal /* Here we want to directly access the dictionary, because we haven't fully initialized the block yet. */ - ALL_DICT_SYMBOLS (BLOCK_DICT (block), iter, sym) + ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym) { if (SYMBOL_IS_ARGUMENT (sym)) nparams++; @@ -282,7 +280,7 @@ buildsym_compunit::finish_block_internal iparams = 0; /* Here we want to directly access the dictionary, because we haven't fully initialized the block yet. */ - ALL_DICT_SYMBOLS (BLOCK_DICT (block), iter, sym) + ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym) { if (iparams == nparams) break; @@ -1066,7 +1064,7 @@ buildsym_compunit::end_symtab_with_blockvector (struct block *static_block, { struct block *block = BLOCKVECTOR_BLOCK (blockvector, block_i); struct symbol *sym; - struct dict_iterator iter; + struct mdict_iterator miter; /* Inlined functions may have symbols not in the global or static symbol lists. */ @@ -1077,7 +1075,7 @@ buildsym_compunit::end_symtab_with_blockvector (struct block *static_block, /* Note that we only want to fix up symbols from the local blocks, not blocks coming from included symtabs. That is why we use ALL_DICT_SYMBOLS here and not ALL_BLOCK_SYMBOLS. */ - ALL_DICT_SYMBOLS (BLOCK_DICT (block), iter, sym) + ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym) if (symbol_symtab (sym) == NULL) symbol_set_symtab (sym, symtab); } @@ -1211,7 +1209,7 @@ buildsym_compunit::augment_type_symtab () to the primary symtab. */ set_missing_symtab (m_file_symbols, cust); - dict_add_pending (BLOCK_DICT (block), m_file_symbols); + mdict_add_pending (BLOCK_MULTIDICT (block), m_file_symbols); } if (m_global_symbols != NULL) @@ -1222,7 +1220,7 @@ buildsym_compunit::augment_type_symtab () to the primary symtab. */ set_missing_symtab (m_global_symbols, cust); - dict_add_pending (BLOCK_DICT (block), + mdict_add_pending (BLOCK_MULTIDICT (block), m_global_symbols); } } |