Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH 2/6] gdb/testsuite: fix tuiterm linefeed scrolling new line content
Date: Fri,  1 May 2026 15:22:52 +0100	[thread overview]
Message-ID: <bcdad1db7a8c14147fd75ad1780edeaace5a213e.1777645161.git.aburgess@redhat.com> (raw)
In-Reply-To: <cover.1777645161.git.aburgess@redhat.com>

I came across a bug in the implementation of line feed in tuiterm.
Consider the gdb.tui/tuiterm.exp test 'test_linefeed_scroll', 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 sending the line feed we have:

    Screen Dump (size 8 columns x 4 rows, cursor at column 0, row 3):
        0 ijklmnop
        1 qrstuvwx
        2 yz01234
        3 yz01234

Notice that the new line #3 retains its previous contents, all lines
have scrolled up, with the old line #0 having been moved off the
terminal, but the new line is starting with these cloned contents.

I don't believe this is correct.  My understanding is that new lines
should be created empty -- or really full of space characters.

After fixing this issue so that new lines are created empty, the only
test failure is the tuiterm.exp unit test mentioned above, this was
added in commit:

  commit e20baea1298d2227db953862d131d9bbf91cf522
  Date:   Mon May 29 22:11:05 2023 +0200

      [gdb/testsuite] Fix linefeed scrolling in tuiterm

This commit is fixing an issue with cursor placement after a scroll,
there is no mention of the content of the new line, which makes me
think that the test is just checking whatever behaviour used to be
there.

In this commit I think we should fix the new line content, and update
the existing unit test to match the new behaviour.
---
 gdb/testsuite/gdb.tui/tuiterm.exp | 2 +-
 gdb/testsuite/lib/tuiterm.exp     | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.tui/tuiterm.exp b/gdb/testsuite/gdb.tui/tuiterm.exp
index ccf26195ddc..b6330b0d6a8 100644
--- a/gdb/testsuite/gdb.tui/tuiterm.exp
+++ b/gdb/testsuite/gdb.tui/tuiterm.exp
@@ -152,7 +152,7 @@ proc test_linefeed_scroll { } {
 	"ijklmnop"
 	"qrstuvwx"
 	"yz01234 "
-	"yz01234 "
+	"        "
     } 0 3
     Term::dump_screen
 }
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index a03c32b3f60..55b8e595604 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -165,6 +165,7 @@ proc Term::_ctl_0x0a {} {
 	    }
 
 	    incr _cur_row -1
+	    _clear_lines $_cur_row $_rows
 	}
     }
 }
-- 
2.25.4


  parent reply	other threads:[~2026-05-01 14:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 14:22 [PATCH 0/6] gdb/tui: fix debuginfod related crash Andrew Burgess
2026-05-01 14:22 ` [PATCH 1/6] gdb/tui: convert a window handle `if` into an `assert` Andrew Burgess
2026-05-01 14:22 ` Andrew Burgess [this message]
2026-05-01 14:22 ` [PATCH 3/6] gdb/tui: prevent TUI activation from a secondary prompt Andrew Burgess
2026-05-01 14:22 ` [PATCH 4/6] gdb/tui: make tui_win_info::rerender public Andrew Burgess
2026-05-01 14:22 ` [PATCH 5/6] gdb/tui: fix for debuginfod prompt while enabling the TUI Andrew Burgess
2026-05-01 14:22 ` [PATCH 6/6] gdb/tui: fix debuginfod prompt using 'C-x C-a' to enter TUI Andrew Burgess
2026-07-10  9:47 ` [PATCHv2 0/6] gdb/tui: fix debuginfod related crash Andrew Burgess
2026-07-10  9:47   ` [PATCHv2 1/6] gdb/tui: convert a window handle `if` into an `assert` Andrew Burgess
2026-07-10  9:47   ` [PATCHv2 2/6] gdb/testsuite: fix tuiterm linefeed scrolling new line content Andrew Burgess
2026-07-10  9:47   ` [PATCHv2 3/6] gdb/tui: prevent TUI activation from a secondary prompt Andrew Burgess
2026-07-10  9:47   ` [PATCHv2 4/6] gdb/tui: make tui_win_info::rerender public Andrew Burgess
2026-07-10  9:47   ` [PATCHv2 5/6] gdb/tui: fix for debuginfod prompt while enabling the TUI Andrew Burgess
2026-07-10  9:47   ` [PATCHv2 6/6] gdb/tui: fix debuginfod prompt using 'C-x C-a' to enter TUI Andrew Burgess
2026-07-27 15:50   ` [PATCHv2 0/6] gdb/tui: fix debuginfod related crash Andrew Burgess

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=bcdad1db7a8c14147fd75ad1780edeaace5a213e.1777645161.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --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