[rfa] generate symbols associated to namespaces
Elena Zannoni
ezannoni@redhat.com
Tue Sep 9 22:17:00 GMT 2003
David Carlton writes:
> On Tue, 9 Sep 2003 15:51:37 -0400, Elena Zannoni <ezannoni@redhat.com> said:
> > David Carlton writes:
>
> >> + psym = add_psymbol_to_list (pdi->name, strlen (pdi->name),
> >> + VAR_DOMAIN, LOC_STATIC,
> >> + &objfile->static_psymbols,
> >> + 0, addr + baseaddr,
> >> + cu_language, objfile);
>
> > I don't like this too much. I.e. changing add_psymbol_to_list to
> > return a value so you can get a hold of the psym. After all,
> > add_psymbol_to_list doesn't change any of the fields of the psymbol,
> > and cp_check_possible_namespace_symbols uses 2 fields that you
> > already have around.
>
> No, add_psymbol_to_list does change the fields: it calls
> SYMBOL_SET_NAMES to set the demangled name, which I need in
> cp_check_possible_namespace_symbols. So having add_psymbol_to_list
> return the psymbol seems the best solution; I suppose I could break
> out the demangled-name-caching code that SYMBOL_SET_NAMES uses into a
> separate function, but it doesn't seem worth it here.
>
Oh, right. I really don't like it. Only these few callers of
add_psymbol_to_list use its return value. But you are right, that
function does quite a bit. Sigh. I don't see any alternative, then.
Ok on the rest.
elena
More information about the Gdb-patches
mailing list