gdb::unique_xmalloc_ptr<char> new_name
= make_unique_xstrndup (name.data (), name.length ());
last = create (entry->die_offset, DW_TAG_module,
- 0, language_ada, new_name.get (), parent,
+ IS_SYNTHESIZED, language_ada, new_name.get (), parent,
entry->per_cu);
last->canonical = last->name;
m_names.push_back (std::move (new_name));
/* True is parent_entry.deferred has a value rather than parent_entry
.resolved. */
IS_PARENT_DEFERRED = 16,
+ /* True if this entry was synthesized by gdb (as opposed to coming
+ directly from the DWARF). */
+ IS_SYNTHESIZED = 32,
};
DEF_ENUM_FLAGS_TYPE (enum cooked_index_flag_enum, cooked_index_flag);
/* Insert one symbol. */
void insert (const cooked_index_entry *entry)
{
- /* These entries are synthesized by the reader, and so should not
- be written. */
- if (entry->lang == language_ada && entry->tag == DW_TAG_module)
+ /* Synthesized entries should not be written. */
+ if ((entry->flags & IS_SYNTHESIZED) != 0)
return;
m_name_to_value_set[entry->name].emplace_back (entry);
unit_kind kind = (entry->per_cu->is_debug_types
? unit_kind::tu
: unit_kind::cu);
- /* Currently Ada parentage is synthesized by the
- reader and so must be ignored here. */
- const cooked_index_entry *parent = (entry->lang == language_ada
- ? nullptr
- : entry->get_parent ());
+ /* Some Ada parentage is synthesized by the reader and so
+ must be ignored here. */
+ const cooked_index_entry *parent = entry->get_parent ();
+ if (parent != nullptr && (parent->flags & IS_SYNTHESIZED) != 0)
+ parent = nullptr;
int &idx = m_indexkey_to_idx[index_key (entry->tag,
kind,