diff options
-rw-r--r-- | gdb/dwarf2/read.c | 7 | ||||
-rw-r--r-- | gdb/gdbtypes.h | 15 | ||||
-rw-r--r-- | gdb/symtab.c | 5 |
3 files changed, 23 insertions, 4 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 214810d..f8421ae 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -13341,7 +13341,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = objfile->arch (); CORE_ADDR pc, baseaddr; struct attribute *attr; - struct call_site *call_site; + struct call_site *call_site, call_site_local; void **slot; int nparams; struct die_info *child_die; @@ -13366,10 +13366,11 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) pc = gdbarch_adjust_dwarf2_addr (gdbarch, pc); if (cu->call_site_htab == NULL) - cu->call_site_htab = htab_create_alloc_ex (16, core_addr_hash, core_addr_eq, + cu->call_site_htab = htab_create_alloc_ex (16, call_site_hash, call_site_eq, NULL, &objfile->objfile_obstack, hashtab_obstack_allocate, NULL); - slot = htab_find_slot (cu->call_site_htab, &pc, INSERT); + call_site_local.pc = pc; + slot = htab_find_slot (cu->call_site_htab, &call_site_local, INSERT); if (*slot != NULL) { complaint (_("Duplicate PC %s for DW_TAG_call_site " diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 6d09576..8021cb2 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1824,6 +1824,21 @@ struct call_site struct call_site_parameter parameter[1]; }; +static inline int +call_site_eq (const void *a_, const void *b_) +{ + const struct call_site *a = (const call_site *)a_; + const struct call_site *b = (const call_site *)b_; + return core_addr_eq (&a->pc, &b->pc); +} + +static inline hashval_t +call_site_hash (const void *a_) +{ + const struct call_site *a = (const call_site *)a_; + return core_addr_hash (&a->pc); +} + /* The type-specific info for TYPE_CODE_FIXED_POINT types. */ struct fixed_point_type_info diff --git a/gdb/symtab.c b/gdb/symtab.c index e6851c3..bd1eb42 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -334,10 +334,13 @@ search_domain_name (enum search_domain e) call_site * compunit_symtab::find_call_site (CORE_ADDR pc) const { + struct call_site call_site_local; if (m_call_site_htab == nullptr) return nullptr; - void **slot = htab_find_slot (m_call_site_htab, &pc, NO_INSERT); + call_site_local.pc = pc; + void **slot + = htab_find_slot (m_call_site_htab, &call_site_local, NO_INSERT); if (slot == nullptr) return nullptr; |