gdb: remove symtab::blockvector

symtab::blockvector is a wrapper around compunit_symtab::blockvector.
It is a bit misleadnig, as it gives the impression that a symtab has a
blockvector.  Remove it, change all users to fetch the blockvector
through the compunit instead.

Change-Id: Ibd062cd7926112a60d52899dff9224591cbdeebf
This commit is contained in:
Simon Marchi
2022-04-06 10:42:03 -04:00
parent e473032828
commit 44281e6c08
14 changed files with 33 additions and 36 deletions

View File

@ -628,7 +628,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
break;
case stGlobal: /* External symbol, goes into global block. */
b = BLOCKVECTOR_BLOCK (top_stack->cur_st->blockvector (),
b = BLOCKVECTOR_BLOCK (top_stack->cur_st->compunit ()->blockvector (),
GLOBAL_BLOCK);
s = new_symbol (name);
SET_SYMBOL_VALUE_ADDRESS (s, (CORE_ADDR) sh->value);
@ -771,7 +771,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
if (sh->st == stProc)
{
const struct blockvector *bv
= top_stack->cur_st->blockvector ();
= top_stack->cur_st->compunit ()->blockvector ();
/* The next test should normally be true, but provides a
hook for nested functions (which we don't want to make
@ -1144,7 +1144,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
{
/* Finished with procedure */
const struct blockvector *bv
= top_stack->cur_st->blockvector ();
= top_stack->cur_st->compunit ()->blockvector ();
struct mdebug_extra_func_info *e;
struct block *cblock = top_stack->cur_block;
struct type *ftype = top_stack->cur_type;
@ -4187,7 +4187,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
FIXME, Maybe quit once we have found the right number of ext's? */
top_stack->cur_st = cust->primary_filetab ();
top_stack->cur_block
= BLOCKVECTOR_BLOCK (top_stack->cur_st->blockvector (),
= BLOCKVECTOR_BLOCK (top_stack->cur_st->compunit ()->blockvector (),
GLOBAL_BLOCK);
top_stack->blocktype = stFile;
@ -4497,13 +4497,14 @@ add_block (struct block *b, struct symtab *s)
{
/* Cast away "const", but that's ok because we're building the
symtab and blockvector here. */
struct blockvector *bv = (struct blockvector *) s->blockvector ();
struct blockvector *bv
= (struct blockvector *) s->compunit ()->blockvector ();
bv = (struct blockvector *) xrealloc ((void *) bv,
(sizeof (struct blockvector)
+ BLOCKVECTOR_NBLOCKS (bv)
* sizeof (bv->block)));
if (bv != s->blockvector ())
if (bv != s->compunit ()->blockvector ())
s->compunit ()->set_blockvector (bv);
BLOCKVECTOR_BLOCK (bv, BLOCKVECTOR_NBLOCKS (bv)++) = b;
@ -4567,7 +4568,8 @@ sort_blocks (struct symtab *s)
{
/* We have to cast away const here, but this is ok because we're
constructing the blockvector in this code. */
struct blockvector *bv = (struct blockvector *) s->blockvector ();
struct blockvector *bv
= (struct blockvector *) s->compunit ()->blockvector ();
if (BLOCKVECTOR_NBLOCKS (bv) <= FIRST_LOCAL_BLOCK)
{