aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-12-19 11:25:48 -0700
committerTom Tromey <tromey@adacore.com>2023-05-12 13:25:28 -0600
commit36ed3d84e0ac1b6f21e68c742d72061ff51cb76b (patch)
tree6dfb69c6951f5ccbc27d9ba96603427938b23974 /gdb/symtab.h
parentbb051d7a307ee7a53905d1d1cb08f30f70eeba3f (diff)
downloadgdb-36ed3d84e0ac1b6f21e68c742d72061ff51cb76b.zip
gdb-36ed3d84e0ac1b6f21e68c742d72061ff51cb76b.tar.gz
gdb-36ed3d84e0ac1b6f21e68c742d72061ff51cb76b.tar.bz2
Introduce symbol_block_ops::get_block_value
This adds a new callback to symbol_block_ops. This callback lets a LOC_BLOCK symbol implement its own function to find the underlying block.
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 8d3f561..d8e3c27 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1182,6 +1182,12 @@ struct symbol_block_ops
the corresponding DW_AT_frame_base attribute. */
CORE_ADDR (*get_frame_base) (struct symbol *framefunc,
frame_info_ptr frame);
+
+ /* Return the block for this function. So far, this is used to
+ implement function aliases. So, if this is set, then it's not
+ necessary to set the other functions in this structure; and vice
+ versa. */
+ const block *(*get_block_value) (const struct symbol *sym);
};
/* Functions used with LOC_REGISTER and LOC_REGPARM_ADDR. */
@@ -1536,6 +1542,9 @@ struct block_symbol
inline const block *
symbol::value_block () const
{
+ if (SYMBOL_BLOCK_OPS (this) != nullptr
+ && SYMBOL_BLOCK_OPS (this)->get_block_value != nullptr)
+ return SYMBOL_BLOCK_OPS (this)->get_block_value (this);
return m_value.block;
}