Re: [PATCH 0/6] Vertical scrolling and another small bug fix

Andrew Burgess
2020-01-09T23:28:57Z

* Tom Tromey <tom@tromey.com> [2020-01-07 12:38:48 -0700]:

> Andrew> This is a different (simpler) approach than I originally suggested.
>
> I meant to reply to that one. I thought the changes in tui-hooks.c
> looked reasonable. If you want to resurrect that, I'm in favor of
> it.

The reason I abandoned the old approach was that it moved the
redisplay from the pre-prompt hook into the symtab-changed hook. This
has two problems:

First, calling 'tui_add_win_to_layout (SRC_WIN);' in the symtab
changed hook is not OK, consider stopping after a 'continue' command,
the symtab will change, but we don't want the SRC window to reappear.
So, we should only redisplay SRC if the symtab changes AND the current
frame doesn't change. The pre-prompt hook achieves this due to its
ordering of the checks.

Second, even if we could solve the above problem, there are cases
where the current symtab changes multiple times due to a single
command (I forget what, but I was probably testing with list at the
time). If we redraw the contents of the SRC window on every symtab
changes event this is a bit wasteful - though probably not critical.

I've been playing with the idea of having the TUI maintain its own
idea of current source location. When the global symtab change event
fires we'd copy the global location into the TUI location, but, when
the TUI scrolls we'd update the TUI only location. Both the SRC and
ASM windows would draw their contents based on the TUI's location
value.

Anyway, I made a little progress, but still don't have it working, so
I don't know if there's a reason why is wouldn't work...

Thanks,
Andrew

>
> Andrew> I'm still not really happy with how the tui keeps track and displays
> Andrew> the current symtab_and_line
>
> Me too.
>
> Andrew> However, I think leaving the ability to vertically scroll broken isn't
> Andrew> good, and I think this series is a step in the right direction
> Andrew> (maybe?).
>
> Agreed. It all looks good to me.
>
> Tom