This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 1/3] Template Lookup
- From: Tom Tromey <tromey at redhat dot com>
- To: sami wagiaalla <swagiaal at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 18 Aug 2010 15:45:35 -0600
- Subject: Re: [patch 1/3] Template Lookup
- References: <4C446F1C.60507@redhat.com> <4C460A3E.2040004@redhat.com>
>>>>> "Sami" == sami wagiaalla <swagiaal@redhat.com> writes:
Sami> Same patch but using prepare_for_testing
Thanks.
I suspect this doesn't interact properly with psymtabs, because from
what I can tell the template-argument-less symbol is only entered for
full symbols, not partial symbols. This means that a reference to some
function will not work properly until the psymtab is expanded for some
other reason.
Sami> +static struct demangle_component *
Sami> +cp_remove_template_params_component (struct demangle_component *comp)
Sami> +{
Sami> +
Sami> + gdb_assert (comp != NULL);
No need for that blank line.
Sami> +char*
Sami> +symbol_get_cplus_search_name (const struct general_symbol_info *gsymbol)
"char *"
Sami> +extern char* symbol_get_cplus_search_name (const struct general_symbol_info *);
"char *"
Sami> +gdb_test_no_output "set language c++" ""
There are a couple instances of this that have to be updated in light of
Doug's recent change to how this is done.
Sami> @@ -2458,7 +2458,7 @@ find_overload_match (struct type **arg_types, int nargs,
Sami> if (fsym)
Sami> {
Sami> - qualified_name = SYMBOL_NATURAL_NAME (fsym);
Sami> + qualified_name = SYMBOL_SEARCH_NAME (fsym);
It took me a while to understand why this could be work.
It seems to me that it is not completely right though. Consider this case:
template<int X> int f (int x) { return x + X; }
int compute (int x) { return f<5> (x) + f<7> (x); }
In this situation you can't just look at overloads of "f" -- it is
ambiguous. You have to do more analysis.
Tom