aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-02-06 22:54:03 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2022-04-27 22:05:03 -0400
commit63d609debba854d08a515f73d0ad8e4ef8948370 (patch)
treec5e6b2c9d4b48350c707316a48e69388524cdf66 /gdb/ada-lang.c
parent6395b62847e581acc3e8fa179444b824d17b3d68 (diff)
downloadbinutils-63d609debba854d08a515f73d0ad8e4ef8948370.zip
binutils-63d609debba854d08a515f73d0ad8e4ef8948370.tar.gz
binutils-63d609debba854d08a515f73d0ad8e4ef8948370.tar.bz2
gdb: remove BLOCKVECTOR_BLOCK and BLOCKVECTOR_NBLOCKS macros
Replace with calls to blockvector::blocks, and the appropriate method call on the returned array_view. Change-Id: I04d1f39603e4d4c21c96822421431d9a029d8ddd
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c23
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;