From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 809DE3858D1E for ; Sat, 9 Sep 2023 06:40:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 809DE3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qerdQ-0003GA-7M; Sat, 09 Sep 2023 02:40:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=DfdiDSGbiW7A48kh+lacqm/ADh/ByuliUXvFBw0Sb40=; b=AnoVRp1SuuKx GJXELdCddyn21H1KJkhySeJQ2/xS+7d7nroo8uLnUi087xDK54Ofpp4ZZhmznRx2WLc/QJSAO0NhB v5UEG8TPRr4qH+H1Uq0NLFsTYOjPk25f4cgpgyD/RMIDK+9jmX6qn5PyFhVtxfnxfwcAyy1Iuom4o DUGN+uMJZb4ytJL2eXjg198J6pDb4Z5LtTPn3Cq8+vSuLlbxpb1hXLi/S2880MNZuHEyVFD/K2jua Quts+V4TCqI1EIA5MpFG30VOPK5jvMWkFj3UJPBAGGyw6TPY+h7RxEGt5cX2JDlo0QLLHE1TGT/4z 1r0paj0PEvKn4SaqqMrxFg==; Date: Sat, 09 Sep 2023 09:39:51 +0300 Message-Id: <83r0n7voi0.fsf@gnu.org> From: Eli Zaretskii To: Jan Vrany Cc: gdb-patches@sourceware.org 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) Subject: Re: [PATCH 2/2] gdb/python: implement support for sending custom MI async notifications References: <20230908210504.89194-1-jan.vrany@labware.com> <20230908210504.89194-2-jan.vrany@labware.com> X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > CC: Jan Vrany > Date: Fri, 8 Sep 2023 22:05:04 +0100 > From: Jan Vrany via Gdb-patches > > 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