This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa] generate symbols associated to namespaces
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: David Carlton <carlton at kealia dot com>
- Cc: Elena Zannoni <ezannoni at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Tue, 9 Sep 2003 17:44:59 -0400
- Subject: Re: [rfa] generate symbols associated to namespaces
- References: <m3k7blg4dr.fsf@kealia.com><20030622173547.GA22603@nevyn.them.org><ro1brwntjhz.fsf@jackfruit.Stanford.EDU><20030624185019.GA24662@nevyn.them.org><yf28yrn1p8i.fsf@hawaii.kealia.com><yf2k7b7yyg5.fsf@hawaii.kealia.com><16222.12105.616302.481564@localhost.redhat.com><yf2he3lu2os.fsf@hawaii.kealia.com>
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