Re: [PATCH V5] CTF: multi-CU and archive support

Lancelot SIX via Gdb-patches
2021-06-11T23:14:37Z

On Fri, Jun 11, 2021 at 12:19:05PM -0600, Tom Tromey wrote:
> >>>>> "Lancelot" == Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Lancelot> Should be
>
> Lancelot> if (sym != nullptr)
>
> Agreed.
>
> >> pst = new ctf_psymtab (name, partial_symtabs, objfile->per_bfd, 0);
>
> Lancelot> I am a bit confused by this one. As far as I can see, there is no way
> Lancelot> it can ever be deleted. Again, I am not so familiar with the code yet
> Lancelot> so I might have missed something, but hopefully not.
>
> psymtabs register themselves with a storage object.
> This is unfortunate but it is how it has been done for a long time, and
> nobody has bothered to clean it up.
>
> Tom

Thanks for the info. This is something I missed initially. “naked
new”s without obvious deletes tend to raise some alarms when I read
code…

Lancelot.