This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb: Reinitialize objfile::section_offsets during objfile reload
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 27 Jan 2020 19:01:54 +0000
- Subject: Re: [PATCH] gdb: Reinitialize objfile::section_offsets during objfile reload
- References: <20200125225555.16846-1-andrew.burgess@embecosm.com> <875zgy6vo5.fsf@tromey.com>
On 1/26/20 4:15 PM, Tom Tromey wrote:
> Andrew> One thing I did wonder about while looking at this fix is whether it
> Andrew> would be possible to combine at least parts of syms_from_objfile_1
> Andrew> with the core of reread_symbols. I did have a go at doing this but
> Andrew> gave up in the end due to the subtle differences between the two.
> Andrew> Still, I think that with some more effort this might be possible, and
> Andrew> this could be a nice clean up.
>
> A long time ago, Jan had a patch along these lines.
> I believe what his did was just throw away the logic in reread_symbols
> in favor of simply creating a new objfile. I wonder if it's too late to
> do this now, since objfiles are exposed to Python.
IIRC, that patch walked all the places that store objfile pointers,
to recreate the objfiles. IMO, an approach that avoids that would be
better.
>
> Anyway, IMO, if there are subtle differences, they are probably bugs of
> some sort; and unifying these code paths seems like clearly the right
> thing to do.
Agreed.
Thanks,
Pedro Alves