[v3,0/3] Add some linker namespaces conveniences

Message ID 20250411175022.2379494-1-guinevere@redhat.com
Headers
Series Add some linker namespaces conveniences |

Message

Guinevere Larsen April 11, 2025, 5:50 p.m. UTC
  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 v3:
* Changed the final gdb.base/dlmopen-ns-ids.exp test to allow for linker
  namespaces that don't load libc and libm, since some systems may not
  do it.

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    | 129 +++++++++
 8 files changed, 442 insertions(+), 60 deletions(-)


base-commit: 52c5091dfb18113156d645500ab86b600f1cdfe0
  

Comments

Kevin Buettner April 17, 2025, 11:43 p.m. UTC | #1
On Fri, 11 Apr 2025 14:50:19 -0300
Guinevere Larsen <guinevere@redhat.com> wrote:

> 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 v3:
> * Changed the final gdb.base/dlmopen-ns-ids.exp test to allow for linker
>   namespaces that don't load libc and libm, since some systems may not
>   do it.
> 
> 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    | 129 +++++++++
>  8 files changed, 442 insertions(+), 60 deletions(-)

I'm still comfortable with the approvals that I provided earlier for
the v2 series.

Approved-by: Kevin Buettner <kevinb@redhat.com>
  
Guinevere Larsen April 23, 2025, 12:44 p.m. UTC | #2
On 4/17/25 8:43 PM, Kevin Buettner wrote:
> On Fri, 11 Apr 2025 14:50:19 -0300
> Guinevere Larsen <guinevere@redhat.com> wrote:
>
>> 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 v3:
>> * Changed the final gdb.base/dlmopen-ns-ids.exp test to allow for linker
>>    namespaces that don't load libc and libm, since some systems may not
>>    do it.
>>
>> 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    | 129 +++++++++
>>   8 files changed, 442 insertions(+), 60 deletions(-)
> I'm still comfortable with the approvals that I provided earlier for
> the v2 series.
>
> Approved-by: Kevin Buettner <kevinb@redhat.com>
>
I pushed this patch.

There was some conversation on IRC about details, but since Simon said 
he didn't have the time to review in depth, and didn't show interest in 
me delaying pushing, I figured I could push it. And anyway, in my 
opinion, as long as we haven't branched for GDB 17 yet, I think we 
should be ok with changing those details, so if the changes are 
requested, I think a future patch could change with little overhead (for 
now).