This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] PR python/13598 - add before_prompt event
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, Matt Rice <ratmice at gmail dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 3 Aug 2016 17:16:07 +0100
- Subject: Re: [RFA] PR python/13598 - add before_prompt event
- Authentication-results: sourceware.org; auth=none
- References: <1463806850-11001-1-git-send-email-tom@tromey.com> <CAH=s-PN=rQG=nxyB=YUPoDU4mSN6shAUskBUw8UmeJfm2UcLTw@mail.gmail.com> <CACTLOFqA-ZFfik=umzqsKy49bQr_OMzYjj6-m3o_MeqFzmd4Cg@mail.gmail.com> <87r3allziy.fsf@tromey.com>
On 07/23/2016 06:00 AM, Tom Tromey wrote:
>>>>>> "Matt" == Matt Rice <ratmice@gmail.com> 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 <patrick@parcs.ath.cx>
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