[PATCH v2 0/3] Add some linker namespaces conveniences

Guinevere Larsen
2025-04-09T20:46:11Z

This series is a second step in improving the User Experience of
debugging inferiors with multiple namespaces. It adds 2 things to make
it more convenient for users to understand what the inferior is doing.

The first patch adds convenience variables, specifically
_active_linker_namespaces and _current_linker_namespaces. These can be
used to track where in the execution of an inferior the user is, and
could be used in breakpoint conditions to stop at a specific namespace.

The third patch adds a new command, "info linker-namespaces", to help the
user check what solibs are loaded, and where. To make the patch more
readable, the second patch is a minor refactor of the command "info
sharedlibrary".

The documentation changes have already been reviewed by Eli, changes for
v2 were minimal, only due to naming change.

Changes for v2:
* Renamed new command and variables to explicitly mention linker
namespaces

Guinevere Larsen (3):
gdb: add convenience variables around linker namespace debugging
gdb: factor out printing a table of solibs for info sharedlibrary
GDB: Introduce "info namespaces" command

gdb/NEWS | 11 +
gdb/doc/gdb.texinfo | 28 ++
gdb/solib-svr4.c | 55 ++++
gdb/solib.c | 267 ++++++++++++++-----
gdb/solist.h | 4 +
gdb/testsuite/gdb.base/default.exp | 2 +
gdb/testsuite/gdb.base/dlmopen-ns-ids-main.c | 6 +
gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 148 ++++++++++
8 files changed, 461 insertions(+), 60 deletions(-)

base-commit: a650cb6b2fbcd4ff02d2bd819d3979f3e57794b1
--
2.49.0