]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/testsuite] Add Term::get_string_with_attrs in tuiterm
authorTom de Vries <tdevries@suse.de>
Thu, 24 Jul 2025 10:06:40 +0000 (12:06 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 24 Jul 2025 10:06:40 +0000 (12:06 +0200)
commit6638cfadb9b78db0da1bf6cd01c2f11e2bc22e74
tree42bb0e64805827caf62e1dbe560d23c5c3f82cbb
parent6d8ace9ffd8e9e8cc7fd36d7a06c2da885705eee
[gdb/testsuite] Add Term::get_string_with_attrs in tuiterm

While reading a gdb.log for test-case gdb.tui/main-2.exp, I noticed that this
line was somewhat hard to read:
...
screen line 6: '<fg:cyan><intensity:bold>|<fg:default><intensity:normal>B+>    21 <reverse:1>  return 0;<reverse:0>                                                         <fg:cyan><intensity:bold>|<fg:default><intensity:normal>'
...
because of the border attributes.

Then I realized that the test-case is only interested in the text between the
borders, so I added a proc Term::get_string_with_attrs that allows me to drop
the borders, getting us instead:
...
screen line 6: 'B+>    21 <reverse:1>  return 0;<reverse:0>                                                         '
...

Tested on aarch64-linux.
gdb/testsuite/gdb.tui/main-2.exp
gdb/testsuite/lib/tuiterm.exp