[PATCH] gdb/testsuite/tui: start GDB with "set filename-display basename"
Simon Marchi
simon.marchi@polymtl.ca
Fri Sep 23 14:22:47 GMT 2022
On 2022-09-23 09:50, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Simon> And that causes `wait_for` to think the "step" command is complete.
> Simon> This is wrong, as the prompt at line 17 isn't the prompt drawn after the
> Simon> completion of the "step" command. The subsequent tests now run with a
> Simon> partially updated screen (what is shown above) and obviously fail.
>
> Simon> The ideal way to fix this would be for `wait_for` to be smarter, to
> Simon> avoid it confusing the different prompts drawn.
>
> This is actually ridiculously hard. Not being able to solve this is why
> we added the refresh-counting hack for TUI testing.
Ok, I'm not aware of that. But yeah I thought about this problem for a
day and didn't find any magic solution. The only semi-relevant idea I
had was to track at which line the last prompt was printed. And when
matching a prompt, it must be at a line >= where the last prompt was
printed. If it's above, it means it's a redraw of an old prompt.
> Simon> Doing this happens to fix my failures and makes my CI happy (which in
> Simon> turns makes me happy). To be clear, I understand that this does not fix
> Simon> the root issue of `proc wait_for` being confused. However, it makes TUI
> Simon> test runs be more similar for everyone, such that there's less chance of
> Simon> TUI tests randomly failing for somebody.
>
> It seems like an improvement to me.
>
> Simon> Note that there are other reasons why TUI tests could vary, like
> Simon> different curses library versions taking different re-drawing decisions.
> Simon> However, I think my change is a good step towards more stable test
> Simon> results.
>
> Indeed, I think this has happened already.
>
> Anyway the patch looks good to me.
Thanks, I'll push it.
Simon
More information about the Gdb-patches
mailing list