[PATCHv2 5/6] gdb: add inferior-specific breakpoints and watchpoints

Eli Zaretskii eliz@gnu.org
Fri Jan 20 13:25:42 GMT 2023


> Cc: Andrew Burgess <aburgess@redhat.com>
> Date: Fri, 20 Jan 2023 09:46:28 +0000
> From: Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org>
> 
> This commit extends the breakpoint mechanism to allow for inferior
> specific breakpoints (and watchpoints).
> 
> As GDB gains better support for multiple connections, and so for
> running multiple (possibly unrelated) inferiors, then it is not hard
> to imagine that a user might wish to create breakpoints that apply to
> any thread in a single inferior.  To achieve this currently, the user
> would need to create a condition possibly making use of the $_inferior
> convenience variable, which, though functional, isn't the most user
> friendly.
> 
> This commit adds a new 'inferior' keyword that allows for the creation
> of inferior specific breakpoints.
> 
> Like thread specific breakpoints, the inferior specific breakpoints
> are automatically deleted once the inferior in question exits.
> ---
>  gdb/NEWS                                      |   7 +
>  gdb/breakpoint.c                              | 171 +++++++++++++---
>  gdb/breakpoint.h                              |  10 +-
>  gdb/doc/gdb.texinfo                           |  74 ++++++-
>  gdb/doc/python.texi                           |  24 ++-
>  gdb/dummy-frame.c                             |   1 +
>  gdb/elfread.c                                 |   5 +-
>  gdb/guile/scm-breakpoint.c                    |   5 +
>  gdb/inferior.h                                |  11 ++
>  gdb/infrun.c                                  |   2 +
>  gdb/linespec.c                                |   4 +-
>  gdb/python/py-breakpoint.c                    |  77 ++++++++
>  gdb/testsuite/gdb.linespec/cpcompletion.exp   |   4 +-
>  gdb/testsuite/gdb.linespec/explicit.exp       |   1 +
>  .../gdb.multi/inferior-specific-bp-1.c        |  52 +++++
>  .../gdb.multi/inferior-specific-bp-2.c        |  52 +++++
>  .../gdb.multi/inferior-specific-bp.exp        | 182 ++++++++++++++++++
>  gdb/testsuite/gdb.python/py-breakpoint.exp    |  43 +++++
>  gdb/testsuite/lib/completion-support.exp      |   2 +-
>  19 files changed, 680 insertions(+), 47 deletions(-)
>  create mode 100644 gdb/testsuite/gdb.multi/inferior-specific-bp-1.c
>  create mode 100644 gdb/testsuite/gdb.multi/inferior-specific-bp-2.c
>  create mode 100644 gdb/testsuite/gdb.multi/inferior-specific-bp.exp

Thanks, the documentation parts are OK.


More information about the Gdb-patches mailing list