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
This commit is contained in:
Simon Marchi
2022-02-06 22:54:03 -05:00
committed by Simon Marchi
parent 6395b62847
commit 63d609debb
25 changed files with 194 additions and 161 deletions

View File

@ -1440,7 +1440,7 @@ static void
add_symbol_overload_list_qualified (const char *func_name,
std::vector<symbol *> *overload_list)
{
const struct block *b, *surrounding_static_block = 0;
const struct block *surrounding_static_block = 0;
/* Look through the partial symtabs for all symbols which begin by
matching FUNC_NAME. Make sure we read that symbol table in. */
@ -1451,7 +1451,9 @@ add_symbol_overload_list_qualified (const char *func_name,
/* Search upwards from currently selected frame (so that we can
complete on local vars. */
for (b = get_selected_block (0); b != NULL; b = b->superblock ())
for (const block *b = get_selected_block (0);
b != nullptr;
b = b->superblock ())
add_symbol_overload_list_block (func_name, b, overload_list);
surrounding_static_block = block_static_block (get_selected_block (0));
@ -1464,7 +1466,7 @@ add_symbol_overload_list_qualified (const char *func_name,
for (compunit_symtab *cust : objfile->compunits ())
{
QUIT;
b = BLOCKVECTOR_BLOCK (cust->blockvector (), GLOBAL_BLOCK);
const block *b = cust->blockvector ()->global_block ();
add_symbol_overload_list_block (func_name, b, overload_list);
}
}
@ -1474,10 +1476,12 @@ add_symbol_overload_list_qualified (const char *func_name,
for (compunit_symtab *cust : objfile->compunits ())
{
QUIT;
b = BLOCKVECTOR_BLOCK (cust->blockvector (), STATIC_BLOCK);
const block *b = cust->blockvector ()->static_block ();
/* Don't do this block twice. */
if (b == surrounding_static_block)
continue;
add_symbol_overload_list_block (func_name, b, overload_list);
}
}