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

@ -664,19 +664,17 @@ objfile_relocate1 (struct objfile *objfile,
for (compunit_symtab *cust : objfile->compunits ())
{
const struct blockvector *bv = cust->blockvector ();
struct blockvector *bv = cust->blockvector ();
int block_line_section = cust->block_line_section ();
if (BLOCKVECTOR_MAP (bv))
addrmap_relocate (BLOCKVECTOR_MAP (bv), delta[block_line_section]);
for (int i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
for (block *b : bv->blocks ())
{
struct block *b;
struct symbol *sym;
struct mdict_iterator miter;
b = BLOCKVECTOR_BLOCK (bv, i);
b->set_start (b->start () + delta[block_line_section]);
b->set_end (b->end () + delta[block_line_section]);