aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2025-01-19 16:53:33 -0700
committerTom Tromey <tom@tromey.com>2025-09-10 16:05:27 -0600
commit53e6563141335737904685f7dac9ea0618c36319 (patch)
treef956838e01b656a5f925a7db6dc0f57540f23586
parenta7343246f5319e67e7e96ba98596c94cda115560 (diff)
downloadbinutils-53e6563141335737904685f7dac9ea0618c36319.zip
binutils-53e6563141335737904685f7dac9ea0618c36319.tar.gz
binutils-53e6563141335737904685f7dac9ea0618c36319.tar.bz2
Fix index's handling of DW_TAG_imported_declaration
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. Acked-By: Simon Marchi <simon.marchi@efficios.com>
-rw-r--r--gdb/dwarf2/cooked-indexer.c5
-rw-r--r--gdb/dwarf2/read-gdb-index.c2
-rw-r--r--gdb/dwarf2/tag.h4
3 files changed, 10 insertions, 1 deletions
diff --git a/gdb/dwarf2/cooked-indexer.c b/gdb/dwarf2/cooked-indexer.c
index ef88325..31344d7 100644
--- a/gdb/dwarf2/cooked-indexer.c
+++ b/gdb/dwarf2/cooked-indexer.c
@@ -544,6 +544,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
diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
index 070239a..beeaa40 100644
--- a/gdb/dwarf2/read-gdb-index.c
+++ b/gdb/dwarf2/read-gdb-index.c
@@ -1100,7 +1100,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)
diff --git a/gdb/dwarf2/tag.h b/gdb/dwarf2/tag.h
index ed730c0..a70fca0 100644
--- a/gdb/dwarf2/tag.h
+++ b/gdb/dwarf2/tag.h
@@ -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: