Files
binutils-gdb/gdb/testsuite/gdb.tui
Tom de Vries 546ddc53ee [gdb/testsuite] Disable CLI styling by default in Term::prepare_tui
On x86_64-freebsd, with test-case gdb.tui/main.exp, I ran into a failure to
match the output of the file command, for which I submitted a patch [1].

However, after switching to TERM=ansiw for bsd, I could no longer reproduce
the problem.

Investigation showed that the difference was caused by CLI styling.

A command:
...
(gdb) file <filename>
...
gives an output:
...
Reading symbols from <filename>...
(gdb)
...

On x86_64-linux, with CLI styling I get:
...
Reading symbols from ^[[32m/data/vries/gdb/leap-15-6/build/gdb/testsuite/outputs/gdb.tui/main/main^[[39m^[[0;10m...
...

After disabling CLI styling using "set style enabled off", I simply get:
...
Reading symbols from /data/vries/gdb/leap-15-6/build/gdb/testsuite/outputs/gdb.tui/main/main...
...
and run into the same failure as on x86_64-freebsd.

The extra csi sequence "^[[32m" causes an additional matching attempt in
Term::wait_for, and the way we're currently matching relies on this:
...
send_gdb "file [standard_output_file $testfile]\n"
gdb_assert { [Term::wait_for "Reading symbols from"] } "file command"
...

Make the TUI testsuite more stable and matching more simple by disabling CLI
styling by default, and:
- fix the resulting fallout in test-cases gdb.tui/main.exp and
  gdb.tui/new-layout.exp, and
- re-enable CLI styling in the one test-case that needs it:
  gdb.tui/tui-disasm-styling.exp.

Tested on x86_64-linux.

[1] https://sourceware.org/pipermail/gdb-patches/2025-June/218942.html
2025-08-14 15:49:20 +02:00
..