Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed 3/3] [gdb/testsuite] Add gdb.tui/scroll-bottom-right.exp
Date: Fri, 16 Oct 2026 13:31:23 +0200	[thread overview]
Message-ID: <20261016113123.6460-4-tdevries@suse.de> (raw)
In-Reply-To: <20261016113123.6460-1-tdevries@suse.de>

Add a test-case where gdb triggers the situation where tuiterm used to run
into a "FIXME scroll" error.
---
 gdb/testsuite/gdb.tui/scroll-bottom-right.exp | 62 +++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 gdb/testsuite/gdb.tui/scroll-bottom-right.exp

diff --git a/gdb/testsuite/gdb.tui/scroll-bottom-right.exp b/gdb/testsuite/gdb.tui/scroll-bottom-right.exp
new file mode 100644
index 00000000000..ff00e90bb56
--- /dev/null
+++ b/gdb/testsuite/gdb.tui/scroll-bottom-right.exp
@@ -0,0 +1,62 @@
+# Copyright 2026 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Regression test for "FIXME scroll" in Term::_insert.  Insert a character when
+# the current position is at the bottom-right corner.
+
+tuiterm_env
+
+require allow_tui_tests
+
+Term::clean_restart 24 80
+
+set last_line {0 23 80 1}
+
+# Get prompt on last line.
+set cmd "echo "
+for { set i 0 } { $i < 24 } { incr i } {
+    set cmd "${cmd}${i}\\n"
+}
+send_gdb "$cmd\n"
+gdb_assert \
+    {[Term::wait_for_region_contents {*}$last_line "^$gdb_prompt"]} \
+    "prompt on last line"
+
+set str10 0123456789
+set str60 $str10$str10$str10$str10$str10$str10
+send_gdb "echo $str60"
+gdb_assert \
+    {[Term::wait_for_region_contents {*}$last_line "^$gdb_prompt echo $str60"]} \
+    "setup for scroll"
+
+# Trigger scroll in Term::_insert.  This used to trigger error "FIXME scroll".
+send_gdb "$str10"
+gdb_assert \
+    {[Term::wait_for_region_contents {*}$last_line "^9"]} \
+    "scroll"
+
+# Get back prompt.
+send_gdb "\n"
+gdb_assert \
+    {[Term::wait_for_region_contents {*}$last_line "$gdb_prompt"]} \
+    "got back prompt"
+
+# Send ^L to get prompt at left border.  Echo doesn't add an implicit newline,
+# so the prompt is now near the right border.
+send_gdb "\014"
+gdb_assert {[Term::wait_for ""]} "prompt at left border"
+
+# Check that gdb is responsive.
+gdb_assert {[Term::command "print 1"]} "responsive prompt"
-- 
2.51.0


      parent reply	other threads:[~2026-10-16 11:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 11:31 [pushed 0/3] [gdb/testsuite] Fix "FIXME scroll" error in Term::_insert Tom de Vries
2026-10-16 11:31 ` [pushed 1/3] [gdb/testsuite] Factor out Term::_scroll Tom de Vries
2026-10-16 11:31 ` [pushed 2/3] [gdb/testsuite] Fix "FIXME scroll" error in Term::_insert Tom de Vries
2026-10-16 11:31 ` Tom de Vries [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261016113123.6460-4-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox