explicit dwarf2_queue_guard (dwarf2_per_objfile *per_objfile)
: m_per_objfile (per_objfile)
{
- gdb_assert (!m_per_objfile->per_bfd->queue.has_value ());
+ gdb_assert (!m_per_objfile->queue.has_value ());
- m_per_objfile->per_bfd->queue.emplace ();
+ m_per_objfile->queue.emplace ();
}
/* Free any entries remaining on the queue. There should only be
entries left if we hit an error while processing the dwarf. */
~dwarf2_queue_guard ()
{
- gdb_assert (m_per_objfile->per_bfd->queue.has_value ());
+ gdb_assert (m_per_objfile->queue.has_value ());
- m_per_objfile->per_bfd->queue.reset ();
+ m_per_objfile->queue.reset ();
}
DISABLE_COPY_AND_ASSIGN (dwarf2_queue_guard);
void
dwarf2_per_objfile::remove_all_cus ()
{
- gdb_assert (!this->per_bfd->queue.has_value ());
+ gdb_assert (!queue.has_value ());
m_dwarf2_cus.clear ();
}
{
per_cu->queued = 1;
- gdb_assert (per_objfile->per_bfd->queue.has_value ());
- per_cu->per_bfd->queue->emplace (per_cu, per_objfile, pretend_language);
+ gdb_assert (per_objfile->queue.has_value ());
+ per_objfile->queue->emplace (per_cu, per_objfile, pretend_language);
}
/* If PER_CU is not yet expanded of queued for expansion, add it to the queue.
/* The queue starts out with one item, but following a DIE reference
may load a new CU, adding it to the end of the queue. */
- while (!per_objfile->per_bfd->queue->empty ())
+ while (!per_objfile->queue->empty ())
{
- dwarf2_queue_item &item = per_objfile->per_bfd->queue->front ();
+ dwarf2_queue_item &item = per_objfile->queue->front ();
dwarf2_per_cu_data *per_cu = item.per_cu;
if (!per_objfile->symtab_set_p (per_cu))
}
per_cu->queued = 0;
- per_objfile->per_bfd->queue->pop ();
+ per_objfile->queue->pop ();
}
dwarf_read_debug_printf ("Done expanding symtabs of %s.",
loaded in memory. Calling age_comp_units while the queue is in use could
make us free the DIEs for a CU that is in the queue and therefore break
that invariant. */
- gdb_assert (!this->per_bfd->queue.has_value ());
+ gdb_assert (!queue.has_value ());
/* Start by clearing all marks. */
for (const auto &pair : m_dwarf2_cus)
gdb::hash_enum<sect_offset>>
abstract_to_concrete;
- /* CUs that are queued to be read. */
- gdb::optional<std::queue<dwarf2_queue_item>> queue;
-
/* The address map that is used by the DWARF index code. */
struct addrmap *index_addrmap = nullptr;
};
/* The CU containing the m_builder in scope. */
dwarf2_cu *sym_cu = nullptr;
+ /* CUs that are queued to be read. */
+ gdb::optional<std::queue<dwarf2_queue_item>> queue;
+
private:
/* Hold the corresponding compunit_symtab for each CU or TU. This
is indexed by dwarf2_per_cu_data::index. A NULL value means