gdb: remove BLOCK_MULTIDICT macro
Replace with equivalent methods. Change-Id: If9a239c511a664f2a59fecb6d1cd579881b23dc2
This commit is contained in:
parent
f135fe728e
commit
24d74bb5df
7 changed files with 37 additions and 30 deletions
12
gdb/block.c
12
gdb/block.c
|
@ -545,7 +545,7 @@ block_iterator_step (struct block_iterator *iterator, int first)
|
||||||
|
|
||||||
block = BLOCKVECTOR_BLOCK (cust->blockvector (),
|
block = BLOCKVECTOR_BLOCK (cust->blockvector (),
|
||||||
iterator->which);
|
iterator->which);
|
||||||
sym = mdict_iterator_first (BLOCK_MULTIDICT (block),
|
sym = mdict_iterator_first (block->multidict (),
|
||||||
&iterator->mdict_iter);
|
&iterator->mdict_iter);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -571,7 +571,7 @@ block_iterator_first (const struct block *block,
|
||||||
initialize_block_iterator (block, iterator);
|
initialize_block_iterator (block, iterator);
|
||||||
|
|
||||||
if (iterator->which == FIRST_LOCAL_BLOCK)
|
if (iterator->which == FIRST_LOCAL_BLOCK)
|
||||||
return mdict_iterator_first (block->multidict, &iterator->mdict_iter);
|
return mdict_iterator_first (block->multidict (), &iterator->mdict_iter);
|
||||||
|
|
||||||
return block_iterator_step (iterator, 1);
|
return block_iterator_step (iterator, 1);
|
||||||
}
|
}
|
||||||
|
@ -614,7 +614,7 @@ block_iter_match_step (struct block_iterator *iterator,
|
||||||
|
|
||||||
block = BLOCKVECTOR_BLOCK (cust->blockvector (),
|
block = BLOCKVECTOR_BLOCK (cust->blockvector (),
|
||||||
iterator->which);
|
iterator->which);
|
||||||
sym = mdict_iter_match_first (BLOCK_MULTIDICT (block), name,
|
sym = mdict_iter_match_first (block->multidict (), name,
|
||||||
&iterator->mdict_iter);
|
&iterator->mdict_iter);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -641,7 +641,7 @@ block_iter_match_first (const struct block *block,
|
||||||
initialize_block_iterator (block, iterator);
|
initialize_block_iterator (block, iterator);
|
||||||
|
|
||||||
if (iterator->which == FIRST_LOCAL_BLOCK)
|
if (iterator->which == FIRST_LOCAL_BLOCK)
|
||||||
return mdict_iter_match_first (block->multidict, name,
|
return mdict_iter_match_first (block->multidict (), name,
|
||||||
&iterator->mdict_iter);
|
&iterator->mdict_iter);
|
||||||
|
|
||||||
return block_iter_match_step (iterator, name, 1);
|
return block_iter_match_step (iterator, name, 1);
|
||||||
|
@ -779,8 +779,8 @@ block_lookup_symbol_primary (const struct block *block, const char *name,
|
||||||
|| block->superblock ()->superblock () == NULL);
|
|| block->superblock ()->superblock () == NULL);
|
||||||
|
|
||||||
other = NULL;
|
other = NULL;
|
||||||
for (sym
|
for (sym = mdict_iter_match_first (block->multidict (), lookup_name,
|
||||||
= mdict_iter_match_first (block->multidict, lookup_name, &mdict_iter);
|
&mdict_iter);
|
||||||
sym != NULL;
|
sym != NULL;
|
||||||
sym = mdict_iter_match_next (lookup_name, &mdict_iter))
|
sym = mdict_iter_match_next (lookup_name, &mdict_iter))
|
||||||
{
|
{
|
||||||
|
|
11
gdb/block.h
11
gdb/block.h
|
@ -122,6 +122,14 @@ struct block
|
||||||
void set_superblock (const block *superblock)
|
void set_superblock (const block *superblock)
|
||||||
{ m_superblock = superblock; }
|
{ m_superblock = superblock; }
|
||||||
|
|
||||||
|
/* Return this block's multidict. */
|
||||||
|
multidictionary *multidict () const
|
||||||
|
{ return m_multidict; }
|
||||||
|
|
||||||
|
/* Set this block's multidict. */
|
||||||
|
void set_multidict (multidictionary *multidict)
|
||||||
|
{ m_multidict = multidict; }
|
||||||
|
|
||||||
/* Addresses in the executable code that are in this block. */
|
/* Addresses in the executable code that are in this block. */
|
||||||
|
|
||||||
CORE_ADDR m_start;
|
CORE_ADDR m_start;
|
||||||
|
@ -142,7 +150,7 @@ struct block
|
||||||
|
|
||||||
/* This is used to store the symbols in the block. */
|
/* This is used to store the symbols in the block. */
|
||||||
|
|
||||||
struct multidictionary *multidict;
|
struct multidictionary *m_multidict;
|
||||||
|
|
||||||
/* Contains information about namespace-related info relevant to this block:
|
/* Contains information about namespace-related info relevant to this block:
|
||||||
using directives and the current namespace scope. */
|
using directives and the current namespace scope. */
|
||||||
|
@ -170,7 +178,6 @@ struct global_block
|
||||||
struct compunit_symtab *compunit_symtab;
|
struct compunit_symtab *compunit_symtab;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BLOCK_MULTIDICT(bl) (bl)->multidict
|
|
||||||
#define BLOCK_NAMESPACE(bl) (bl)->namespace_info
|
#define BLOCK_NAMESPACE(bl) (bl)->namespace_info
|
||||||
|
|
||||||
/* Accessor for ranges field within block BL. */
|
/* Accessor for ranges field within block BL. */
|
||||||
|
|
|
@ -217,20 +217,21 @@ buildsym_compunit::finish_block_internal
|
||||||
|
|
||||||
if (symbol)
|
if (symbol)
|
||||||
{
|
{
|
||||||
BLOCK_MULTIDICT (block)
|
block->set_multidict
|
||||||
= mdict_create_linear (&m_objfile->objfile_obstack, *listhead);
|
(mdict_create_linear (&m_objfile->objfile_obstack, *listhead));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (expandable)
|
if (expandable)
|
||||||
{
|
{
|
||||||
BLOCK_MULTIDICT (block) = mdict_create_hashed_expandable (m_language);
|
block->set_multidict
|
||||||
mdict_add_pending (BLOCK_MULTIDICT (block), *listhead);
|
(mdict_create_hashed_expandable (m_language));
|
||||||
|
mdict_add_pending (block->multidict (), *listhead);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BLOCK_MULTIDICT (block) =
|
block->set_multidict
|
||||||
mdict_create_hashed (&m_objfile->objfile_obstack, *listhead);
|
(mdict_create_hashed (&m_objfile->objfile_obstack, *listhead));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,7 +257,7 @@ buildsym_compunit::finish_block_internal
|
||||||
|
|
||||||
/* Here we want to directly access the dictionary, because
|
/* Here we want to directly access the dictionary, because
|
||||||
we haven't fully initialized the block yet. */
|
we haven't fully initialized the block yet. */
|
||||||
ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym)
|
ALL_DICT_SYMBOLS (block->multidict (), miter, sym)
|
||||||
{
|
{
|
||||||
if (sym->is_argument ())
|
if (sym->is_argument ())
|
||||||
nparams++;
|
nparams++;
|
||||||
|
@ -271,7 +272,7 @@ buildsym_compunit::finish_block_internal
|
||||||
iparams = 0;
|
iparams = 0;
|
||||||
/* Here we want to directly access the dictionary, because
|
/* Here we want to directly access the dictionary, because
|
||||||
we haven't fully initialized the block yet. */
|
we haven't fully initialized the block yet. */
|
||||||
ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym)
|
ALL_DICT_SYMBOLS (block->multidict (), miter, sym)
|
||||||
{
|
{
|
||||||
if (iparams == nparams)
|
if (iparams == nparams)
|
||||||
break;
|
break;
|
||||||
|
@ -1013,7 +1014,7 @@ buildsym_compunit::end_compunit_symtab_with_blockvector
|
||||||
/* Note that we only want to fix up symbols from the local
|
/* Note that we only want to fix up symbols from the local
|
||||||
blocks, not blocks coming from included symtabs. That is why
|
blocks, not blocks coming from included symtabs. That is why
|
||||||
we use ALL_DICT_SYMBOLS here and not ALL_BLOCK_SYMBOLS. */
|
we use ALL_DICT_SYMBOLS here and not ALL_BLOCK_SYMBOLS. */
|
||||||
ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym)
|
ALL_DICT_SYMBOLS (block->multidict (), miter, sym)
|
||||||
if (sym->symtab () == NULL)
|
if (sym->symtab () == NULL)
|
||||||
sym->set_symtab (symtab);
|
sym->set_symtab (symtab);
|
||||||
}
|
}
|
||||||
|
@ -1148,7 +1149,7 @@ buildsym_compunit::augment_type_symtab ()
|
||||||
to the primary symtab. */
|
to the primary symtab. */
|
||||||
set_missing_symtab (m_file_symbols, cust);
|
set_missing_symtab (m_file_symbols, cust);
|
||||||
|
|
||||||
mdict_add_pending (BLOCK_MULTIDICT (block), m_file_symbols);
|
mdict_add_pending (block->multidict (), m_file_symbols);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_global_symbols != NULL)
|
if (m_global_symbols != NULL)
|
||||||
|
@ -1159,8 +1160,7 @@ buildsym_compunit::augment_type_symtab ()
|
||||||
to the primary symtab. */
|
to the primary symtab. */
|
||||||
set_missing_symtab (m_global_symbols, cust);
|
set_missing_symtab (m_global_symbols, cust);
|
||||||
|
|
||||||
mdict_add_pending (BLOCK_MULTIDICT (block),
|
mdict_add_pending (block->multidict (), m_global_symbols);
|
||||||
m_global_symbols);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -580,8 +580,8 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
|
||||||
TARGET_CHAR_BIT,
|
TARGET_CHAR_BIT,
|
||||||
"void");
|
"void");
|
||||||
|
|
||||||
BLOCK_MULTIDICT (new_block)
|
new_block->set_multidict
|
||||||
= mdict_create_linear (&objfile->objfile_obstack, NULL);
|
(mdict_create_linear (&objfile->objfile_obstack, NULL));
|
||||||
/* The address range. */
|
/* The address range. */
|
||||||
new_block->set_start (gdb_block_iter.begin);
|
new_block->set_start (gdb_block_iter.begin);
|
||||||
new_block->set_end (gdb_block_iter.end);
|
new_block->set_end (gdb_block_iter.end);
|
||||||
|
@ -618,8 +618,8 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
|
||||||
new_block = (i == GLOBAL_BLOCK
|
new_block = (i == GLOBAL_BLOCK
|
||||||
? allocate_global_block (&objfile->objfile_obstack)
|
? allocate_global_block (&objfile->objfile_obstack)
|
||||||
: allocate_block (&objfile->objfile_obstack));
|
: allocate_block (&objfile->objfile_obstack));
|
||||||
BLOCK_MULTIDICT (new_block)
|
new_block->set_multidict
|
||||||
= mdict_create_linear (&objfile->objfile_obstack, NULL);
|
(mdict_create_linear (&objfile->objfile_obstack, NULL));
|
||||||
new_block->set_superblock (block_iter);
|
new_block->set_superblock (block_iter);
|
||||||
block_iter = new_block;
|
block_iter = new_block;
|
||||||
|
|
||||||
|
|
|
@ -4489,7 +4489,7 @@ static void
|
||||||
add_symbol (struct symbol *s, struct symtab *symtab, struct block *b)
|
add_symbol (struct symbol *s, struct symtab *symtab, struct block *b)
|
||||||
{
|
{
|
||||||
s->set_symtab (symtab);
|
s->set_symtab (symtab);
|
||||||
mdict_add_symbol (BLOCK_MULTIDICT (b), s);
|
mdict_add_symbol (b->multidict (), s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add a new block B to a symtab S. */
|
/* Add a new block B to a symtab S. */
|
||||||
|
@ -4733,9 +4733,9 @@ new_block (enum block_type type, enum language language)
|
||||||
struct block *retval = XCNEW (struct block);
|
struct block *retval = XCNEW (struct block);
|
||||||
|
|
||||||
if (type == FUNCTION_BLOCK)
|
if (type == FUNCTION_BLOCK)
|
||||||
BLOCK_MULTIDICT (retval) = mdict_create_linear_expandable (language);
|
retval->set_multidict (mdict_create_linear_expandable (language));
|
||||||
else
|
else
|
||||||
BLOCK_MULTIDICT (retval) = mdict_create_hashed_expandable (language);
|
retval->set_multidict (mdict_create_hashed_expandable (language));
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -689,7 +689,7 @@ objfile_relocate1 (struct objfile *objfile,
|
||||||
|
|
||||||
/* We only want to iterate over the local symbols, not any
|
/* We only want to iterate over the local symbols, not any
|
||||||
symbols in included symtabs. */
|
symbols in included symtabs. */
|
||||||
ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (b), miter, sym)
|
ALL_DICT_SYMBOLS (b->multidict (), miter, sym)
|
||||||
{
|
{
|
||||||
relocate_one_symbol (sym, objfile, delta);
|
relocate_one_symbol (sym, objfile, delta);
|
||||||
}
|
}
|
||||||
|
|
|
@ -294,7 +294,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
|
||||||
even if we're using a hashtable, but nothing else but this message
|
even if we're using a hashtable, but nothing else but this message
|
||||||
wants it. */
|
wants it. */
|
||||||
gdb_printf (outfile, ", %d syms/buckets in ",
|
gdb_printf (outfile, ", %d syms/buckets in ",
|
||||||
mdict_size (BLOCK_MULTIDICT (b)));
|
mdict_size (b->multidict ()));
|
||||||
gdb_puts (paddress (gdbarch, b->start ()), outfile);
|
gdb_puts (paddress (gdbarch, b->start ()), outfile);
|
||||||
gdb_printf (outfile, "..");
|
gdb_printf (outfile, "..");
|
||||||
gdb_puts (paddress (gdbarch, b->end ()), outfile);
|
gdb_puts (paddress (gdbarch, b->end ()), outfile);
|
||||||
|
@ -312,7 +312,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
|
||||||
/* Now print each symbol in this block (in no particular order, if
|
/* Now print each symbol in this block (in no particular order, if
|
||||||
we're using a hashtable). Note that we only want this
|
we're using a hashtable). Note that we only want this
|
||||||
block, not any blocks from included symtabs. */
|
block, not any blocks from included symtabs. */
|
||||||
ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (b), miter, sym)
|
ALL_DICT_SYMBOLS (b->multidict (), miter, sym)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue