}
-struct addrmap *
-addrmap_fixed::create_fixed (struct obstack *obstack)
-{
- internal_error (__FILE__, __LINE__,
- _("addrmap_create_fixed is not implemented yet "
- "for fixed addrmaps"));
-}
-
-
void
addrmap_fixed::relocate (CORE_ADDR offset)
{
}
-struct addrmap *
-addrmap_mutable::create_fixed (struct obstack *obstack)
-{
- return new (obstack) struct addrmap_fixed (obstack, this);
-}
-
-
void
addrmap_mutable::relocate (CORE_ADDR offset)
{
CHECK_ADDRMAP_FIND (map, array, 13, 19, nullptr);
/* Create corresponding fixed addrmap. */
- struct addrmap *map2 = map->create_fixed (&temp_obstack);
+ struct addrmap *map2
+ = new (&temp_obstack) addrmap_fixed (&temp_obstack, map);
SELF_CHECK (map2 != nullptr);
CHECK_ADDRMAP_FIND (map2, array, 0, 9, nullptr);
CHECK_ADDRMAP_FIND (map2, array, 10, 12, val1);
/* Return the object associated with ADDR in MAP. */
virtual void *find (CORE_ADDR addr) const = 0;
- /* Create a fixed address map which is a copy of this mutable
- address map. Allocate entries in OBSTACK. */
- virtual struct addrmap *create_fixed (struct obstack *obstack) = 0;
-
/* Relocate all the addresses in MAP by OFFSET. (This can be applied
to either mutable or immutable maps.) */
virtual void relocate (CORE_ADDR offset) = 0;
void set_empty (CORE_ADDR start, CORE_ADDR end_inclusive,
void *obj) override;
void *find (CORE_ADDR addr) const override;
- struct addrmap *create_fixed (struct obstack *obstack) override;
void relocate (CORE_ADDR offset) override;
int foreach (addrmap_foreach_fn fn) override;
void set_empty (CORE_ADDR start, CORE_ADDR end_inclusive,
void *obj) override;
void *find (CORE_ADDR addr) const override;
- struct addrmap *create_fixed (struct obstack *obstack) override;
void relocate (CORE_ADDR offset) override;
int foreach (addrmap_foreach_fn fn) override;
blockvector. */
if (m_pending_addrmap != nullptr && m_pending_addrmap_interesting)
blockvector->set_map
- (m_pending_addrmap->create_fixed (&m_objfile->objfile_obstack));
+ (new (&m_objfile->objfile_obstack) addrmap_fixed
+ (&m_objfile->objfile_obstack, m_pending_addrmap));
else
blockvector->set_map (nullptr);
dwarf2_per_cu_data *per_cu);
/* Install a new fixed addrmap from the given mutable addrmap. */
- void install_addrmap (addrmap *map)
+ void install_addrmap (addrmap_mutable *map)
{
gdb_assert (m_addrmap == nullptr);
- m_addrmap = map->create_fixed (&m_storage);
+ m_addrmap = new (&m_storage) addrmap_fixed (&m_storage, map);
}
/* Finalize the index. This should be called a single time, when
mutable_map->set_empty (lo, hi - 1, per_bfd->get_cu (cu_index));
}
- per_bfd->index_addrmap = mutable_map->create_fixed (&per_bfd->obstack);
+ per_bfd->index_addrmap
+ = new (&per_bfd->obstack) addrmap_fixed (&per_bfd->obstack, mutable_map);
}
/* Read the address map data from DWARF-5 .debug_aranges, and use it
= new (&temp_obstack) addrmap_mutable (&temp_obstack);
if (read_addrmap_from_aranges (per_objfile, section, mutable_map))
- per_bfd->index_addrmap = mutable_map->create_fixed (&per_bfd->obstack);
+ per_bfd->index_addrmap
+ = new (&per_bfd->obstack) addrmap_fixed (&per_bfd->obstack,
+ mutable_map);
}
/* A helper function that reads the .gdb_index from BUFFER and fills