From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56737 invoked by alias); 3 Aug 2016 16:16:21 -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 56727 invoked by uid 89); 3 Aug 2016 16:16:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=BAYES_00,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=react, subsequently X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 03 Aug 2016 16:16:11 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0BB0763700; Wed, 3 Aug 2016 16:16:10 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u73GG72R012054; Wed, 3 Aug 2016 12:16:08 -0400 Subject: Re: [RFA] PR python/13598 - add before_prompt event To: Tom Tromey , Matt Rice References: <1463806850-11001-1-git-send-email-tom@tromey.com> <87r3allziy.fsf@tromey.com> Cc: Yao Qi , "gdb-patches@sourceware.org" From: Pedro Alves Message-ID: Date: Wed, 03 Aug 2016 16:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <87r3allziy.fsf@tromey.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-08/txt/msg00068.txt.bz2 On 07/23/2016 06:00 AM, Tom Tromey wrote: >>>>>> "Matt" == Matt Rice writes: > > Matt> In particular it's just a nice time to take a snapshot of some > Matt> otherwise obtainable property from gdb right before control is handed > Matt> back to the user. > > Yes, this is exactly why I added this. > > My original motivation was to get a notification when the selected frame > changed. However, this happens a lot, sometimes temporarily. And, I > wasn't interested in temporary frame changes -- just "final" changes, > such as just after a command has completed and just before the prompt is > displayed... which led to this approach. > > Right now my GUI uses this event to react appropriately when the user > types "up" or "down". The TUI uses this approach too nowadays. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ commit 0986c744dfecb8177de90020646090e9ed23cfe7 Author: Patrick Palka AuthorDate: Tue Jun 30 13:56:49 2015 -0400 Replace TUI's select_frame hook (PR tui/13378) The select_frame hook is used by TUI to update TUI's frame and register information following changes to the selected frame. The problem with this hook is that it gets called after every single frame change, even if the frame change is only temporary or internal. This is the primary cause of flickering and slowdown when running the inferior under TUI with conditional breakpoints set. Internal GDB events are the source of many calls to select_frame and these internal events are triggered frequently, especially when a few conditional breakpoints are set. This patch removes the select_frame hook altogether and instead makes the frame and register information get updated in two key places (using observers): after an inferior stops, and right before displaying a prompt. The latter hook covers the case when frame information must be updated following a call to "up", "down" or "frame", and the former covers the case when frame and register information must be updated after a call to "continue", "step", etc. or after the inferior stops in async execution mode. Together these hooks should cover all the cases when frame information ought to be refreshed (and when the relevant windows ought to be subsequently updated). [...] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thanks, Pedro Alves