From: Simon Marchi Date: Wed, 4 Oct 2023 02:20:23 +0000 (-0400) Subject: gdb: use objfile->pspace in free_objfile observers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0b6a94ecbc8b39d6ea86f4337aa23c73a178897e;p=binutils-gdb.git gdb: use objfile->pspace in free_objfile observers Use objfile->pspace instead of current_program_space. Change-Id: I127a1788e155b321563114452ed5b530f1d1f618 Approved-By: Tom Tromey --- diff --git a/gdb/solib.c b/gdb/solib.c index f914822d209..5280e5ffefd 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1739,7 +1739,7 @@ remove_user_added_objfile (struct objfile *objfile) { if (objfile != 0 && objfile->flags & OBJF_USERLOADED) { - for (struct so_list *so : current_program_space->solibs ()) + for (struct so_list *so : objfile->pspace->solibs ()) if (so->objfile == objfile) so->objfile = NULL; } diff --git a/gdb/symfile.c b/gdb/symfile.c index aca31e30d6e..dc2f6258ce2 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3749,7 +3749,7 @@ static void symfile_free_objfile (struct objfile *objfile) { /* Remove the target sections owned by this objfile. */ - current_program_space->remove_target_sections (objfile); + objfile->pspace->remove_target_sections (objfile); } /* Wrapper around the quick_symbol_functions expand_symtabs_matching "method".