+2014-11-18 Doug Evans <xdje42@gmail.com>
+
+ * symtab.h (SYMTAB_BLOCKVECTOR): Renamed from BLOCKVECTOR. All uses
+ updated.
+
2014-11-18 Doug Evans <xdje42@gmail.com>
* buildsym.c (buildsym_objfile): New static global.
symtab = NULL;
if (symtab != NULL)
- return BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
+ return BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), STATIC_BLOCK);
else if (nsyms == 0 || SYMBOL_CLASS (syms[0].sym) != LOC_BLOCK)
{
if (context == NULL)
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 (BLOCKVECTOR (sym->symtab), GLOBAL_BLOCK) != block
- && BLOCKVECTOR_BLOCK (BLOCKVECTOR (sym->symtab), STATIC_BLOCK) != block)
+ && BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (sym->symtab),
+ GLOBAL_BLOCK) != block
+ && BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (sym->symtab),
+ STATIC_BLOCK) != block)
return;
h = msymbol_hash (name) % HASH_SIZE;
ALL_PRIMARY_SYMTABS (objfile, s)
{
QUIT;
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
+ b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), GLOBAL_BLOCK);
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
symbol_completion_add (&completions, SYMBOL_LINKAGE_NAME (sym),
ALL_PRIMARY_SYMTABS (objfile, s)
{
QUIT;
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
+ b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), STATIC_BLOCK);
/* Don't do this block twice. */
if (b == surrounding_static_block)
continue;
ALL_PRIMARY_SYMTABS (objfile, s)
{
- const struct blockvector *bv = BLOCKVECTOR (s);
+ const struct blockvector *bv = SYMTAB_BLOCKVECTOR (s);
int i;
for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
return 0;
}
- bl = BLOCKVECTOR (symtab);
+ bl = SYMTAB_BLOCKVECTOR (symtab);
/* Then search that symtab for the smallest block that wins. */
b = find_block_in_blockvector (bl, pc);
if (symtab == NULL)
return NULL;
- block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), iterator->which);
+ block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab),
+ iterator->which);
sym = dict_iterator_first (BLOCK_DICT (block), &iterator->dict_iter);
}
else
if (symtab == NULL)
return NULL;
- block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), iterator->which);
+ block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab),
+ iterator->which);
sym = dict_iter_name_first (BLOCK_DICT (block), name,
&iterator->dict_iter);
}
if (symtab == NULL)
return NULL;
- block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), iterator->which);
+ block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab),
+ iterator->which);
sym = dict_iter_match_first (BLOCK_DICT (block), name,
compare, &iterator->dict_iter);
}
symtab = lookup_symtab (copy);
if (symtab)
{
- yylval.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab),
+ yylval.bval = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab),
STATIC_BLOCK);
return FILENAME;
}
struct symbol *real_sym;
/* Go through the per-file symbols only. */
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
+ b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), STATIC_BLOCK);
ALL_BLOCK_SYMBOLS (b, iter, real_sym)
{
/* Find completed typedefs to use to fix opaque ones.
ALL_PRIMARY_SYMTABS (objfile, s)
{
QUIT;
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
+ b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), GLOBAL_BLOCK);
make_symbol_overload_list_block (func_name, b);
}
ALL_PRIMARY_SYMTABS (objfile, s)
{
QUIT;
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
+ b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), STATIC_BLOCK);
/* Don't do this block twice. */
if (b == surrounding_static_block)
continue;
{
struct symbol *sym = NULL;
struct symtab *stab = dw2_instantiate_symtab (per_cu);
- const struct blockvector *bv = BLOCKVECTOR (stab);
+ const struct blockvector *bv = SYMTAB_BLOCKVECTOR (stab);
struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
/* Some caution must be observed with overloaded functions
{
int i;
- if (BLOCKVECTOR (symtab) != NULL
- && blockvector_contains_pc (BLOCKVECTOR (symtab), pc))
+ if (SYMTAB_BLOCKVECTOR (symtab) != NULL
+ && blockvector_contains_pc (SYMTAB_BLOCKVECTOR (symtab), pc))
return symtab;
if (symtab->includes == NULL)
const struct blockvector *blockvector;
const struct block *block;
- blockvector = BLOCKVECTOR (symtab);
+ blockvector = SYMTAB_BLOCKVECTOR (symtab);
block = BLOCKVECTOR_BLOCK (blockvector, GLOBAL_BLOCK);
return bkscm_scm_from_block (block, SYMTAB_OBJFILE (symtab));
const struct blockvector *blockvector;
const struct block *block;
- blockvector = BLOCKVECTOR (symtab);
+ blockvector = SYMTAB_BLOCKVECTOR (symtab);
block = BLOCKVECTOR_BLOCK (blockvector, STATIC_BLOCK);
return bkscm_scm_from_block (block, SYMTAB_OBJFILE (symtab));
obstack_alloc (&objfile->objfile_obstack,
sizeof (struct blockvector) + sizeof (struct block *));
BLOCKVECTOR_NBLOCKS (bv) = 1;
- BLOCKVECTOR (class_symtab) = bv;
+ SYMTAB_BLOCKVECTOR (class_symtab) = bv;
/* Allocate dummy STATIC_BLOCK. */
bl = allocate_block (&objfile->objfile_obstack);
{
struct symtab *symtab
= get_java_class_symtab (get_objfile_arch (SYMBOL_OBJFILE (sym)));
- const struct blockvector *bv = BLOCKVECTOR (symtab);
+ const struct blockvector *bv = SYMTAB_BLOCKVECTOR (symtab);
dict_add_symbol (BLOCK_DICT (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)), sym);
}
int i;
for (i = FIRST_LOCAL_BLOCK;
- i < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (symtab)); i++)
+ i < BLOCKVECTOR_NBLOCKS (SYMTAB_BLOCKVECTOR (symtab));
+ i++)
{
- block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), i);
+ block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), i);
state->language->la_iterate_over_symbols
(block, name, domain, iterate_inline_only, &cad);
}
{
struct block *block;
- for (block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
+ for (block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), STATIC_BLOCK);
block != NULL;
block = BLOCK_SUPERBLOCK (block))
LA_ITERATE_OVER_SYMBOLS (block, name, domain, callback, data);
if (s->primary)
{
++nr_primary_symtabs;
- nr_blocks += BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s));
+ nr_blocks += BLOCKVECTOR_NBLOCKS (SYMTAB_BLOCKVECTOR (s));
}
}
}
case stGlobal: /* External symbol, goes into global block. */
class = LOC_STATIC;
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st),
+ b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (top_stack->cur_st),
GLOBAL_BLOCK);
s = new_symbol (name);
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
b = top_stack->cur_block;
if (sh->st == stProc)
{
- const struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st);
+ const struct blockvector *bv
+ = SYMTAB_BLOCKVECTOR (top_stack->cur_st);
/* The next test should normally be true, but provides a
hook for nested functions (which we don't want to make
top_stack->blocktype == stStaticProc))
{
/* Finished with procedure */
- const struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st);
+ const struct blockvector *bv
+ = SYMTAB_BLOCKVECTOR (top_stack->cur_st);
struct mdebug_extra_func_info *e;
struct block *b = top_stack->cur_block;
struct type *ftype = top_stack->cur_type;
#else
s = mylookup_symbol
(sh_name,
- BLOCKVECTOR_BLOCK (BLOCKVECTOR (search_symtab), STATIC_BLOCK),
+ BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (search_symtab), STATIC_BLOCK),
VAR_DOMAIN,
LOC_BLOCK);
#endif
push_parse_stack ();
top_stack->cur_st = st;
- top_stack->cur_block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (st),
+ top_stack->cur_block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (st),
STATIC_BLOCK);
BLOCK_START (top_stack->cur_block) = pst->textlow;
BLOCK_END (top_stack->cur_block) = 0;
FIXME, Maybe quit once we have found the right number of ext's? */
top_stack->cur_st = st;
top_stack->cur_block
- = BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st),
+ = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (top_stack->cur_st),
GLOBAL_BLOCK);
top_stack->blocktype = stFile;
{
/* Cast away "const", but that's ok because we're building the
symtab and blockvector here. */
- struct blockvector *bv = (struct blockvector *) BLOCKVECTOR (s);
+ struct blockvector *bv = (struct blockvector *) SYMTAB_BLOCKVECTOR (s);
bv = (struct blockvector *) xrealloc ((void *) bv,
(sizeof (struct blockvector)
+ BLOCKVECTOR_NBLOCKS (bv)
* sizeof (bv->block)));
- if (bv != BLOCKVECTOR (s))
- BLOCKVECTOR (s) = bv;
+ if (bv != SYMTAB_BLOCKVECTOR (s))
+ SYMTAB_BLOCKVECTOR (s) = bv;
BLOCKVECTOR_BLOCK (bv, BLOCKVECTOR_NBLOCKS (bv)++) = b;
}
{
/* 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 *) BLOCKVECTOR (s);
+ struct blockvector *bv = (struct blockvector *) SYMTAB_BLOCKVECTOR (s);
if (BLOCKVECTOR_NBLOCKS (bv) <= FIRST_LOCAL_BLOCK)
{
BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = new_block (NON_FUNCTION_BLOCK);
BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- BLOCKVECTOR (s) = bv;
+ SYMTAB_BLOCKVECTOR (s) = bv;
s->debugformat = "ECOFF";
return (s);
if (!s->primary)
continue;
- bv = BLOCKVECTOR (s);
+ bv = SYMTAB_BLOCKVECTOR (s);
if (BLOCKVECTOR_MAP (bv))
addrmap_relocate (BLOCKVECTOR_MAP (bv),
ANOFFSET (delta, s->block_line_section));
struct symtab *tem =
lookup_symtab (copy_name ($1.stoken));
if (tem)
- $$ = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem),
+ $$ = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (tem),
STATIC_BLOCK);
else
error (_("No file or function \"%s\"."),
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
if (cursal.symtab)
expression_context_block
- = BLOCKVECTOR_BLOCK (BLOCKVECTOR (cursal.symtab), STATIC_BLOCK);
+ = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (cursal.symtab),
+ STATIC_BLOCK);
if (expression_context_block)
expression_context_pc = BLOCK_START (expression_context_block);
}
/* Note: While psymtab_to_symtab can return NULL if the partial symtab
is empty, we can assume it won't here because lookup_partial_symbol
succeeded. */
- const struct blockvector *bv = BLOCKVECTOR (stab);
+ const struct blockvector *bv = SYMTAB_BLOCKVECTOR (stab);
struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
/* Some caution must be observed with overloaded functions
if (s == NULL)
continue;
- block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), block_kind);
+ block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), block_kind);
if (map_block (name, namespace, objfile, block,
callback, data, match))
return;
/* Now do checks requiring the associated symtab. */
if (s == NULL)
continue;
- bv = BLOCKVECTOR (s);
+ bv = SYMTAB_BLOCKVECTOR (s);
b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
psym = objfile->static_psymbols.list + ps->statics_offset;
length = ps->n_static_syms;
STPY_REQUIRE_VALID (self, symtab);
- blockvector = BLOCKVECTOR (symtab);
+ blockvector = SYMTAB_BLOCKVECTOR (symtab);
block = BLOCKVECTOR_BLOCK (blockvector, GLOBAL_BLOCK);
return block_to_block_object (block, SYMTAB_OBJFILE (symtab));
}
STPY_REQUIRE_VALID (self, symtab);
- blockvector = BLOCKVECTOR (symtab);
+ blockvector = SYMTAB_BLOCKVECTOR (symtab);
block = BLOCKVECTOR_BLOCK (blockvector, STATIC_BLOCK);
return block_to_block_object (block, SYMTAB_OBJFILE (symtab));
}
minsym.minsym));
if (symtab != NULL)
{
- const struct blockvector *bv = BLOCKVECTOR (symtab);
+ const struct blockvector *bv = SYMTAB_BLOCKVECTOR (symtab);
struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
struct symbol *sym;
struct symtab_and_line sal;
if (symtab->primary)
{
fprintf_filtered (outfile, "\nBlockvector:\n\n");
- bv = BLOCKVECTOR (symtab);
+ bv = SYMTAB_BLOCKVECTOR (symtab);
len = BLOCKVECTOR_NBLOCKS (bv);
for (i = 0; i < len; i++)
{
Non-primary symtabs share the block vector with their primary symtabs
so we use ALL_PRIMARY_SYMTABS here instead of ALL_SYMTABS. */
ALL_PRIMARY_SYMTABS (obj, s)
- if (block == BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK))
+ if (block == BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), GLOBAL_BLOCK))
{
if (obj->separate_debug_objfile_backlink)
obj = obj->separate_debug_objfile_backlink;
/* Go through symtabs. */
ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
{
- bv = BLOCKVECTOR (s);
+ bv = SYMTAB_BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
sym = block_lookup_symbol (block, name, domain);
if (sym)
ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
{
- bv = BLOCKVECTOR (s);
+ bv = SYMTAB_BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, block_index);
sym = block_lookup_symbol (block, name, domain);
if (sym)
if (!symtab)
return NULL;
- bv = BLOCKVECTOR (symtab);
+ bv = SYMTAB_BLOCKVECTOR (symtab);
block = BLOCKVECTOR_BLOCK (bv, block_index);
sym = block_lookup_symbol (block, name, domain);
if (!sym)
if (!symtab)
return NULL;
- bv = BLOCKVECTOR (symtab);
+ bv = SYMTAB_BLOCKVECTOR (symtab);
block = BLOCKVECTOR_BLOCK (bv, block_index);
sym = block_lookup_symbol (block, name, STRUCT_DOMAIN);
if (!sym)
{
ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
{
- bv = BLOCKVECTOR (s);
+ bv = SYMTAB_BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
sym = block_lookup_symbol (block, name, STRUCT_DOMAIN);
if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
{
ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
{
- bv = BLOCKVECTOR (s);
+ bv = SYMTAB_BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
sym = block_lookup_symbol (block, name, STRUCT_DOMAIN);
if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
ALL_PRIMARY_SYMTABS (objfile, s)
{
- bv = BLOCKVECTOR (s);
+ bv = SYMTAB_BLOCKVECTOR (s);
b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
if (BLOCK_START (b) <= pc
return val;
}
- bv = BLOCKVECTOR (s);
+ bv = SYMTAB_BLOCKVECTOR (s);
objfile = SYMTAB_OBJFILE (s);
/* Look at all the symtabs that share this blockvector.
ALL_OBJFILE_SYMTABS (objfile, s)
{
- if (BLOCKVECTOR (s) != bv)
+ if (SYMTAB_BLOCKVECTOR (s) != bv)
continue;
/* Find the best line in this symtab. */
ALL_PRIMARY_SYMTABS (objfile, s)
{
- bv = BLOCKVECTOR (s);
+ bv = SYMTAB_BLOCKVECTOR (s);
for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
{
b = BLOCKVECTOR_BLOCK (bv, i);
ALL_PRIMARY_SYMTABS (objfile, s)
{
QUIT;
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
+ b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), GLOBAL_BLOCK);
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
if (code == TYPE_CODE_UNDEF
ALL_PRIMARY_SYMTABS (objfile, s)
{
QUIT;
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
+ b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), STATIC_BLOCK);
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
if (code == TYPE_CODE_UNDEF
/* Go through this symtab and check the externs and statics for
symbols which match. */
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
+ b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), GLOBAL_BLOCK);
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
}
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
+ b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), STATIC_BLOCK);
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word);
struct symtab *user;
};
-#define BLOCKVECTOR(symtab) (symtab)->blockvector
+#define SYMTAB_BLOCKVECTOR(symtab) ((symtab)->blockvector)
#define SYMTAB_LINETABLE(symtab) ((symtab)->linetable)
#define SYMTAB_OBJFILE(symtab) ((symtab)->objfile)
#define SYMTAB_PSPACE(symtab) (SYMTAB_OBJFILE (symtab)->pspace)