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: [patch 1/3] Template Lookup


>>>>> "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


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