From: Tom de Vries Date: Wed, 23 Jul 2025 18:28:46 +0000 (+0200) Subject: [gdb/testsuite] Handle Horizontal Position Absolute in tuiterm X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3786ec669c6075a5c5cb99efe0c369b7a07ca8d3;p=thirdparty%2Fbinutils-gdb.git [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 [1] https://vt100.net/docs/vt510-rm/HPA.html [2] https://vt100.net/docs/vt510-rm/CHA.html --- diff --git a/gdb/testsuite/gdb.tui/tuiterm.exp b/gdb/testsuite/gdb.tui/tuiterm.exp index fff7c37a56e..0e03bfaa8ea 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 71ef6a4eacd..2268b1e28e0 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)>>>"