Re: [patch] Do not add partial_symbol again and again to the list

Aleksandar Ristovski
2008-02-12T15:54:29Z

> On Tue, Feb 12, 2008 at 12:34:49AM -0500, Aleksandar Ristovski wrote:
>> What happens with the patch is that for an objfile, we will add global
>> type information only once, in the first partial symbol table where the
>> symbol was encountered. I think this will be fine. Type info will not have
>> address associated and all information we can get about it will be there.
>> Finding the first matching partial symbol for a type symbol is as good as
>> finding the second or N-th partial symbol for that type (and domain).
>
> Types are not (in C) global. They're file-static. We need to know
> which types are present in each file, because they may have different
> definitions in each file.
>
> The psymbols for two types with the same name will be the same. But
> the full symbols may be different.
>
Yes, you are correct. The patch should not filter out duplicate static symbols,
they should stay. Something like this:

(in add_psymbol_to_list)

/* Filter out duplicate global symbols for c++ only. */
if (language == language_cplus
&& list == objfile->global_psymbols
&& !added)
return psym;