diff options
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index c06dbc2..42f2851 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -4711,12 +4711,13 @@ cache_symbol (const char *name, domain_enum domain, struct symbol *sym, for that symbol depends on the context. To determine whether the symbol is local or not, we check the block where we found it against the global and static blocks of its associated symtab. */ - if (sym - && BLOCKVECTOR_BLOCK (sym->symtab ()->compunit ()->blockvector (), - GLOBAL_BLOCK) != block - && BLOCKVECTOR_BLOCK (sym->symtab ()->compunit ()->blockvector (), - STATIC_BLOCK) != block) - return; + if (sym != nullptr) + { + const blockvector &bv = *sym->symtab ()->compunit ()->blockvector (); + + if (bv.global_block () != block && bv.static_block () != block) + return; + } h = msymbol_hash (name) % HASH_SIZE; e = XOBNEW (&sym_cache->cache_space, cache_entry); @@ -5563,7 +5564,7 @@ map_matching_symbols (struct objfile *objfile, for (compunit_symtab *symtab : objfile->compunits ()) { const struct block *block - = BLOCKVECTOR_BLOCK (symtab->blockvector (), block_kind); + = symtab->blockvector ()->block (block_kind); if (!iterate_over_symbols_terminated (block, lookup_name, domain, data)) break; @@ -5592,7 +5593,7 @@ add_nonlocal_symbols (std::vector<struct block_symbol> &result, for (compunit_symtab *cu : objfile->compunits ()) { const struct block *global_block - = BLOCKVECTOR_BLOCK (cu->blockvector (), GLOBAL_BLOCK); + = cu->blockvector ()->global_block (); if (ada_add_block_renamings (result, global_block, lookup_name, domain)) @@ -13099,7 +13100,7 @@ ada_add_global_exceptions (compiled_regex *preg, for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++) { - const struct block *b = BLOCKVECTOR_BLOCK (bv, i); + const struct block *b = bv->block (i); struct block_iterator iter; struct symbol *sym; @@ -13687,7 +13688,7 @@ public: for (compunit_symtab *s : objfile->compunits ()) { QUIT; - b = BLOCKVECTOR_BLOCK (s->blockvector (), GLOBAL_BLOCK); + b = s->blockvector ()->global_block (); ALL_BLOCK_SYMBOLS (b, iter, sym) { if (completion_skip_symbol (mode, sym)) @@ -13706,7 +13707,7 @@ public: for (compunit_symtab *s : objfile->compunits ()) { QUIT; - b = BLOCKVECTOR_BLOCK (s->blockvector (), STATIC_BLOCK); + b = s->blockvector ()->static_block (); /* Don't do this block twice. */ if (b == surrounding_static_block) continue; |