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: Joel Brobecker <brobecker at adacore dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gp >> \"gdb-patches at sourceware dot org ml\"" <gdb-patches at sourceware dot org>
- Date: Wed, 26 Mar 2014 06:32:02 -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> <5331BB0D dot 4010606 at redhat dot com>
> 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".]
I was thinking of the very same patch :), and it tested fine.
Can you remove the curly braces in the second call? They should
be unnecessary in this case, and our CS asks us to avoid them
in that situation (the only exception is when the body also
contains a comment).
Thanks!
> + {
> + 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)
--
Joel