diff options
author | Tom de Vries <tdevries@suse.de> | 2025-07-23 22:14:58 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2025-07-23 22:14:58 +0200 |
commit | 6a82917ae30bfb9b778644a6b19d8d79ab04a068 (patch) | |
tree | 46ad786b3a8e2c01d73bbbd0f51ffef264776948 | |
parent | 93e5d03100d2f1dbd2aa2521b758f4f8c551d168 (diff) | |
download | binutils-6a82917ae30bfb9b778644a6b19d8d79ab04a068.zip binutils-6a82917ae30bfb9b778644a6b19d8d79ab04a068.tar.gz binutils-6a82917ae30bfb9b778644a6b19d8d79ab04a068.tar.bz2 |
[gdb/testsuite] Fix Term::_csi_m with no args
When calling Term::_csi_m with no args, default behaviour needs to be applied,
which is equivalent to "Term::_csi_m 0" [1].
However, while "Term::_csi_m 0" works, as well as 'Term::_csi_m ""', calling
Term::_csi_m with no args has no effect.
Fix this by implementing the default behaviour in Term::_csi_m.
Tested on aarch64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
[1] https://vt100.net/docs/vt510-rm/SGR.html
-rw-r--r-- | gdb/testsuite/gdb.tui/tuiterm.exp | 9 | ||||
-rw-r--r-- | gdb/testsuite/lib/tuiterm.exp | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.tui/tuiterm.exp b/gdb/testsuite/gdb.tui/tuiterm.exp index e58de68..6cd65f3 100644 --- a/gdb/testsuite/gdb.tui/tuiterm.exp +++ b/gdb/testsuite/gdb.tui/tuiterm.exp @@ -783,6 +783,15 @@ proc test_attrs {} { set line [Term::get_line_with_attrs 0] gdb_assert { [regexp $re $line] } "attribute: $attr" } + + # Regression test: Check that _csi_m works without arguments. + setup_terminal 4 1 + Term::_csi_m 7 + Term::_insert "a" + Term::_csi_m + Term::_insert "a" + set line [Term::get_line_with_attrs 0] + gdb_assert { [string equal $line "<reverse:1>a<reverse:0>a "] } } # Run proc TEST_PROC_NAME with a "small" terminal. diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index d4ba1ae..9ca8334 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -631,6 +631,11 @@ namespace eval Term { # # https://vt100.net/docs/vt510-rm/SGR.html proc _csi_m {args} { + if { [llength $args] == 0 } { + # Apply default. + set args [list 0] + } + _log_cur "Select Graphic Rendition ([join $args {, }])" { variable _attrs |