aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2025-07-23 20:28:46 +0200
committerTom de Vries <tdevries@suse.de>2025-07-23 20:28:46 +0200
commit3786ec669c6075a5c5cb99efe0c369b7a07ca8d3 (patch)
tree87c413be9ce965fde71c8b39624e0d68b05f3ee3
parent63338cd5683d7d48a8bfca8c026543566d3f461b (diff)
downloadbinutils-3786ec669c6075a5c5cb99efe0c369b7a07ca8d3.zip
binutils-3786ec669c6075a5c5cb99efe0c369b7a07ca8d3.tar.gz
binutils-3786ec669c6075a5c5cb99efe0c369b7a07ca8d3.tar.bz2
[gdb/testsuite] Handle Horizontal Position Absolute in tuiterm
I ran the tui testsuite on freebsd with TERM=ansiw, and investigated the first failure, in test-case gdb.tui/tui-init-source.exp. The problem turned out to be the lack of handling a Horizontal Position Absolute [1] sequence "^[[80`" in tuiterm. Add Term::_csi_`, forwarding to Term::_csi_G which handles Cursor Horizontal Absolute [2]. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com> [1] https://vt100.net/docs/vt510-rm/HPA.html [2] https://vt100.net/docs/vt510-rm/CHA.html
-rw-r--r--gdb/testsuite/gdb.tui/tuiterm.exp8
-rw-r--r--gdb/testsuite/lib/tuiterm.exp10
2 files changed, 17 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.tui/tuiterm.exp b/gdb/testsuite/gdb.tui/tuiterm.exp
index fff7c37..0e03bfa 100644
--- a/gdb/testsuite/gdb.tui/tuiterm.exp
+++ b/gdb/testsuite/gdb.tui/tuiterm.exp
@@ -451,6 +451,14 @@ proc test_horizontal_absolute { } {
"qrstuvwx"
"yz01234 "
} 7 2
+
+ Term::_csi_`
+ check "horizontal position absolute 1" {
+ "abcdefgh"
+ "ijklmnop"
+ "qrstuvwx"
+ "yz01234 "
+ } 0 2
}
proc test_cursor_position { } {
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index 71ef6a4..2268b1e 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -155,6 +155,14 @@ namespace eval Term {
}
}
+ # Horizontal Position Absolute.
+ #
+ # https://vt100.net/docs/vt510-rm/HPA.html
+ proc _csi_` {args} {
+ # Same as Cursor Horizontal Absolute.
+ return [Term::_csi_G {*}$args]
+ }
+
# Cursor Up.
#
# https://vt100.net/docs/vt510-rm/CUU.html
@@ -740,7 +748,7 @@ namespace eval Term {
_log "wait_for: unsupported escape"
error "unsupported escape"
}
- -re "^\x1b\\\[(\[0-9;\]*)(\[a-zA-Z@\])" {
+ -re "^\x1b\\\[(\[0-9;\]*)(\[a-zA-Z@`\])" {
set cmd $expect_out(2,string)
set params [split $expect_out(1,string) ";"]
_log "wait_for: _csi_$cmd <<<$expect_out(1,string)>>>"