Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Patrick Palka <patrick@parcs.ath.cx>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH 3/3] Replace TUI's select_frame hook (PR tui/13378)
Date: Tue, 30 Jun 2015 12:16:00 -0000	[thread overview]
Message-ID: <CA+C-WL_ToZAgxzNZ=tSRA9hLn-+KWw-djNnRzyoiPj69BQHxoQ@mail.gmail.com> (raw)
In-Reply-To: <5592622D.40305@redhat.com>

On Tue, Jun 30, 2015 at 5:32 AM, Pedro Alves <palves@redhat.com> wrote:
> On 06/27/2015 03:50 AM, Patrick Palka wrote:
>> Actually, we should not call tui_show_frame_info(NULL) when there are no
>> stack frames, because doing so empties the source window after invoking
>> "continue&". That was a last-minute change with no justification anyway.
>>
>> Here is a revised patch with a much smaller diffstat.
>
> On 06/27/2015 03:35 AM, Patrick Palka wrote:
>
>> Effectively, with this patch, frame/PC changes that do not immediately
>> precede an inferior-stop event or a prompt display event no longer cause
>> TUI's frame and register information to be updated.
>
> It seems to me that this doesn't update the info when the
> program stops after continue& ...

Oops, yeah..

>
>> @@ -107,6 +108,9 @@ tui_on_sync_execution_done (void)
>>  {
>>    if (!interp_quiet_p (tui_interp))
>>      display_gdb_prompt (NULL);
>> +
>> +  if (tui_active)
>> +    tui_refresh_frame_and_register_information ();
>>  }
>>
>
> ... when sync/foreground execution is done, we show the
> prompt (display_gdb_prompt above), so the before_prompt observer
> is already taking care of refreshing.
>
> But when background/async execution is done, we don't call
> sync_execution_done observers, so this hook isn't called.
> So I'm not seeing what this bit in tui_on_sync_execution_done
> is for.

Good point... the sync_execution_done addendum is useless.

>
> I think that for for stops (either after background or foreground
> execution), the TUI refreshes itself from within the
> deprecated_print_frame_info_listing_hook, called from:
>
> #0  tui_show_frame_info (fi=0xf20b50) at /home/pedro/gdb/mygit/build/../src/gdb/tui/tui-stack.c:337
> #1  0x00000000005266c5 in tui_print_frame_info_listing_hook (s=0x1978100, line=92, stopline=93, noerror=0) at /home/pedro/gdb/mygit/build/../src/gdb/tui/tui-hooks.c:177
> #2  0x000000000063a6f7 in print_frame_info (frame=0xf20b50, print_level=0, print_what=SRC_AND_LOC, print_args=1, set_current_sal=1)
>     at /home/pedro/gdb/mygit/build/../src/gdb/stack.c:895
> #3  0x0000000000638e2f in print_stack_frame (frame=0xf20b50, print_level=0, print_what=SRC_AND_LOC, set_current_sal=1)
>     at /home/pedro/gdb/mygit/build/../src/gdb/stack.c:162
> #4  0x0000000000632c14 in print_stop_event (ws=0x7fffffffd120) at /home/pedro/gdb/mygit/build/../src/gdb/infrun.c:6536
> #5  0x0000000000632fa5 in normal_stop () at /home/pedro/gdb/mygit/build/../src/gdb/infrun.c:6701
>
> I think this hooking in deprecated_print_frame_info_listing_hook
> is also a too-low-level place, and is likely contributing
> to flicker in other situations.  I think we should move
> to doing whatever we do in it to a normal_stop observer instead.
> (tbc, doesn't have to be this patch.)

That make sense.

>
>> And as a result of this change and of the previous change to
>> tui_show_frame_info, the TUI is much more disciplined about updating the
>> screen, and so the flicker as described in the PR is totally gone.
>
> I think we should sort out patch 3 before patch 2.  AFAICS, the
> important one is this one, right?

This one is more important, but by itself it causes source/asm-window
scrolling to be reset after each command (due to the before_prompt
observer) even if the frame information hasn't been changed in the
meantime.  Other than that they are mostly unrelated.

I'll post a revised patch in a bit.

>
> Thanks,
> Pedro Alves
>


  reply	other threads:[~2015-06-30 12:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-27  2:35 [PATCH 1/3] Correctly initialize the TUI locator window Patrick Palka
2015-06-27  2:35 ` [PATCH 2/3] Be lazy about refreshing the windows in tui_show_frame_info (PR tui/13378) Patrick Palka
2015-06-30  2:32   ` [PATCH] " Patrick Palka
2015-06-30 14:27     ` Pedro Alves
2015-06-30 14:45       ` Patrick Palka
2015-06-30 15:11         ` Pedro Alves
2015-06-30 15:15           ` Patrick Palka
2015-06-30 16:51           ` [PATCH 2/3] " Patrick Palka
2015-06-30 17:26             ` Pedro Alves
2015-06-27  2:35 ` [PATCH 3/3] Replace TUI's select_frame hook " Patrick Palka
2015-06-27  2:50   ` Patrick Palka
2015-06-30  9:32     ` Pedro Alves
2015-06-30 12:16       ` Patrick Palka [this message]
2015-06-30 12:37         ` Patrick Palka
2015-06-30 14:08           ` Pedro Alves
2015-06-30 14:54             ` Patrick Palka
2015-06-30 14:56               ` Patrick Palka
2015-06-30 15:12               ` Patrick Palka
2015-06-30 15:47                 ` Pedro Alves
2015-06-30 16:40                   ` Patrick Palka
2015-06-30 17:07                     ` Pedro Alves
2015-06-30 17:11                       ` Patrick Palka
2015-06-30 17:32                         ` Pedro Alves
2015-06-30 17:49                           ` Patrick Palka
2015-07-01 12:40                       ` Patrick Palka
2015-06-30 13:23         ` Pedro Alves
2015-06-30 14:03           ` Patrick Palka
2015-06-30  8:36 ` [PATCH 1/3] Correctly initialize the TUI locator window Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+C-WL_ToZAgxzNZ=tSRA9hLn-+KWw-djNnRzyoiPj69BQHxoQ@mail.gmail.com' \
    --to=patrick@parcs.ath.cx \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox