]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/progspace: add solib_ops pointer in program_space
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 26 Jun 2025 17:36:06 +0000 (13:36 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 26 Jun 2025 18:08:31 +0000 (14:08 -0400)
commit3cb6bc13e32814eab97237793ba6ba357bc72a3d
tree22d266bb2050ae55c1780bf36f59a8fff082f748
parentaff04ed34f5da8bad080c88c9a1229f5be2e1a5b
gdb/progspace: add solib_ops pointer in program_space

The subsequent C++ification patch in this series will allocate one
instance of solib_ops per program space.  That instance will be held in
struct program_space.  As a small step towards this, add an `solib_ops
*` field to `struct program_space`.  This field represents the solib_ops
currently used to manage the solibs in that program space.  Initialize
it with the result of `gdbarch_so_ops` in `post_create_inferior`, and
use it whenever we need to do some solib stuff, rather than using
`gdbarch_so_ops` directly.

The difficulty here is knowing when exactly to set and unset the solib
ops.  What I have here passes the testsuite on Linux, but with more
testing we will probably discover more spots where it's needed.

The C++ification patch will turn this field into a unique pointer.

With this patch, the message we get when running "info
linker-namespaces" becomes always the same, so update the test in
gdb.base/dlmopen-ns-ids.exp.

Change-Id: Ide8ddc57328895720fcd645d46dc34491f84c656
Approved-By: Pedro Alves <pedro@palves.net>
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
gdb/corelow.c
gdb/infcmd.c
gdb/inferior.h
gdb/infrun.c
gdb/progspace.h
gdb/solib.c
gdb/target.c
gdb/testsuite/gdb.base/dlmopen-ns-ids.exp
gdb/tracectf.c
gdb/tracefile-tfile.c