From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7079 invoked by alias); 10 Sep 2017 19:37:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 6479 invoked by uid 89); 10 Sep 2017 19:37:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2538 X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 10 Sep 2017 19:37:37 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v8AJbUns015508 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 10 Sep 2017 15:37:35 -0400 Received: by simark.ca (Postfix, from userid 112) id 658921EAAC; Sun, 10 Sep 2017 15:37:30 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 090E41EA17; Sun, 10 Sep 2017 15:37:19 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 10 Sep 2017 19:37:00 -0000 From: Simon Marchi To: Tom Tromey Cc: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: [RFA 1/3] Add new_inferior, inferior_deleted, and new_thread events In-Reply-To: <87zia38kts.fsf@bapiya> References: <20170909003353.25883-1-tom@tromey.com> <20170909003353.25883-2-tom@tromey.com> <831sngxsxi.fsf@gnu.org> <87zia38kts.fsf@bapiya> Message-ID: <54e2a3aa0b6ce348363eca135ab86c4d@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sun, 10 Sep 2017 19:37:30 +0000 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00279.txt.bz2 On 2017-09-10 02:21, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> I find the resulting documentation page about Python Events a > bit hard > Simon> to follow. The "events.new_thread" event registry refers to the > Simon> gdb.ThreadEvent type, which itself is defined under the > "events.cont" > Simon> registry. There it says that inferior_thread is always not None > in > Simon> none-stop, and always None in all-stop. That is contradictory > with > Simon> the text under "events.new_thread". If it is possible for event > types > Simon> to be emitted by different event registries, I think they should > be > Simon> documented separately (on the same page, but in two sections). > > How about this doc patch instead? That's fine with me, I think it makes it clear enough that the comments about the inferior_thread field under events.cont don't apply here. > diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi > index 32d7939..1e96dbc 100644 > --- a/gdb/doc/python.texi > +++ b/gdb/doc/python.texi > @@ -2989,6 +2989,39 @@ invalid state; that is, the @code{is_valid} > method will return > This event carries no payload. It is emitted each time @value{GDBN} > presents a prompt to the user. > > +@item events.new_inferior > +This is notified when a new inferior is created. Note that the > +inferior is not necessarily running; in fact, it may not even have an > +associated executable. > + > +The event is of type @code{gdb.NewInferiorEvent}. This has a single > +attribute: > + > +@defvar NewInferiorEvent.inferior > +The new inferior, a @code{gdb.Inferior} object. > +@end defvar > + > +@item events.inferior_deleted > +This is notified when an inferior has been deleted. Note that this is > +not the same as process exit; it is notified when the inferior itself > +is removed, say via @code{remove-inferiors}. > + > +The event is of type @code{gdb.InferiorDeletedEvent}. This has a > single > +attribute: > + > +@defvar NewInferiorEvent.inferior > +The inferior that is being removed, a @code{gdb.Inferior} object. > +@end defvar > + > +@item events.new_thread > +This emitted when @value{GDBN} notices a new thread. The event is of "This emitted". I also noticed that for other events you used "This is notified". Perhaps it would be better to stick with "This is emitted" everywhere to be consistent. If Eli is fine with this version of the doc, I think this patch is ready to go in. Thanks, Simon