aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-07-28 15:02:35 -0600
committerTom Tromey <tom@tromey.com>2019-07-29 16:06:58 -0600
commit3d2357068b03edc850b3d84a27dbe6ad12a66d6f (patch)
tree0f254b2214f49c81c68e12075518850752f0bb75 /gdb/testsuite
parentbc4268a5d926c8f29e42d245322145dad131627f (diff)
downloadgdb-3d2357068b03edc850b3d84a27dbe6ad12a66d6f.zip
gdb-3d2357068b03edc850b3d84a27dbe6ad12a66d6f.tar.gz
gdb-3d2357068b03edc850b3d84a27dbe6ad12a66d6f.tar.bz2
Two fixes for test suite's terminal
Exactly which escape sequences are emitted by gdb in TUI mode are determined largely by the curses implementation. Testing my latest (as yet unsubmitted) series to refactor the TUI showed a couple of failures that I tracked to the test suite's terminal implementation. In particular, the CSI "@" sequence was not implemented; and the CSI "X" sequence was implemented incorrectly. This patch fixes both of these problems. Tested on x86-64 Fedora 28. gdb/testsuite/ChangeLog 2019-07-29 Tom Tromey <tom@tromey.com> * lib/tuiterm.exp (Term::_csi_@): New proc. (Term::_csi_X): Don't move cursor.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/lib/tuiterm.exp27
2 files changed, 31 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f176387..a0b5862 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-29 Tom Tromey <tom@tromey.com>
+
+ * lib/tuiterm.exp (Term::_csi_@): New proc.
+ (Term::_csi_X): Don't move cursor.
+
2019-07-29 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.base/options.exp: Update backtrace - completion to
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index c58b7cf..d94fd43 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -104,6 +104,21 @@ namespace eval Term {
set _cur_x 0
}
+ # Make room for characters.
+ proc _csi_@ {args} {
+ set n [_default [lindex $args 0] 1]
+ variable _cur_x
+ variable _cur_y
+ variable _chars
+ set in_x $_cur_x
+ set out_x [expr {$_cur_x + $n}]
+ for {set i 0} {$i < $n} {incr i} {
+ set _chars($out_x,$_cur_y) $_chars($in_x,$_cur_y)
+ incr in_x
+ incr out_x
+ }
+ }
+
# Cursor Up.
proc _csi_A {args} {
variable _cur_y
@@ -238,7 +253,17 @@ namespace eval Term {
# Erase chars.
proc _csi_X {args} {
set n [_default [lindex $args 0] 1]
- _insert [string repeat " " $n]
+ # Erase characters but don't move cursor.
+ variable _cur_x
+ variable _cur_y
+ variable _attrs
+ variable _chars
+ set lattr [array get _attrs]
+ set x $_cur_x
+ for {set i 0} {$i < $n} {incr i} {
+ set _chars($x,$_cur_y) [list " " $lattr]
+ incr x
+ }
}
# Repeat.