From: Simon Marchi Date: Thu, 16 May 2024 19:57:08 +0000 (-0400) Subject: gdb: pass program space to objfile_purge_solibs X-Git-Tag: binutils-2_43~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98793b838c3cf99228d7a6d89918932f4effee24;p=thirdparty%2Fbinutils-gdb.git gdb: pass program space to objfile_purge_solibs Make the current program space reference bubble up one level. Change-Id: I08cfa77a0351c9602131ed2a294eabb1f1f59a6e Approved-By: Tom Tromey Reviewed-By: Thiago Jung Bauermann --- diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 822376ba260..56add01daa6 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -784,14 +784,12 @@ have_full_symbols (void) } -/* This operations deletes all objfile entries that represent solibs that - weren't explicitly loaded by the user, via e.g., the add-symbol-file - command. */ +/* See objfiles.h. */ void -objfile_purge_solibs (void) +objfile_purge_solibs (program_space *pspace) { - for (objfile *objf : current_program_space->objfiles_safe ()) + for (objfile *objf : pspace->objfiles_safe ()) { /* We assume that the solib package has been purged already, or will be soon. */ diff --git a/gdb/objfiles.h b/gdb/objfiles.h index b166f0e8776..73d1e991e84 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -947,11 +947,11 @@ extern bool is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile); extern bool shared_objfile_contains_address_p (struct program_space *pspace, CORE_ADDR address); -/* This operation deletes all objfile entries that represent solibs that - weren't explicitly loaded by the user, via e.g., the add-symbol-file +/* This operation deletes all objfile entries in PSPACE that represent solibs + that weren't explicitly loaded by the user, via e.g., the add-symbol-file command. */ -extern void objfile_purge_solibs (void); +extern void objfile_purge_solibs (program_space *pspace); /* Functions for dealing with the minimal symbol table, really a misc address<->symbol mapping for things we don't have debug symbols for. */ diff --git a/gdb/solib.c b/gdb/solib.c index 55f1c53b99b..7b8e09ac8be 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1248,7 +1248,7 @@ no_shared_libraries (const char *ignored, int from_tty) solibs' objfiles before clear_solib has been called. */ clear_solib (current_program_space); - objfile_purge_solibs (); + objfile_purge_solibs (current_program_space); } /* See solib.h. */