aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2025-07-09 10:18:46 -0400
committerSimon Marchi <simon.marchi@efficios.com>2025-07-11 12:26:25 -0400
commitbe1410ae9fc0f5e389a19a3b7550013df5bcd9c3 (patch)
treec899af8369e3e7cdd3cc67bf90a57d5c085714fc
parentb97691b926c1616c674e9e6a9f15e24bfb82eaea (diff)
downloadbinutils-be1410ae9fc0f5e389a19a3b7550013df5bcd9c3.zip
binutils-be1410ae9fc0f5e389a19a3b7550013df5bcd9c3.tar.gz
binutils-be1410ae9fc0f5e389a19a3b7550013df5bcd9c3.tar.bz2
gdb/solib-svr4: use program space from solib in find_debug_base_for_solib
Instead of using the current global program space, I think it makes sense to fetch the program space from the solib. The comment for solib::objfile indicates that it may be nullptr (which is true), but in this case, the callers (all in svr4_iterate_over_objfiles_in_search_order) find the solib from an objfile, so we know that solib::objfile (the link in the opposite direction) is set for these solibs at this point. Change-Id: I75037d0b2c39ab1b3a3792432be134e200438efe Approved-by: Kevin Buettner <kevinb@redhat.com>
-rw-r--r--gdb/solib-svr4.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 9b4cabf..e454254 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -3582,7 +3582,10 @@ find_debug_base_for_solib (const solib *solib)
if (solib == nullptr)
return 0;
- svr4_info *info = get_svr4_info (current_program_space);
+ /* This is always called for solibs with an associated objfile. */
+ gdb_assert (solib->objfile != nullptr);
+
+ svr4_info *info = get_svr4_info (solib->objfile->pspace ());
gdb_assert (info != nullptr);
auto *lm_info