From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69621 invoked by alias); 9 Sep 2017 16:47:17 -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 68843 invoked by uid 89); 9 Sep 2017 16:47:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= 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; Sat, 09 Sep 2017 16:47:15 +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 v89Gl8HN015038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 9 Sep 2017 12:47:13 -0400 Received: by simark.ca (Postfix, from userid 112) id 95FA51EAAC; Sat, 9 Sep 2017 12:47:08 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 82B5D1E984; Sat, 9 Sep 2017 12:46:57 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 09 Sep 2017 16:47:00 -0000 From: Simon Marchi To: Eli Zaretskii Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA 1/3] Add new_inferior, inferior_deleted, and new_thread events In-Reply-To: <831sngxsxi.fsf@gnu.org> References: <20170909003353.25883-1-tom@tromey.com> <20170909003353.25883-2-tom@tromey.com> <831sngxsxi.fsf@gnu.org> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 9 Sep 2017 16:47:08 +0000 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00239.txt.bz2 On 2017-09-09 08:55, Eli Zaretskii wrote: >> From: Tom Tromey >> Cc: Tom Tromey >> Date: Fri, 8 Sep 2017 18:33:51 -0600 >> >> This adds a few new events to gdb's Python layer: new_inferior, >> inferior_deleted, and new_thread. I wanted to be able to add a >> combined inferior/thread display window to my GUI, and I needed a few >> events to make this work. This is PR python/15622. >> >> gdb/ChangeLog >> 2017-09-08 Tom Tromey >> >> PR python/15622: >> * NEWS: Add entry. >> * python/python.c (do_start_initialization): Initialize new event >> types. >> * python/python-internal.h (gdbpy_initialize_new_inferior_event) >> (gdbpy_initialize_inferior_deleted_event) >> (gdbpy_initialize_new_thread_event): Declare. >> * python/py-threadevent.c (create_thread_event_object): Add option >> "thread" parameter. >> * python/py-inferior.c (new_thread_event_object_type) >> (new_inferior_event_object_type) >> (inferior_deleted_event_object_type): Declare. >> (python_new_inferior, python_inferior_deleted): New functions. >> (add_thread_object): Emit new_thread event. >> (gdbpy_initialize_inferior): Attach new functions to corresponding >> observers. >> (new_thread, new_inferior, inferior_deleted): Define new event >> types. >> * python/py-evts.c (gdbpy_initialize_py_events): Add new >> registries. >> * python/py-events.h (events_object) > inferior_deleted, new_thread>: New fields. >> * python/py-event.h (create_thread_event_breakpoint): Add optional >> "thread" parameter. >> >> gdb/doc/ChangeLog >> 2017-09-08 Tom Tromey >> >> * python.texi (Events In Python): Document new events. >> >> gdb/testsuite/ChangeLog >> 2017-09-08 Tom Tromey >> >> * gdb.python/py-infthread.exp: Add tests for new_thread event. >> * gdb.python/py-inferior.exp: Add tests for new inferior events. > > OK for the documentation parts. > > Thanks. I find the resulting documentation page about Python Events a bit hard to follow. The "events.new_thread" event registry refers to the gdb.ThreadEvent type, which itself is defined under the "events.cont" registry. There it says that inferior_thread is always not None in none-stop, and always None in all-stop. That is contradictory with the text under "events.new_thread". If it is possible for event types to be emitted by different event registries, I think they should be documented separately (on the same page, but in two sections). Simon