public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jan Vrany <jan.vrany@labware.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb/python: implement support for sending custom MI async notifications
Date: Sat, 09 Sep 2023 09:39:51 +0300	[thread overview]
Message-ID: <83r0n7voi0.fsf@gnu.org> (raw)
In-Reply-To: <20230908210504.89194-2-jan.vrany@labware.com> (message from Jan Vrany via Gdb-patches on Fri, 8 Sep 2023 22:05:04 +0100)

> CC: Jan Vrany <jan.vrany@labware.com>
> Date: Fri,  8 Sep 2023 22:05:04 +0100
> From: Jan Vrany via Gdb-patches <gdb-patches@sourceware.org>
> 
> This commit adds a new Python function, gdb.notify_mi, that can be used
> to emit custom async notification to MI channel.  This can be used, among
> other things, to implement notifications about events MI does not support,
> such as remote connection closed or register change.
> ---
>  gdb/NEWS                                  |  3 ++
>  gdb/doc/python.texi                       | 38 ++++++++++++++++++
>  gdb/python/py-mi.c                        | 49 +++++++++++++++++++++++
>  gdb/python/python-internal.h              |  3 ++
>  gdb/python/python.c                       |  4 ++
>  gdb/testsuite/gdb.python/py-mi-notify.exp | 47 ++++++++++++++++++++++
>  6 files changed, 144 insertions(+)
>  create mode 100644 gdb/testsuite/gdb.python/py-mi-notify.exp

Thanks.

> diff --git a/gdb/NEWS b/gdb/NEWS
> index 98ff00d5efc..4a1f383a666 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -286,6 +286,9 @@ info main
>       might be array- or string-like, even if they do not have the
>       corresponding type code.
>  
> +  ** New function gdb.notify_mi(NAME, DATA), that emits custom
> +     GDB/MI async notification.
> +

This part is okay.

> +It is possible to emit @sc{gdb/mi} notifications from
> +Python.  This is done with the @code{gdb.notify_mi} function.

We try to avoid using passive voice when it is not required.  Suggest
to rephrase the last sentence:

  Use the @code{gdb.notify_mi} function to do that.

> +Emit a @sc{gdb/mi} asynchronous notification.  @var{name} is the name of the
> +notification, a string.

This begs the question: is any string allowed?  If any string is
allowed as NAME, I think you should tell which field of the async MI
notification will be set from that string.  If NAME must be one of a
fixed list of known notifications, we should say something about where
to find that list.

> +as Python dictionary. The dictionary is converted to converted
                       ^^
Two spaces there.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>

  reply	other threads:[~2023-09-09  6:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08 21:05 [PATCH 1/2] gdb/python: generalize serialize_mi_result() Jan Vrany
2023-09-08 21:05 ` [PATCH 2/2] gdb/python: implement support for sending custom MI async notifications Jan Vrany
2023-09-09  6:39   ` Eli Zaretskii [this message]
2023-09-11 12:42   ` Andrew Burgess
2023-09-11 13:02     ` Jan Vraný
2023-09-11 13:43     ` Eli Zaretskii
2023-09-11 14:22       ` Andrew Burgess
2023-09-11 14:14   ` Andrew Burgess
2023-09-12 10:58     ` Jan Vraný
2023-09-12 13:07       ` Andrew Burgess
2023-09-12 13:45         ` Jan Vraný
2023-09-12 13:53           ` Andrew Burgess
2023-09-11 14:21   ` Andrew Burgess
2023-09-11 14:24     ` Jan Vraný
2023-09-11 14:18 ` [PATCH 1/2] gdb/python: generalize serialize_mi_result() Andrew Burgess
2023-09-12 16:35 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r0n7voi0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.vrany@labware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).