Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Use symbol search name in expand_symtabs_matching_via_partial...
Date: Wed, 14 Dec 2011 00:18:00 -0000	[thread overview]
Message-ID: <20111213222709.GS21915@adacore.com> (raw)
In-Reply-To: <20111213212945.GA10242@host2.jankratochvil.net>

> Please update also the comment for expand_symtabs_matching in symfile.h .
> OK with me, unless Tom has comments.

Here is the latest version. Will wait for Tom's comments...

Thanks,
-- 
Joel

commit 3bd5c92a7f98feac47612559b60b64fae4e699d5
Author: Joel Brobecker <brobecker@adacore.com>
Date:   Tue Dec 13 15:24:53 2011 -0500

    Use symbol search name in expand_symtabs_matching_via_partial...
    
    We are iterating over all symbols in a partial symtab that would
    match a given name, so we should match the partial symbols
    search name against the given name rather than using the natural
    name.  In C++, that does not make a difference, but it does in
    Ada, because Ada searches using the symbol encoded name...
    
    We also update the generation of the .gdb_index file to match this
    change in the search. Although technically an incompatible change,
    we do not increment the gdb_index version number, because Ada is
    the only language where it would make a difference - except that
    this feature is not supported for Ada.
    
    gdb/ChangeLog:
    
            * psymtab.c (expand_symtabs_matching_via_partial): Match
            the partial symbols using their SYMBOL_SEARCH_NAME.
            * symfile.h (struct quick_symbol_functions): Udate the
            documentation of expand_symtabs_matching.
            * dwarf2read.c (write_psymbols): Use SYMBOL_SEARCH_NAME instead
            of SYMBOL_NATURAL_NAME in index entry.

diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 74185cc..861b302 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1305,7 +1305,7 @@ expand_symtabs_matching_via_partial
 		   || (kind == TYPES_DOMAIN
 		       && SYMBOL_CLASS (*psym) == LOC_TYPEDEF))
 		  && (*name_matcher) (current_language,
-				      SYMBOL_NATURAL_NAME (*psym), data))
+				      SYMBOL_SEARCH_NAME (*psym), data))
 		{
 		  PSYMTAB_TO_SYMTAB (ps);
 		  keep_going = 0;
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 44f0c01..91605a2 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -263,10 +263,9 @@ struct quick_symbol_functions
      
      If even KIND matches, then NAME_MATCHER is called for each symbol
      defined in the file.  The current language, the symbol name and
-     DATA are passed to NAME_MATCHER.  The symbol "natural" name should
-     be passed to NAME_MATCHER for all languages except Ada, where
-     the encoded name is passed instead (see la_symbol_name_compare in
-     struct language_defn for more details on this).
+     DATA are passed to NAME_MATCHER.  The symbol "search" name should
+     be passed to NAME_MATCHER (see la_symbol_name_compare in struct
+     language_defn for more details on this).
 
      If NAME_MATCHER returns zero, then this symbol is skipped.
 
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index c482c43..7905052 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -16890,7 +16890,7 @@ write_psymbols (struct mapped_symtab *symtab,
       if (!*slot)
 	{
 	  *slot = lookup;
-	  add_index_entry (symtab, SYMBOL_NATURAL_NAME (*psymp), cu_index);
+	  add_index_entry (symtab, SYMBOL_SEARCH_NAME (*psymp), cu_index);
 	}
     }
 }


  reply	other threads:[~2011-12-13 22:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 20:45 Joel Brobecker
2011-12-13 21:10 ` Jan Kratochvil
2011-12-13 21:30   ` Joel Brobecker
2011-12-13 21:33     ` Jan Kratochvil
2011-12-14  0:18       ` Joel Brobecker [this message]
2011-12-21  9:30         ` Joel Brobecker
2011-12-20 15:03       ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111213222709.GS21915@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox