From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 3B1493858D32; Mon, 17 Oct 2022 16:10:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B1493858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666023050; bh=EVXihas3j98MAJb5+Tl2Ls+D3ZSWl0BG7FbrF+GA5HI=; h=From:To:Subject:Date:From; b=fpypkTy7h63uS/JJkhwEU9copH7ksTqQsKazZVEkw7WXqqDtG49e+cEw7YhXaK4sA BCagBvFcRwkWWIH4/hMA5p7qyu1e8NcsF/88Prn7OR9wASNYseUSlqdMGH6Q9TYzNK +iz/DsnWPAAhIZXmKIl/Yuzihrw28rQvOwliHrOU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Fix regression in c-linkage-name.exp with gdb index X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: c7f83b0d14e38e4c3f169b4fc538491782e7d915 X-Git-Newrev: 67e83a0deef78e9e286b663efd5a7144f09dbb95 Message-Id: <20221017161050.3B1493858D32@sourceware.org> Date: Mon, 17 Oct 2022 16:10:50 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D67e83a0deef7= 8e9e286b663efd5a7144f09dbb95 commit 67e83a0deef78e9e286b663efd5a7144f09dbb95 Author: Tom Tromey Date: Fri Oct 14 07:10:08 2022 -0600 Fix regression in c-linkage-name.exp with gdb index =20 c-linkage-name.exp started failing with the gdb-index target board due to an earlier patch. The problem here is that some linkage names must be in the index -- but, based on inspection, not C++ linkage names. This patch updates the code to exclude only these. Diff: --- gdb/dwarf2/index-write.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index 4827b594994..4f89dfb65f7 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -1111,12 +1111,13 @@ write_cooked_index (cooked_index_vector *table, =20 for (const cooked_index_entry *entry : table->all_entries ()) { - /* GDB never put linkage names into .gdb_index. The theory here - is that a linkage name will normally be in the minimal + /* GDB never put C++ linkage names into .gdb_index. The theory + here is that a linkage name will normally be in the minimal symbols anyway, so including it in the index is usually redundant -- and the cases where it would not be redundant are rare and not worth supporting. */ - if ((entry->flags & IS_LINKAGE) !=3D 0) + if (entry->per_cu->lang () =3D=3D language_cplus + && (entry->flags & IS_LINKAGE) !=3D 0) continue; =20 const auto it =3D cu_index_htab.find (entry->per_cu);