This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Fix c++/16253 (tag/variable name collision)


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]