This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix c++/16253 (tag/variable name collision)
- From: Keith Seitz <keiths at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: "gp >> \"gdb-patches at sourceware dot org ml\"" <gdb-patches at sourceware dot org>
- Date: Tue, 25 Mar 2014 10:21:17 -0700
- Subject: Re: [RFA] Fix c++/16253 (tag/variable name collision)
- Authentication-results: sourceware.org; auth=none
- References: <532C810F dot 7010809 at redhat dot com> <20140324141527 dot GM4282 at adacore dot com>
On 03/24/2014 07:15 AM, Joel Brobecker wrote:
This may not be directly related to your patch. I seem to have seen
some unexplainable behavior in GDB occasionally in the recent past
making me wonder whether there might be something fishy in the symbol
lookup for Ada.
It is my patch that is causing the problems.
In this case, add_nonlocal_symbols is calling the qf
map_matching_symbols method which is calling match_partial_symbol. Since
this method now does strict matches against domain, an explicit check
for STRUCT_DOMAIN matches must be added.
Give this amendment a shot and see how it goes. I suspect there are
probably one or two more places where this occurs. [The easiest thing to
do is audit any function which uses "VAR_DOMAIN".]
Keith
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 00728bf..94c6cf8 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -5336,13 +5336,33 @@ add_nonlocal_symbols (struct obstack *obstackp, const char *name,
data.objfile = objfile;
if (is_wild_match)
- objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
- aux_add_nonlocal_symbols, &data,
- wild_match, NULL);
+ {
+ objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
+ aux_add_nonlocal_symbols,
+ &data, wild_match, NULL);
+ if (domain == VAR_DOMAIN)
+ {
+ objfile->sf->qf->map_matching_symbols (objfile, name,
+ STRUCT_DOMAIN, global,
+ aux_add_nonlocal_symbols,
+ &data, wild_match, NULL);
+ }
+ }
else
- objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
- aux_add_nonlocal_symbols, &data,
- full_match, compare_names);
+ {
+ objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
+ aux_add_nonlocal_symbols,
+ &data, full_match,
+ compare_names);
+ if (domain == VAR_DOMAIN)
+ {
+ objfile->sf->qf->map_matching_symbols (objfile, name,
+ STRUCT_DOMAIN, global,
+ aux_add_nonlocal_symbols,
+ &data, full_match,
+ compare_names);
+ }
+ }
}
if (num_defns_collected (obstackp) == 0 && global && !is_wild_match)