Re: [PATCH v5 06/15] gdb, compile: unlink objfile stored in module

Kevin Buettner via Gdb-patches
2022-06-23T17:21:27Z

On Thu, 2 Jun 2022 15:25:05 +0200
Markus Metzger via Gdb-patches <gdb-patches@sourceware.org> wrote:

> When cleaning up after a compile command, we iterate over all objfiles and
> unlink the first objfile with the same name as the one we compiled.
>
> Since we already store a pointer to that objfile in the module and use it
> to get the name we're comparing against, there's no reason to iterate, at
> all. We can simply use that objfile.
>
> This further avoids potential issues when an objfile with the same name is
> loaded into a different linker namespace.
> ---
> gdb/compile/compile-object-run.c | 21 +++++++++------------
> 1 file changed, 9 insertions(+), 12 deletions(-)

LGTM.

Kevin