static void load_full_comp_unit (dwarf2_per_cu_data *per_cu,
dwarf2_per_objfile *per_objfile,
+ dwarf2_cu *existing_cu,
bool skip_partial,
enum language pretend_language);
if (per_cu->is_debug_types)
load_full_type_unit (per_cu, per_objfile);
else
- load_full_comp_unit (per_cu, per_objfile, skip_partial, language_minimal);
+ load_full_comp_unit (per_cu, per_objfile, per_objfile->get_cu (per_cu),
+ skip_partial, language_minimal);
dwarf2_cu *cu = per_objfile->get_cu (per_cu);
if (cu == nullptr)
return die_lhs->sect_off == die_rhs->sect_off;
}
-/* Load the DIEs associated with PER_CU into memory. */
+/* Load the DIEs associated with PER_CU into memory.
+
+ In some cases, the caller, while reading partial symbols, will need to load
+ the full symbols for the CU for some reason. It will already have a
+ dwarf2_cu object for THIS_CU and pass it as EXISTING_CU, so it can be re-used
+ rather than creating a new one. */
static void
load_full_comp_unit (dwarf2_per_cu_data *this_cu,
dwarf2_per_objfile *per_objfile,
+ dwarf2_cu *existing_cu,
bool skip_partial,
enum language pretend_language)
{
gdb_assert (! this_cu->is_debug_types);
- dwarf2_cu *existing_cu = per_objfile->get_cu (this_cu);
cutu_reader reader (this_cu, per_objfile, NULL, existing_cu, skip_partial);
if (reader.dummy_p)
return;
/* If necessary, add it to the queue and load its DIEs. */
if (maybe_queue_comp_unit (cu, per_cu, per_objfile, cu->language))
- load_full_comp_unit (per_cu, per_objfile, false, cu->language);
+ load_full_comp_unit (per_cu, per_objfile, per_objfile->get_cu (per_cu),
+ false, cu->language);
cu->per_cu->imported_symtabs_push (per_cu);
}
/* If necessary, add it to the queue and load its DIEs. */
if (maybe_queue_comp_unit (cu, per_cu, per_objfile, cu->language))
- load_full_comp_unit (per_cu, per_objfile, false, cu->language);
+ load_full_comp_unit (per_cu, per_objfile, per_objfile->get_cu (per_cu),
+ false, cu->language);
target_cu = per_objfile->get_cu (per_cu);
}
{
/* We're loading full DIEs during partial symbol reading. */
gdb_assert (per_objfile->per_bfd->reading_partial_symbols);
- load_full_comp_unit (cu->per_cu, per_objfile, false, language_minimal);
+ load_full_comp_unit (cu->per_cu, per_objfile, cu, false,
+ language_minimal);
}
*ref_cu = target_cu;