[gdb/testsuite] Add Term::get_line_with_attrs
authorTom de Vries <tdevries@suse.de>
Mon, 22 May 2023 10:02:43 +0000 (12:02 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 22 May 2023 10:02:43 +0000 (12:02 +0200)
commit5a8f5960fd8fc5136fc24ddaf08a25c73f9c8329
tree6d6c4c2f15f1bb277a8e719b3403443e95c8e2c2
parenta01399ff21e35422868c3853a31811c301a73883
[gdb/testsuite] Add Term::get_line_with_attrs

Add a new proc Term::get_line_with_attrs, similar to Term::get_line, that
annotates a tuiterm line with the active attributes.

For instance, the line representing the TUI status window with attribute mode
standout looks like this with Term::get_line:
...
exec No process In: ... L??   PC: ??
...
but like this with Term::get_line_with_attrs:
...
<reverse:1>exec No process In: ... L??   PC: ?? <reverse:0>
...

Also add Term::dump_screen_with_attrs, a Term::dump_screen variant that uses
Term::get_line_with_attrs instead of Term::get_line.

Tested by re-running the TUI test-cases (gdb.tui/*.exp and gdb.python/tui*.exp)
on x86_64-linux.
gdb/testsuite/gdb.tui/basic.exp
gdb/testsuite/lib/tuiterm.exp