diff options
author | Tom de Vries <tdevries@suse.de> | 2024-09-24 13:26:15 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-09-24 13:26:15 +0200 |
commit | 7ba8082f030c44b15616336f7dee7ee1df74ba21 (patch) | |
tree | 094d3f8937dfc9da30ef7f9ab3cd666e3d45080a /gdb/testsuite/gdb.python/py-pp-cast.py | |
parent | e1863c7d7cf84e3a5ef4eaa880f024c94202eb84 (diff) | |
download | binutils-7ba8082f030c44b15616336f7dee7ee1df74ba21.zip binutils-7ba8082f030c44b15616336f7dee7ee1df74ba21.tar.gz binutils-7ba8082f030c44b15616336f7dee7ee1df74ba21.tar.bz2 |
[gdb/cli] Show readline wrapping mode for maint info screen
With the same trigger patch adding "set horizontal-scroll-mode on" to INPUTRC
as used in commit 250f1bbaf33 ("[gdb/testsuite] Fix gdb.tui/wrap-line.exp with
wrapping disabled"), we can easily reproduce a failure in
gdb.tui/wrap-line.exp mentioned in PR testsuite/31201:
...
(gdb) 78901234567890123456789012345678901234567890123456789012345678901234567^M<890123456789012345678901234567890123456789012345678 ^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H9WFAIL: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: wrap (timeout)
...
The test-case expects wrapping, but that's disabled by horizontal-scroll-mode.
Add a new line to "maint info screen", that describes the current readline
wrapping mode, and use it in the test-case to handle the different cases.
The reported values for the wrapping mode are as follows.
Unsupported because of running in batch mode:
...
$ gdb -q -batch -ex "maint info screen"
Readline wrapping mode: unsupported (gdb batch mode).
...
Unsupported because the terminal is not capable to move the cursor up:
...
$ TERM=dumb gdb -q -ex "maint info screen" -ex q
Readline wrapping mode: unsupported (terminal is not Cursor Up capable).
...
Disabled by horizontal-scroll-mode:
...
$ grep horizontal-scroll-mode ~/.inputrc
set horizontal-scroll-mode on
$ gdb -q -ex "maint info screen" -ex q
Readline wrapping mode: disabled (horizontal-scroll-mode).
...
Wrap done by readline because terminal is not auto wrap capable:
...
$ TERM=ansi gdb -q -ex "maint info screen" -ex q
Readline wrapping mode: readline (terminal is not auto wrap capable, last column reserved).
...
Wrap done by terminal autowrap:
...
$ TERM=xterm gdb -q -ex "maint info screen" -ex q
Readline wrapping mode: terminal (terminal is auto wrap capable).
...
Tested on x86_64-linux.
Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31201
Diffstat (limited to 'gdb/testsuite/gdb.python/py-pp-cast.py')
0 files changed, 0 insertions, 0 deletions