From: Tom Tromey Date: Sun, 8 Feb 2026 21:39:50 +0000 (-0700) Subject: Fix Ada failure with gdb-index X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28e4086daa9754952f95b5ddc166b37d0a094fc3;p=thirdparty%2Fbinutils-gdb.git Fix Ada failure with gdb-index The gdb index reader rewrite (commit 486bc5ac) broke a couple of Ada test cases. I didn't notice these at the time because they require libgnat debuginfo to be installed. This patch fixes the problem. The issue here is that the Ada code sometimes requires types to have "linkage name" entries. This is required because these lookups are done using the verbatim ("<...>") notation, which won't match the split names in the index. Removing the need for this is on my wish-list, see PR ada/32142; but I have not gotten around to figuring this one out yet. In the meantime, having the gdb-index reader create synthetic linkage name entries for types fixes the bug. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33443 --- diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c index 2d204737bd2..06fea0ea751 100644 --- a/gdb/dwarf2/read-gdb-index.c +++ b/gdb/dwarf2/read-gdb-index.c @@ -323,6 +323,13 @@ mapped_gdb_index::build_name_components (dwarf2_per_objfile *per_objfile) main_name = nullptr; } + if (this_lang == language_ada + && symbol_kind == GDB_INDEX_SYMBOL_KIND_TYPE) + result.add (per_cu->sect_off (), tag, + flags | IS_LINKAGE | IS_SYNTHESIZED, this_lang, + components.back ().data (), + nullptr, per_cu); + /* Note that this assumes the final component ends in \0. */ cooked_index_entry *entry = result.add (per_cu->sect_off (), tag, flags, this_lang,