Re: [RFC][PATCH] Call tui_before_prompt in do_scroll_vertical

Hannes Domani via gdb-patches
2019-12-23T00:19:42Z

Am Montag, 23. Dezember 2019, 01:03:49 MEZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben:

> >>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
>
> >> First I tried it with tui_update_source_windows_with_line, but this didn't
> >> reset from_source_symtab (which was set deep in print_source_lines),
> >> which resulted in some weird behavior when switching from "layout split"
> >> to "layout asm" after scrolling down in the src window (the asm window
> >> was then overwritten by the src window).
>
> I wonder if we really need to change the current source symtab.
> If so, I guess the TUI could just call
> set_current_source_symtab_and_line directly.
>
> The patch below removes the call to print_source_lines -- this approach
> just seems too roundabout for my taste.
>
> Andrew> I was able to reproduce the layout split -> layout asm issue you
> Andrew> describe, but, I'm not convinced that the solution below is the right
> Andrew> way to go.
>
> With my patch I can't reproduce this, but I don't know whether I'm doing
> it properly.
>
> Hannes, could you possibly try this patch?
>
> This could maybe be made even a bit smaller, but it's hard to be sure.
> Despite all the cleanups, I find this area still pretty confusing.

This fixes the scrolling, and I no longer have any problem when switching
from layout split -> layout asm after scrolling the src window.

But now, when in layout split, the asm window doesn't scroll along with
the src window any more.
I found this to be a very convenient feature, because this showed
you which asm lines belonged to which src line (as good as the optimized
code allowed at least).

Regards
Hannes Domani