]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/testsuite] Fix gdb.tui/wrap-line.exp with wrapping disabled
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 12 Aug 2024 15:32:44 +0000 (17:32 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 12 Aug 2024 15:32:44 +0000 (17:32 +0200)
commit250f1bbaf33e25da8b6beaf2e0e8a46c46127b1b
tree5352e63ed8fc5e73e7805aba90e3e4db74f6e21b
parent37ef6d976a777f186568f2b629f04a6bd9706ed7
[gdb/testsuite] Fix gdb.tui/wrap-line.exp with wrapping disabled

There are a couple of ways that readline wrapping can be disabled:
- using "set horizontal-scroll-mode on" in INPUTRC,
- using a TERM setting like TERM=dumb, and
- building gdb with stub-termcap.

Using a trigger patch in default_gdb_init that adds
"set horizontal-scroll-mode on" to INPUTRC:
...
-    setenv INPUTRC [cached_file inputrc "set enable-bracketed-paste off"]
+    setenv INPUTRC [cached_file inputrc "set enable-bracketed-paste off\nset horizontal-scroll-mode on"]
...
we can easily reproduce a failure in gdb.tui/wrap-line.exp mentioned in
PR testsuite/31201 (which was reported for the stub-termcap case):
...
WARNING: timeout in accept_gdb_output
Screen Dump (size 50 columns x 24 rows, cursor at column 34, row 1):
    0 Quit
    1 <89012345678901234567890123456789W
    2
    ...
    23
FAIL: gdb.tui/wrap-line.exp: width-hard-coded: cli: wrap
...

Fix this by accepting the horizontal-scroll-mode style output.  We do
this only when in CLI mode though, when in TUI wrapping works as before
because it doesn't rely on readline.

Tested on x86_64-linux.

Co-Authored-By: Tom de Vries <tdevries@suse.de>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31201
gdb/testsuite/gdb.tui/wrap-line.exp