aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/tuiterm.exp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-05-29 22:11:05 +0200
committerTom de Vries <tdevries@suse.de>2023-05-29 22:11:05 +0200
commite20baea1298d2227db953862d131d9bbf91cf522 (patch)
tree0f35bcd45efa1af79f81b996c2e37641aee22033 /gdb/testsuite/lib/tuiterm.exp
parentf818c32ba4596a60e77b464cb690aea65ed31346 (diff)
downloadgdb-e20baea1298d2227db953862d131d9bbf91cf522.zip
gdb-e20baea1298d2227db953862d131d9bbf91cf522.tar.gz
gdb-e20baea1298d2227db953862d131d9bbf91cf522.tar.bz2
[gdb/testsuite] Fix linefeed scrolling in tuiterm
I came across a bug in the implementation of line feed in tuiterm, and added a unit test that exposes it. Before sending the line feed we have: ... Screen Dump (size 8 columns x 4 rows, cursor at column 0, row 3): 0 abcdefgh 1 ijklmnop 2 qrstuvwx 3 yz01234 ... and after it we have: ... Screen Dump (size 8 columns x 4 rows, cursor at column 0, row 1): 0 ijklmnop 1 qrstuvwx 2 yz01234 3 yz01234 ... Note how the cursor started at row 3 and after the line feed ended up at row 1, while it should have stayed in row 3. Fix this by moving "incr _cur_row -1" one level up in the loop nest in proc _ctl_0x0a. Tested on x86_64-linux.
Diffstat (limited to 'gdb/testsuite/lib/tuiterm.exp')
-rw-r--r--gdb/testsuite/lib/tuiterm.exp3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index b7c8775..96f9b9d 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -115,8 +115,9 @@ namespace eval Term {
for {set x 0} {$x < $_cols} {incr x} {
set _chars($x,$y) $_chars($x,$next_y)
}
- incr _cur_row -1
}
+
+ incr _cur_row -1
}
}
}