aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-07-11 12:39:35 -0400
committerSimon Marchi <simon.marchi@efficios.com>2024-07-15 14:34:12 -0400
commitb8c9d0de904198f73a39aa6bf9b27b4bc015e0f8 (patch)
tree4d6f9ca694a55cd2c1ad7c986e2d9e56d83971c6
parent89dc60d9570ff8f0f9757a6b0a8acd7204667c66 (diff)
downloadfsf-binutils-gdb-b8c9d0de904198f73a39aa6bf9b27b4bc015e0f8.zip
fsf-binutils-gdb-b8c9d0de904198f73a39aa6bf9b27b4bc015e0f8.tar.gz
fsf-binutils-gdb-b8c9d0de904198f73a39aa6bf9b27b4bc015e0f8.tar.bz2
gdb: pass program space to no_shared_libraries
Make the current program space reference bubble up one level. Pass `current_program_space` everywhere, except in some cases where we can get the pspace another way, and it's relatively obvious that it's the same as the current program space. Change-Id: Id86b79f1e44f92a398f49d137d57457174dfa96d Approved-By: Tom Tromey <tom@tromey.com> Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
-rw-r--r--gdb/infcmd.c4
-rw-r--r--gdb/infrun.c2
-rw-r--r--gdb/progspace.c2
-rw-r--r--gdb/remote.c2
-rw-r--r--gdb/solib.c8
-rw-r--r--gdb/solib.h4
-rw-r--r--gdb/symfile.c2
-rw-r--r--gdb/target.c2
8 files changed, 13 insertions, 13 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 5738bf0..4ed55f1 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2827,7 +2827,7 @@ detach_command (const char *args, int from_tty)
/* If the solist is global across inferiors, don't clear it when we
detach from a single inferior. */
if (!gdbarch_has_global_solist (inf->arch ()))
- no_shared_libraries ();
+ no_shared_libraries (inf->pspace);
if (deprecated_detach_hook)
deprecated_detach_hook ();
@@ -2853,7 +2853,7 @@ disconnect_command (const char *args, int from_tty)
query_if_trace_running (from_tty);
disconnect_tracing ();
target_disconnect (args, from_tty);
- no_shared_libraries ();
+ no_shared_libraries (current_program_space);
init_thread_list ();
update_previous_thread ();
if (deprecated_detach_hook)
diff --git a/gdb/infrun.c b/gdb/infrun.c
index b2dfd0c..06b454b 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1317,7 +1317,7 @@ follow_exec (ptid_t ptid, const char *exec_file_target)
/* Also, loading a symbol file below may trigger symbol lookups, and
we don't want those to be satisfied by the libraries of the
previous incarnation of this process. */
- no_shared_libraries ();
+ no_shared_libraries (current_program_space);
inferior *execing_inferior = current_inferior ();
inferior *following_inferior;
diff --git a/gdb/progspace.c b/gdb/progspace.c
index 580ebfb..224b61e 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -115,7 +115,7 @@ program_space::~program_space ()
set_current_program_space (this);
breakpoint_program_space_exit (this);
- no_shared_libraries ();
+ no_shared_libraries (this);
free_all_objfiles ();
/* Defer breakpoint re-set because we don't want to create new
locations for this pspace which we're tearing down. */
diff --git a/gdb/remote.c b/gdb/remote.c
index 4869e76..188795d 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -6271,7 +6271,7 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p)
}
/* First delete any symbols previously loaded from shared libraries. */
- no_shared_libraries ();
+ no_shared_libraries (current_program_space);
/* Start the remote connection. If error() or QUIT, discard this
target (we'd otherwise be in an inconsistent state) and then
diff --git a/gdb/solib.c b/gdb/solib.c
index 8faf4d7..8b97cc6 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1237,15 +1237,15 @@ sharedlibrary_command (const char *args, int from_tty)
/* See solib.h. */
void
-no_shared_libraries ()
+no_shared_libraries (program_space *pspace)
{
/* The order of the two routines below is important: clear_solib notifies
the solib_unloaded observers, and some of these observers might need
access to their associated objfiles. Therefore, we can not purge the
solibs' objfiles before clear_solib has been called. */
- clear_solib (current_program_space);
- objfile_purge_solibs (current_program_space);
+ clear_solib (pspace);
+ objfile_purge_solibs (pspace);
}
/* Implements the command "nosharedlibrary", which discards symbols
@@ -1256,7 +1256,7 @@ no_shared_libraries ()
static void
no_shared_libraries_command (const char *ignored, int from_tty)
{
- no_shared_libraries ();
+ no_shared_libraries (current_program_space);
}
/* See solib.h. */
diff --git a/gdb/solib.h b/gdb/solib.h
index 6b275c5..25ed77c 100644
--- a/gdb/solib.h
+++ b/gdb/solib.h
@@ -80,9 +80,9 @@ extern bool solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size);
extern bool in_solib_dynsym_resolve_code (CORE_ADDR);
-/* Discard symbols that were auto-loaded from shared libraries. */
+/* Discard symbols that were auto-loaded from shared libraries in PSPACE. */
-extern void no_shared_libraries ();
+extern void no_shared_libraries (program_space *pspace);
/* Synchronize GDB's shared object list with inferior's.
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 7c28328..6b72221 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1209,7 +1209,7 @@ symbol_file_clear (int from_tty)
/* solib descriptors may have handles to objfiles. Wipe them before their
objfiles get stale by free_all_objfiles. */
- no_shared_libraries ();
+ no_shared_libraries (current_program_space);
current_program_space->free_all_objfiles ();
diff --git a/gdb/target.c b/gdb/target.c
index 0ca7087..1802703 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -2452,7 +2452,7 @@ target_pre_inferior ()
memory regions and features. */
if (!gdbarch_has_global_solist (current_inferior ()->arch ()))
{
- no_shared_libraries ();
+ no_shared_libraries (current_program_space);
invalidate_target_mem_regions ();