summaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-11-18 12:26:02 -0700
committerTom Tromey <tromey@adacore.com>2022-03-28 13:07:42 -0600
commit797662d7ef6705f9c300cb3e9a78f17f0f2aedad (patch)
tree43484c9ab7c5c46631fb66659ca9902f4a5bd44e /gdb/gdbtypes.h
parent7eb21cc702249b4fb1beecee25c0c8ccbd9edd15 (diff)
downloadbinutils-gdb-797662d7ef6705f9c300cb3e9a78f17f0f2aedad.tar.gz
Make call_site_target members private
This makes the data members of call_site_target 'private'. This lets us remove most of its public API. call_site_to_target_addr is changed to be a method of this type. This is a preparatory refactoring for the fix at the end of this series.
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r--gdb/gdbtypes.h44
1 files changed, 21 insertions, 23 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 122cb355ab1..0e14203aca7 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1835,47 +1835,35 @@ struct call_site_target
DWARF_BLOCK,
};
- kind loc_kind () const
- {
- return m_loc_kind;
- }
-
- CORE_ADDR loc_physaddr () const
- {
- gdb_assert (m_loc_kind == PHYSADDR);
- return m_loc.physaddr;
- }
-
void set_loc_physaddr (CORE_ADDR physaddr)
{
m_loc_kind = PHYSADDR;
m_loc.physaddr = physaddr;
}
- const char *loc_physname () const
- {
- gdb_assert (m_loc_kind == PHYSNAME);
- return m_loc.physname;
- }
-
void set_loc_physname (const char *physname)
{
m_loc_kind = PHYSNAME;
m_loc.physname = physname;
}
- dwarf2_locexpr_baton *loc_dwarf_block () const
- {
- gdb_assert (m_loc_kind == DWARF_BLOCK);
- return m_loc.dwarf_block;
- }
-
void set_loc_dwarf_block (dwarf2_locexpr_baton *dwarf_block)
{
m_loc_kind = DWARF_BLOCK;
m_loc.dwarf_block = dwarf_block;
}
+ /* Find DW_TAG_call_site's DW_AT_call_target address. CALLER_FRAME
+ (for registers) can be NULL if it is not known. This function
+ always returns valid address or it throws
+ NO_ENTRY_VALUE_ERROR. */
+
+ CORE_ADDR address (struct gdbarch *call_site_gdbarch,
+ const struct call_site *call_site,
+ struct frame_info *caller_frame) const;
+
+private:
+
union
{
/* Address. */
@@ -1967,6 +1955,16 @@ struct call_site
CORE_ADDR pc () const;
+ /* Find the target address. CALLER_FRAME (for registers) can be
+ NULL if it is not known. This function always returns valid
+ address or it throws NO_ENTRY_VALUE_ERROR. */
+
+ CORE_ADDR address (struct gdbarch *call_site_gdbarch,
+ struct frame_info *caller_frame) const
+ {
+ return target.address (call_site_gdbarch, this, caller_frame);
+ }
+
/* * List successor with head in FUNC_TYPE.TAIL_CALL_LIST. */
struct call_site *tail_call_next = nullptr;