aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-10-02 17:38:05 +0200
committerTom de Vries <tdevries@suse.de>2021-10-02 17:38:05 +0200
commitb625c7701d700d2a11cc1704a23bb79847251f01 (patch)
tree3aa26137da9f475b90144d309a21c816c2e7ac9a /gdb/symtab.c
parent1e9983e73052d78e6c9fb709ddb897d26fef664c (diff)
downloadgdb-b625c7701d700d2a11cc1704a23bb79847251f01.zip
gdb-b625c7701d700d2a11cc1704a23bb79847251f01.tar.gz
gdb-b625c7701d700d2a11cc1704a23bb79847251f01.tar.bz2
[gdb/symtab] Remove COMPUNIT_CALL_SITE_HTAB
Remove macro COMPUNIT_CALL_SITE_HTAB, and provide access to the htab using member functions: - compunit_symtab::find_call_site - compunit_symtab::set_call_site_htab Tested on x86_64-linux. Co-Authored-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 62451fe..6ec5d95 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -331,6 +331,30 @@ search_domain_name (enum search_domain e)
/* See symtab.h. */
+call_site *
+compunit_symtab::find_call_site (CORE_ADDR pc) const
+{
+ if (m_call_site_htab == nullptr)
+ return nullptr;
+
+ void **slot = htab_find_slot (m_call_site_htab, &pc, NO_INSERT);
+ if (slot == nullptr)
+ return nullptr;
+
+ return (call_site *) *slot;
+}
+
+/* See symtab.h. */
+
+void
+compunit_symtab::set_call_site_htab (htab_t call_site_htab)
+{
+ gdb_assert (m_call_site_htab == nullptr);
+ m_call_site_htab = call_site_htab;
+}
+
+/* See symtab.h. */
+
struct symtab *
compunit_primary_filetab (const struct compunit_symtab *cust)
{