gdb: remove SYMBOL_INLINED macro

Add a getter and a setter for whether a symbol is inlined.  Remove the
corresponding macro and adjust all callers.

Change-Id: I934468da3b5a32dd6b161a6f252a6b1b94737279
This commit is contained in:
Simon Marchi 2022-01-27 22:08:54 -05:00
parent d9743061f9
commit 32177d6e39
4 changed files with 15 additions and 6 deletions

View File

@ -124,7 +124,7 @@ block_containing_function (const struct block *bl)
int
block_inlined_p (const struct block *bl)
{
return BLOCK_FUNCTION (bl) != NULL && SYMBOL_INLINED (BLOCK_FUNCTION (bl));
return BLOCK_FUNCTION (bl) != NULL && BLOCK_FUNCTION (bl)->is_inlined ();
}
/* A helper function that checks whether PC is in the blockvector BL.

View File

@ -21794,7 +21794,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
/* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
finish_block. */
sym->set_aclass_index (LOC_BLOCK);
SYMBOL_INLINED (sym) = 1;
sym->set_is_inlined (1);
list_to_add = cu->list_in_scope;
break;
case DW_TAG_template_value_param:

View File

@ -1200,7 +1200,7 @@ iterate_over_all_matching_symtabs
{
/* Restrict calls to CALLBACK to symbols
representing inline symbols only. */
if (SYMBOL_INLINED (bsym->symbol))
if (bsym->symbol->is_inlined ())
return callback (bsym);
return true;
});

View File

@ -1117,7 +1117,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
m_aclass_index (0),
m_is_objfile_owned (1),
m_is_argument (0),
is_inlined (0),
m_is_inlined (0),
maybe_copied (0),
subclass (SYMBOL_NONE),
artificial (false)
@ -1188,6 +1188,16 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
m_is_argument = is_argument;
}
bool is_inlined () const
{
return m_is_inlined;
}
void set_is_inlined (bool is_inlined)
{
m_is_inlined = is_inlined;
}
/* Data type of value */
struct type *type = nullptr;
@ -1226,7 +1236,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
unsigned m_is_argument : 1;
/* Whether this is an inlined function (class LOC_BLOCK only). */
unsigned is_inlined : 1;
unsigned m_is_inlined : 1;
/* For LOC_STATIC only, if this is set, then the symbol might be
subject to copy relocation. In this case, a minimal symbol
@ -1290,7 +1300,6 @@ struct block_symbol
/* Note: There is no accessor macro for symbol.owner because it is
"private". */
#define SYMBOL_INLINED(symbol) (symbol)->is_inlined
#define SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION(symbol) \
(((symbol)->subclass) == SYMBOL_TEMPLATE)
#define SYMBOL_TYPE(symbol) (symbol)->type