aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 36b1395..58c2693 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -261,7 +261,10 @@ finish_block (struct symbol *symbol, struct pending **listhead,
parameter symbols. */
int nparams = 0, iparams;
struct symbol *sym;
- ALL_BLOCK_SYMBOLS (block, iter, sym)
+
+ /* 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)
{
if (SYMBOL_IS_ARGUMENT (sym))
nparams++;
@@ -273,7 +276,9 @@ finish_block (struct symbol *symbol, struct pending **listhead,
TYPE_ALLOC (ftype, nparams * sizeof (struct field));
iparams = 0;
- ALL_BLOCK_SYMBOLS (block, iter, sym)
+ /* 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)
{
if (iparams == nparams)
break;
@@ -1173,9 +1178,9 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
if (SYMBOL_SYMTAB (BLOCK_FUNCTION (block)) == NULL)
SYMBOL_SYMTAB (BLOCK_FUNCTION (block)) = symtab;
- for (sym = dict_iterator_first (BLOCK_DICT (block), &iter);
- sym != NULL;
- sym = dict_iterator_next (&iter))
+ /* Note that we only want to fix up symbols from the local
+ blocks, not blocks coming from included symtabs. */
+ ALL_DICT_SYMBOLS (BLOCK_DICT (block), iter, sym)
if (SYMBOL_SYMTAB (sym) == NULL)
SYMBOL_SYMTAB (sym) = symtab;
}