From patchwork Sun Sep 10 00:21:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 22787 Received: (qmail 23227 invoked by alias); 10 Sep 2017 00:21:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 22389 invoked by uid 89); 10 Sep 2017 00:21:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2200 X-HELO: gproxy10-pub.mail.unifiedlayer.com Received: from gproxy10-pub.mail.unifiedlayer.com (HELO gproxy10-pub.mail.unifiedlayer.com) (69.89.20.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 10 Sep 2017 00:21:45 +0000 Received: from cmgw3 (unknown [10.0.90.84]) by gproxy10.mail.unifiedlayer.com (Postfix) with ESMTP id 06CED14071D for ; Sat, 9 Sep 2017 18:21:44 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id 7cMh1w0032f2jeq01cMkQY; Sat, 09 Sep 2017 18:21:44 -0600 X-Authority-Analysis: v=2.2 cv=K/VSJ2eI c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=2JCJgTwv5E4A:10 a=_ZhYKdCeAAAA:8 a=puaKJYblqSPYWfkhweoA:9 a=uqOk3ZSnBfCTOznnrPA1:22 Received: from 75-166-76-94.hlrn.qwest.net ([75.166.76.94]:44124 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dqq0K-0000Rx-QY; Sat, 09 Sep 2017 18:21:40 -0600 From: Tom Tromey To: Simon Marchi Cc: Eli Zaretskii , Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA 1/3] Add new_inferior, inferior_deleted, and new_thread events References: <20170909003353.25883-1-tom@tromey.com> <20170909003353.25883-2-tom@tromey.com> <831sngxsxi.fsf@gnu.org> Date: Sat, 09 Sep 2017 18:21:35 -0600 In-Reply-To: (Simon Marchi's message of "Sat, 09 Sep 2017 18:46:57 +0200") Message-ID: <87zia38kts.fsf@bapiya> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 X-BWhitelist: no X-Exim-ID: 1dqq0K-0000Rx-QY X-Source-Sender: 75-166-76-94.hlrn.qwest.net (bapiya) [75.166.76.94]:44124 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes >>>>> "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? Tom 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 +type @code{gdb.NewThreadEvent}, which extends @code{gdb.ThreadEvent}. +This has a single attribute: + +@defvar NewThreadEvent.inferior_thread +The new thread. +@end defvar + @end table @node Threads In Python