#include "dwarf2/cu.h"
#include "dwarf2/read.h"
#include "objfiles.h"
+#include "gdbsupport/thread-pool.h"
/* Initialize dwarf2_cu to read PER_CU, in the context of PER_OBJFILE. */
if (m_builder != nullptr)
return m_builder.get ();
- if (per_objfile->sym_cu != nullptr)
- return per_objfile->sym_cu->m_builder.get ();
+ if (per_objfile->sym_cu[gdb::thread_pool::id()] != nullptr)
+ return per_objfile->sym_cu[gdb::thread_pool::id()]->m_builder.get ();
gdb_assert_not_reached ("");
}
cu->start_compunit_symtab (fnd.get_name (), fnd.intern_comp_dir (objfile),
lowpc);
- gdb_assert (per_objfile->sym_cu == nullptr);
+ gdb_assert (per_objfile->sym_cu[gdb::thread_pool::id()] == nullptr);
scoped_restore restore_sym_cu
- = make_scoped_restore (&per_objfile->sym_cu, cu);
+ = make_scoped_restore (&per_objfile->sym_cu[gdb::thread_pool::id()], cu);
/* Decode line number information if present. We do this before
processing child DIEs, so that the line header table is available
child_die = child_die->sibling;
}
}
- per_objfile->sym_cu = nullptr;
+
+ per_objfile->sym_cu[gdb::thread_pool::id()] = nullptr;
/* Decode macro information, if present. Dwarf 2 macro information
refers to information in the line number info statement program
{
dwarf2_per_objfile (struct objfile *objfile, dwarf2_per_bfd *per_bfd)
: objfile (objfile), per_bfd (per_bfd)
- {}
+ {
+ for (int i = 0;
+ i < gdb::thread_pool::g_thread_pool->thread_count () + 1;
+ ++i)
+ sym_cu.push_back (nullptr);
+ }
~dwarf2_per_objfile ();
htab_up line_header_hash;
/* The CU containing the m_builder in scope. */
- dwarf2_cu *sym_cu = nullptr;
+ std::vector<dwarf2_cu *> sym_cu;
/* CUs that are queued to be read. */
gdb::optional<std::deque<dwarf2_queue_item>> queue;