[05/28] Fix index's handling of DW_TAG_imported_declaration
Commit Message
Currently the full symbol reader puts DW_TAG_imported_declaration in
TYPE_DOMAIN, in the global scope. This patch changes the cooked
indexer to follow.
Without this patch, a later patch in the series would cause
nsalias.exp to regress.
This also updates read-gdb-index.c to do something similar.
---
gdb/dwarf2/cooked-indexer.c | 5 +++++
gdb/dwarf2/read-gdb-index.c | 2 +-
gdb/dwarf2/tag.h | 4 ++++
3 files changed, 10 insertions(+), 1 deletion(-)
@@ -551,6 +551,11 @@ cooked_indexer::index_dies (cutu_reader *reader,
flags &= ~IS_STATIC;
flags |= parent_entry->flags & IS_STATIC;
}
+ else if (abbrev->tag == DW_TAG_imported_declaration)
+ {
+ /* Match the full reader. */
+ flags &= ~IS_STATIC;
+ }
if (abbrev->tag == DW_TAG_namespace
&& m_language == language_cplus
@@ -1098,7 +1098,7 @@ dw2_expand_marked_cus (dwarf2_per_objfile *per_objfile, offset_type idx,
mask = SEARCH_TYPE_DOMAIN | SEARCH_STRUCT_DOMAIN;
break;
case GDB_INDEX_SYMBOL_KIND_OTHER:
- mask = SEARCH_MODULE_DOMAIN;
+ mask = SEARCH_MODULE_DOMAIN | SEARCH_TYPE_DOMAIN;
break;
}
if ((kind & mask) == 0)
@@ -102,6 +102,10 @@ tag_matches_domain (dwarf_tag tag, domain_search_flags search, language lang)
}
break;
+ case DW_TAG_imported_declaration:
+ /* DW_TAG_imported_declaration isn't necessarily a type, but the
+ scanner doesn't track the referent, and the full reader
+ also currently puts it in TYPE_DOMAIN. */
case DW_TAG_padding:
case DW_TAG_array_type:
case DW_TAG_pointer_type: