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>
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