public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix regression in c-linkage-name.exp with gdb index
@ 2022-10-17 16:10 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-10-17 16:10 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=67e83a0deef78e9e286b663efd5a7144f09dbb95

commit 67e83a0deef78e9e286b663efd5a7144f09dbb95
Author: Tom Tromey <tromey@adacore.com>
Date:   Fri Oct 14 07:10:08 2022 -0600

    Fix regression in c-linkage-name.exp with gdb index
    
    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,
 
   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) != 0)
+      if (entry->per_cu->lang () == language_cplus
+	  && (entry->flags & IS_LINKAGE) != 0)
 	continue;
 
       const auto it = cu_index_htab.find (entry->per_cu);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-17 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 16:10 [binutils-gdb] Fix regression in c-linkage-name.exp with gdb index Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).