unrelocated_addr best_lowpc = {}, best_highpc = {};
/* Possibly set the default values of LOWPC and HIGHPC from
`DW_AT_ranges'. */
- dwarf2_find_base_address (reader->comp_unit_die (), cu);
+ dwarf2_find_base_address (reader->top_level_die (), cu);
enum pc_bounds_kind cu_bounds_kind
- = dwarf2_get_pc_bounds (reader->comp_unit_die (), &best_lowpc, &best_highpc,
+ = dwarf2_get_pc_bounds (reader->top_level_die (), &best_lowpc, &best_highpc,
cu, m_index_storage->get_addrmap (), cu->per_cu);
if (cu_bounds_kind == PC_BOUNDS_HIGH_LOW && best_lowpc < best_highpc)
{
language_minimal,
&m_index_storage->get_abbrev_table_cache ());
- if (new_reader.is_dummy () || new_reader.comp_unit_die () == nullptr
- || !new_reader.comp_unit_die ()->has_children)
+ if (new_reader.is_dummy () || new_reader.top_level_die () == nullptr
+ || !new_reader.top_level_die ()->has_children)
return nullptr;
auto copy = std::make_unique<cutu_reader> (std::move (new_reader));
result = m_index_storage->preserve (std::move (copy));
}
- if (result->is_dummy () || result->comp_unit_die () == nullptr
- || !result->comp_unit_die ()->has_children)
+ if (result->is_dummy () || result->top_level_die () == nullptr
+ || !result->top_level_die ()->has_children)
return nullptr;
if (for_scanning)
cooked_indexer::make_index (cutu_reader *reader)
{
check_bounds (reader);
- find_file_and_directory (reader->comp_unit_die (), reader->cu ());
+ find_file_and_directory (reader->top_level_die (), reader->cu ());
- if (!reader->comp_unit_die ()->has_children)
+ if (!reader->top_level_die ()->has_children)
return;
index_dies (reader, reader->info_ptr (), nullptr, false);
per_objfile->get_cu (this_cu), true, language_minimal,
nullptr);
if (!reader.is_dummy ())
- dw2_get_file_names_reader (reader.cu (), reader.comp_unit_die ());
+ dw2_get_file_names_reader (reader.cu (), reader.top_level_die ());
return this_cu->file_names;
}
attribute of the referencing CU. At most one of STUB_COMP_UNIT_DIE and
STUB_COMP_DIR may be non-NULL.
- *RESULT_READER,*RESULT_INFO_PTR,*RESULT_COMP_UNIT_DIE
+ *RESULT_READER,*RESULT_INFO_PTR,*RESULT_TOP_LEVEL_DIE
are filled in with the info of the DIE from the DWO file.
*RESULT_DWO_ABBREV_TABLE will be filled in with the abbrev table allocated
die_info *stub_comp_unit_die,
const char *stub_comp_dir,
const gdb_byte **result_info_ptr,
- die_info **result_comp_unit_die,
+ die_info **result_top_level_die,
abbrev_table_up *result_dwo_abbrev_table)
{
dwarf2_per_objfile *per_objfile = cu->per_objfile;
has the benefit of simplifying the rest of the code - all the
work to maintain the illusion of a single
DW_TAG_{compile,type}_unit DIE is done here. */
- info_ptr = this->read_toplevel_die (result_comp_unit_die, info_ptr,
+ info_ptr = this->read_toplevel_die (result_top_level_die, info_ptr,
gdb::make_array_view (attributes,
next_attr_idx));
if (read_cutu_die_from_dwo (cu, sig_type->dwo_unit,
NULL /* stub_comp_unit_die */,
sig_type->dwo_unit->dwo_file->comp_dir,
- &m_info_ptr, &m_comp_unit_die,
+ &m_info_ptr, &m_top_level_die,
&m_dwo_abbrev_table)
== 0)
{
/* Read the top level CU/TU die. */
this->init_cu_die_reader (cu, section, NULL, abbrev_table);
- m_info_ptr = this->read_toplevel_die (&m_comp_unit_die, m_info_ptr);
+ m_info_ptr = this->read_toplevel_die (&m_top_level_die, m_info_ptr);
- if (skip_partial && m_comp_unit_die->tag == DW_TAG_partial_unit)
+ if (skip_partial && m_top_level_die->tag == DW_TAG_partial_unit)
m_dummy_p = true;
else
{
Note that if USE_EXISTING_OK != 0, and THIS_CU->cu
already contains a DWO CU, that this test will fail (the
attribute will not be present). */
- const char *dwo_name = dwarf2_dwo_name (m_comp_unit_die, cu);
+ const char *dwo_name = dwarf2_dwo_name (m_top_level_die, cu);
if (dwo_name != nullptr)
{
struct dwo_unit *dwo_unit;
struct die_info *dwo_comp_unit_die;
- if (m_comp_unit_die->has_children)
+ if (m_top_level_die->has_children)
{
complaint (_("compilation unit with DW_AT_GNU_dwo_name"
" has children (offset %s) [in module %s]"),
sect_offset_str (this_cu->sect_off),
bfd_get_filename (abfd));
}
- dwo_unit = lookup_dwo_unit (cu, m_comp_unit_die, dwo_name);
+ dwo_unit = lookup_dwo_unit (cu, m_top_level_die, dwo_name);
if (dwo_unit != NULL)
{
- if (read_cutu_die_from_dwo (cu, dwo_unit, m_comp_unit_die,
+ if (read_cutu_die_from_dwo (cu, dwo_unit, m_top_level_die,
nullptr, &m_info_ptr,
&dwo_comp_unit_die,
&m_dwo_abbrev_table)
m_dummy_p = true;
}
else
- m_comp_unit_die = dwo_comp_unit_die;
+ m_top_level_die = dwo_comp_unit_die;
}
else
{
}
/* Only a dummy unit can be missing the compunit DIE. */
- gdb_assert (m_dummy_p || m_comp_unit_die != nullptr);
+ gdb_assert (m_dummy_p || m_top_level_die != nullptr);
prepare_one_comp_unit (cu, pretend_language);
}
this->init_cu_die_reader (m_new_cu.get (), section, dwo_file,
m_abbrev_table_holder.get ());
- info_ptr = this->read_toplevel_die (&m_comp_unit_die, info_ptr);
+ info_ptr = this->read_toplevel_die (&m_top_level_die, info_ptr);
}
prepare_one_comp_unit (m_new_cu.get (), pretend_language);
reader = storage->preserve (std::move (copy));
}
- if (reader->comp_unit_die () == nullptr || reader->is_dummy ())
+ if (reader->top_level_die () == nullptr || reader->is_dummy ())
return;
if (this_cu->is_debug_types)
build_type_psymtabs_reader (reader, storage);
- else if (reader->comp_unit_die ()->tag != DW_TAG_partial_unit)
+ else if (reader->top_level_die ()->tag != DW_TAG_partial_unit)
{
bool nope = false;
if (this_cu->scanned.compare_exchange_strong (nope, true))
{
struct dwarf2_cu *cu = reader->cu ();
dwarf2_per_cu *per_cu = cu->per_cu;
- die_info *type_unit_die = reader->comp_unit_die ();
+ die_info *type_unit_die = reader->top_level_die ();
gdb_assert (per_cu->is_debug_types);
gdb_assert (cu->die_hash.empty ());
cu->die_hash.reserve (cu->header.get_length_without_initial () / 12);
- if (reader.comp_unit_die ()->has_children)
- reader.comp_unit_die ()->child
+ if (reader.top_level_die ()->has_children)
+ reader.top_level_die ()->child
= reader.read_die_and_siblings (reader.info_ptr (), &info_ptr,
- reader.comp_unit_die ());
- cu->dies = reader.comp_unit_die ();
+ reader.top_level_die ());
+ cu->dies = reader.top_level_die ();
/* comp_unit_die is not stored in die_hash, no need. */
reader.keep ();
if (!reader.is_dummy ())
create_dwo_cu_reader (reader.cu (), reader.info_ptr (),
- reader.comp_unit_die (), &dwo_file, &read_unit);
+ reader.top_level_die (), &dwo_file, &read_unit);
info_ptr += per_cu.length ();
/* If the unit could not be parsed, skip it. */
gdb_assert (cu->die_hash.empty ());
cu->die_hash.reserve (cu->header.get_length_without_initial () / 12);
- if (reader.comp_unit_die ()->has_children)
- reader.comp_unit_die ()->child
+ if (reader.top_level_die ()->has_children)
+ reader.top_level_die ()->child
= reader.read_die_and_siblings (info_ptr, &info_ptr,
- reader.comp_unit_die ());
- cu->dies = reader.comp_unit_die ();
+ reader.top_level_die ());
+ cu->dies = reader.top_level_die ();
/* comp_unit_die is not stored in die_hash, no need. */
reader.keep ();
{
struct attribute *attr;
- if (m_comp_unit_die == nullptr)
+ if (m_top_level_die == nullptr)
{
cu->set_producer (nullptr);
cu->language_defn = language_def (pretend_language);
return;
}
- cu->set_producer (dwarf2_string_attr (m_comp_unit_die, DW_AT_producer, cu));
+ cu->set_producer (dwarf2_string_attr (m_top_level_die, DW_AT_producer, cu));
/* Set the language we're debugging. */
- attr = dwarf2_attr (m_comp_unit_die, DW_AT_language, cu);
+ attr = dwarf2_attr (m_top_level_die, DW_AT_language, cu);
enum language lang;
dwarf_source_language dw_lang = (dwarf_source_language) 0;
if (cu->producer_is_xlc_opencl ())
cu->language_defn = language_def (lang);
/* Initialize the lto_artificial field. */
- attr = dwarf2_attr (m_comp_unit_die, DW_AT_name, cu);
+ attr = dwarf2_attr (m_top_level_die, DW_AT_name, cu);
if (attr != nullptr
&& cu->producer_is_gcc ()
&& attr->as_string () != nullptr
&& strcmp (attr->as_string (), "<artificial>") == 0)
cu->per_cu->lto_artificial = true;
- switch (m_comp_unit_die->tag)
+ switch (m_top_level_die->tag)
{
case DW_TAG_compile_unit:
cu->per_cu->set_unit_type (DW_UT_compile);
break;
default:
error (_(DWARF_ERROR_PREFIX "unexpected tag '%s' at offset %s"),
- dwarf_tag_name (m_comp_unit_die->tag),
+ dwarf_tag_name (m_top_level_die->tag),
sect_offset_str (cu->per_cu->sect_off));
}