dwarf2_per_cu_data_up
dwarf2_per_bfd::allocate_per_cu ()
{
- dwarf2_per_cu_data_up result (new dwarf2_per_cu_data);
- result->per_bfd = this;
+ dwarf2_per_cu_data_up result (new dwarf2_per_cu_data (this));
result->index = all_units.size ();
return result;
}
signatured_type_up
dwarf2_per_bfd::allocate_signatured_type (ULONGEST signature)
{
- signatured_type_up result (new signatured_type (signature));
- result->per_bfd = this;
+ signatured_type_up result (new signatured_type (this, signature));
result->index = all_units.size ();
result->is_debug_types = true;
tu_stats.nr_tus++;
sig_entry->sect_off = dwo_entry->sect_off;
sig_entry->set_length (dwo_entry->length, false);
sig_entry->reading_dwo_directly = 1;
- sig_entry->per_bfd = per_bfd;
sig_entry->type_offset_in_tu = dwo_entry->type_offset_in_tu;
sig_entry->dwo_unit = dwo_entry;
}
the TU has an entry in .gdb_index, replace the recorded data from
.gdb_index with this TU. */
- signatured_type find_sig_entry (sig);
+ signatured_type find_sig_entry (nullptr, sig);
slot = htab_find_slot (per_bfd->signatured_types.get (), &find_sig_entry,
INSERT);
signatured_type *sig_entry = (struct signatured_type *) *slot;
if (per_bfd->signatured_types == NULL)
per_bfd->signatured_types = allocate_signatured_type_table ();
- signatured_type find_sig_entry (sig);
+ signatured_type find_sig_entry (nullptr, sig);
slot = htab_find_slot (per_bfd->signatured_types.get (), &find_sig_entry,
INSERT);
signatured_type *sig_entry = (struct signatured_type *) *slot;
{
if (per_objfile->per_bfd->signatured_types == NULL)
return NULL;
- signatured_type find_entry (sig);
+ signatured_type find_entry (nullptr, sig);
return ((struct signatured_type *)
htab_find (per_objfile->per_bfd->signatured_types.get (),
&find_entry));
if (per_bfd->signatured_types == NULL)
per_bfd->signatured_types = allocate_signatured_type_table ();
- signatured_type find_entry (dwo_unit->signature);
+ signatured_type find_entry (nullptr, dwo_unit->signature);
slot = htab_find_slot (per_bfd->signatured_types.get (), &find_entry, INSERT);
/* If we've already seen this type there's nothing to do. What's happening
end_ptr = info_ptr + section.size;
while (info_ptr < end_ptr)
{
- struct dwarf2_per_cu_data per_cu;
struct dwo_unit read_unit {};
struct dwo_unit *dwo_unit;
void **slot;
sect_offset sect_off = (sect_offset) (info_ptr - section.buffer);
- per_cu.per_bfd = per_bfd;
+ dwarf2_per_cu_data per_cu (per_bfd);
per_cu.is_debug_types = 0;
per_cu.sect_off = sect_offset (info_ptr - section.buffer);
per_cu.section = §ion;
static void
run_test ()
{
- dwarf2_per_cu_data_up one (new dwarf2_per_cu_data);
+ dwarf2_per_cu_data_up one (new dwarf2_per_cu_data (nullptr));
dwarf2_per_cu_data *one_ptr = one.get ();
- dwarf2_per_cu_data_up two (new dwarf2_per_cu_data);
+ dwarf2_per_cu_data_up two (new dwarf2_per_cu_data (nullptr));
dwarf2_per_cu_data *two_ptr = two.get ();
- dwarf2_per_cu_data_up three (new dwarf2_per_cu_data);
+ dwarf2_per_cu_data_up three (new dwarf2_per_cu_data (nullptr));
dwarf2_per_cu_data *three_ptr = three.get ();
- dwarf2_per_cu_data_up four (new dwarf2_per_cu_data);
+ dwarf2_per_cu_data_up four (new dwarf2_per_cu_data (nullptr));
dwarf2_per_cu_data *four_ptr = four.get ();
one->set_length (5);
struct dwarf2_per_cu_data
{
- dwarf2_per_cu_data ()
+ dwarf2_per_cu_data (dwarf2_per_bfd *per_bfd)
: is_debug_types (false),
is_dwz (false),
reading_dwo_directly (false),
m_header_read_in (false),
mark (false),
files_read (false),
- scanned (false)
+ scanned (false),
+ per_bfd (per_bfd)
{
}
struct dwarf2_section_info *section = nullptr;
/* Backlink to the owner of this. */
- dwarf2_per_bfd *per_bfd = nullptr;
+ dwarf2_per_bfd *per_bfd;
/* DWARF header of this CU. Note that dwarf2_cu reads its own version of the
header, which may differ from this one, since it may pass rcuh_kind::TYPE
struct signatured_type : public dwarf2_per_cu_data
{
- signatured_type (ULONGEST signature)
- : signature (signature)
+ signatured_type (dwarf2_per_bfd *per_bfd, ULONGEST signature)
+ : dwarf2_per_cu_data (per_bfd),
+ signature (signature)
{}
/* The type's signature. */