aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-01-27 22:08:54 -0500
committerSimon Marchi <simon.marchi@efficios.com>2022-02-06 16:03:46 -0500
commit32177d6e39a2ed82fdafd7c41456c311b64d09fc (patch)
tree898327974f91be4366d3dd7806f6692364a7f85a
parentd9743061f92738a6c3f311d640e614a5a2f01b1e (diff)
downloadgdb-32177d6e39a2ed82fdafd7c41456c311b64d09fc.zip
gdb-32177d6e39a2ed82fdafd7c41456c311b64d09fc.tar.gz
gdb-32177d6e39a2ed82fdafd7c41456c311b64d09fc.tar.bz2
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
-rw-r--r--gdb/block.c2
-rw-r--r--gdb/dwarf2/read.c2
-rw-r--r--gdb/linespec.c2
-rw-r--r--gdb/symtab.h15
4 files changed, 15 insertions, 6 deletions
diff --git a/gdb/block.c b/gdb/block.c
index f753212..3d11ea6 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -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.
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 259401f..95d4d6f 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -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:
diff --git a/gdb/linespec.c b/gdb/linespec.c
index ac21bbd..7c40367 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -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;
});
diff --git a/gdb/symtab.h b/gdb/symtab.h
index f565f12..9b7d7e3 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -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