public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA 3/3] Remove language param from name_matcher in struct quick_symbol_functions
Date: Thu, 12 Jan 2012 04:30:00 -0000	[thread overview]
Message-ID: <20120112031239.GL31383@adacore.com> (raw)
In-Reply-To: <1324636693-24034-4-git-send-email-brobecker@adacore.com>

On Fri, Dec 23, 2011 at 02:38:13PM +0400, Joel Brobecker wrote:
> And lastly, a little cleanup.
> 
> The quick_symbol_functions struct contains a field which is pointer
> a function which takes another function, called name_matcher, as
> its parameter.  This name_matcher currently has 3 arguments, one
> of them being the language. This parameter is no longer used, and
> thus deleted.
> 
> gdb/ChangeLog:
> 
>         * symfile.h (struct quick_symbol_functions) [expand_symtabs_matching]:
>         Remove language parameter from name_matcher.  Adjust the comment.
>         * symtab.c (search_symbols_name_matches, expand_partial_symbol_name):
>         Remove language parameter.
>         * ada-lang.c (ada_expand_partial_symbol_name): Likewise.
>         * linespec.c (iterate_name_matcher): Likewise.
>         * dwarf2read.c (dw2_expand_symtabs_matching): Adjust type of
>         name_matcher.  Adjust call accordingly.
>         * psymtab.c (expand_symtabs_matching_via_partial): Likewise.
>         (maintenance_check_symtabs): Adjust type of parameter "fun".
>         * psymtab.h (maintenance_check_symtabs): Likewise.

Ping? I think this one is relatively straightforward if patch #2
of the series is approved.

http://www.sourceware.org/ml/gdb-patches/2011-12/msg00803.html

Thank you!



> 
> Ok to commit?
> Thanks,
> -- 
> Joel
> 
> ---
>  gdb/ada-lang.c   |    3 +--
>  gdb/dwarf2read.c |    4 ++--
>  gdb/linespec.c   |    3 +--
>  gdb/psymtab.c    |    8 +++-----
>  gdb/psymtab.h    |    3 +--
>  gdb/symfile.h    |    6 +++---
>  gdb/symtab.c     |    6 ++----
>  7 files changed, 13 insertions(+), 20 deletions(-)
> 
> diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
> index d871193..d6404c5 100644
> --- a/gdb/ada-lang.c
> +++ b/gdb/ada-lang.c
> @@ -5701,8 +5701,7 @@ struct add_partial_datum
>  
>  /* A callback for expand_partial_symbol_names.  */
>  static int
> -ada_expand_partial_symbol_name (const struct language_defn *language,
> -				const char *name, void *user_data)
> +ada_expand_partial_symbol_name (const char *name, void *user_data)
>  {
>    struct add_partial_datum *data = user_data;
>    
> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
> index 7905052..a4ca584 100644
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
> @@ -2759,7 +2759,7 @@ static void
>  dw2_expand_symtabs_matching
>    (struct objfile *objfile,
>     int (*file_matcher) (const char *, void *),
> -   int (*name_matcher) (const struct language_defn *, const char *, void *),
> +   int (*name_matcher) (const char *, void *),
>     enum search_domain kind,
>     void *data)
>  {
> @@ -2813,7 +2813,7 @@ dw2_expand_symtabs_matching
>  
>        name = index->constant_pool + MAYBE_SWAP (index->symbol_table[idx]);
>  
> -      if (! (*name_matcher) (current_language, name, data))
> +      if (! (*name_matcher) (name, data))
>  	continue;
>  
>        /* The name was matched, now expand corresponding CUs that were
> diff --git a/gdb/linespec.c b/gdb/linespec.c
> index 6f463a4..eefd5d4 100644
> --- a/gdb/linespec.c
> +++ b/gdb/linespec.c
> @@ -338,8 +338,7 @@ struct symbol_matcher_data
>     callback to the expand_symtabs_matching method.  */
>  
>  static int
> -iterate_name_matcher (const struct language_defn *language,
> -		      const char *name, void *d)
> +iterate_name_matcher (const char *name, void *d)
>  {
>    const struct symbol_matcher_data *data = d;
>  
> diff --git a/gdb/psymtab.c b/gdb/psymtab.c
> index 861b302..1ba7436 100644
> --- a/gdb/psymtab.c
> +++ b/gdb/psymtab.c
> @@ -1252,7 +1252,7 @@ static void
>  expand_symtabs_matching_via_partial
>    (struct objfile *objfile,
>     int (*file_matcher) (const char *, void *),
> -   int (*name_matcher) (const struct language_defn *, const char *, void *),
> +   int (*name_matcher) (const char *, void *),
>     enum search_domain kind,
>     void *data)
>  {
> @@ -1304,8 +1304,7 @@ expand_symtabs_matching_via_partial
>  		       && SYMBOL_CLASS (*psym) == LOC_BLOCK)
>  		   || (kind == TYPES_DOMAIN
>  		       && SYMBOL_CLASS (*psym) == LOC_TYPEDEF))
> -		  && (*name_matcher) (current_language,
> -				      SYMBOL_SEARCH_NAME (*psym), data))
> +		  && (*name_matcher) (SYMBOL_SEARCH_NAME (*psym), data))
>  		{
>  		  PSYMTAB_TO_SYMTAB (ps);
>  		  keep_going = 0;
> @@ -1945,8 +1944,7 @@ maintenance_check_symtabs (char *ignore, int from_tty)
>  \f
>  
>  void
> -expand_partial_symbol_names (int (*fun) (const struct language_defn *,
> -					 const char *, void *),
> +expand_partial_symbol_names (int (*fun) (const char *, void *),
>  			     void *data)
>  {
>    struct objfile *objfile;
> diff --git a/gdb/psymtab.h b/gdb/psymtab.h
> index 940b537..de292c5 100644
> --- a/gdb/psymtab.h
> +++ b/gdb/psymtab.h
> @@ -30,8 +30,7 @@ extern struct psymbol_bcache *psymbol_bcache_init (void);
>  extern void psymbol_bcache_free (struct psymbol_bcache *);
>  extern struct bcache *psymbol_bcache_get_bcache (struct psymbol_bcache *);
>  
> -void expand_partial_symbol_names (int (*fun) (const struct language_defn *,
> -					      const char *, void *),
> +void expand_partial_symbol_names (int (*fun) (const char *, void *),
>  				  void *data);
>  
>  void map_partial_symbol_filenames (symbol_filename_ftype *fun, void *data,
> diff --git a/gdb/symfile.h b/gdb/symfile.h
> index ef1ca24..77dddea 100644
> --- a/gdb/symfile.h
> +++ b/gdb/symfile.h
> @@ -262,8 +262,8 @@ struct quick_symbol_functions
>       Otherwise, if KIND does not match this symbol is skipped.
>  
>       If even KIND matches, then NAME_MATCHER is called for each symbol
> -     defined in the file.  The current language, the symbol "search"
> -     name and DATA are passed to NAME_MATCHER.
> +     defined in the file.  The symbol "search" name and DATA are passed
> +     to NAME_MATCHER.
>  
>       If NAME_MATCHER returns zero, then this symbol is skipped.
>  
> @@ -274,7 +274,7 @@ struct quick_symbol_functions
>    void (*expand_symtabs_matching)
>      (struct objfile *objfile,
>       int (*file_matcher) (const char *, void *),
> -     int (*name_matcher) (const struct language_defn *, const char *, void *),
> +     int (*name_matcher) (const char *, void *),
>       enum search_domain kind,
>       void *data);
>  
> diff --git a/gdb/symtab.c b/gdb/symtab.c
> index 1ea4253..cf94c9c 100644
> --- a/gdb/symtab.c
> +++ b/gdb/symtab.c
> @@ -3166,8 +3166,7 @@ search_symbols_file_matches (const char *filename, void *user_data)
>  
>  /* A callback for expand_symtabs_matching.  */
>  static int
> -search_symbols_name_matches (const struct language_defn *language,
> -			     const char *symname, void *user_data)
> +search_symbols_name_matches (const char *symname, void *user_data)
>  {
>    struct search_symbols_data *data = user_data;
>  
> @@ -3975,8 +3974,7 @@ add_macro_name (const char *name, const struct macro_definition *ignore,
>  
>  /* A callback for expand_partial_symbol_names.  */
>  static int
> -expand_partial_symbol_name (const struct language_defn *language,
> -			    const char *name, void *user_data)
> +expand_partial_symbol_name (const char *name, void *user_data)
>  {
>    struct add_name_data *datum = (struct add_name_data *) user_data;
>  
> -- 
> 1.7.1

-- 
Joel

  reply	other threads:[~2012-01-12  3:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14 14:36 [RFC] allow unqualified function names in linespecs Joel Brobecker
2011-12-20 15:24 ` Tom Tromey
2011-12-21 14:08   ` Joel Brobecker
2011-12-23 10:39     ` unqualified function names in linespecs in Ada... (try #2) Joel Brobecker
2011-12-23 10:39     ` [commit/Ada 1/3] New function ada-lang.c:should_use_wild_match Joel Brobecker
2011-12-27  4:27       ` Checked in: " Joel Brobecker
2011-12-23 10:39     ` [RFA 2/3] Ada: allow unqualified function names in linespecs Joel Brobecker
2012-01-12  3:13       ` Joel Brobecker
2012-01-19 15:40       ` Joel Brobecker
2012-01-24 19:41       ` Tom Tromey
2012-01-26  4:23         ` Joel Brobecker
2012-01-26 10:22           ` Crash regression gdb.cp/no-dmgl-verbose.exp: " Jan Kratochvil
2012-01-26 10:55             ` Jan Kratochvil
2012-01-27  5:15             ` Jan Kratochvil
2012-01-27  5:25               ` Joel Brobecker
2012-01-27 17:09                 ` [patch] Fix the 2012-01-26 regression by la_get_symbol_name_match_p [Re: Crash regression gdb.cp/no-dmgl-verbose.exp] Jan Kratochvil
2012-01-27 19:27                   ` Joel Brobecker
2012-01-27 20:33                     ` [commit] " Jan Kratochvil
2011-12-23 11:01     ` [RFA 3/3] Remove language param from name_matcher in struct quick_symbol_functions Joel Brobecker
2012-01-12  4:30       ` Joel Brobecker [this message]
2012-01-19 15:47       ` Joel Brobecker
2012-01-24 19:45       ` Tom Tromey
2012-01-26  4:57         ` Joel Brobecker
2012-01-24 19:17     ` [RFC] allow unqualified function names in linespecs 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=20120112031239.GL31383@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).