[0/3,gdb/tui] Allow highlighting in windows contents to be switched off

Message ID 20230516084352.27225-1-tdevries@suse.de
Series Allow highlighting in windows contents to be switched off |


Tom de Vries May 16, 2023, 8:43 a.m. UTC
  While trying to stress test TUI by stepi-ing through some program using the
press-and-hold-enter method, I noticed the highlighting of the current execution
point and the changed registers, and found it a bit intrusive.

I decided to make all highlighting in windows contents optional (in window
borders it already is).

Also the entire contents of the status window is highlighted, so I've added a
"set tui status-window-mode <mode>", similar to border-mode and
active-border-mode.  The highlighting is static, while the highlighting in
other windows is dynamic, so I figured it deserves its own option.

For the disassembly, source and register window, I've introduced
"set tui contents-highlight on/off".  Note that I could have used also a <mode>
argument, but in the disassembly and source window we use reverse while
in the register window we use standout, so that would have meant changing the
default for one or the other.  Alternatively, we could have added independent
options for this "set tui source-highlight-mode <mode>" and
"set tui regs-highlight-mode <mode>", but I was not sure whether that was
splitting up control of behavour in too much detail.

After playing around with the "set tui contents-highlight off" setting, I
noticed that while in the source and assembly window you can still see the
current execution point (indicated by a ">" marker), that's no longer the case
for the changed registers in the registers window.  So I added a ">" marker
there as well.

In order to be able to test this, I've added the ability to annotate a tuiterm
line with the active attributes changes, such that "set tui status-window-mode
standout" looks like this:
   <reverse:1>exec No process In:                   L??   PC: ?? <reverse:0>
and "set tui status-window-mode normal" looks like this:
   exec No process In:                   L??   PC: ??

Tested on x86_64-linux.

Tom de Vries (3):
  [gdb/tui] Add set tui status-window-mode <mode>
  [gdb/tui] Use ">" marker in register window
  [gdb/tui] Add set tui contents-highlight on/off

 gdb/doc/gdb.texinfo              | 13 +++++
 gdb/testsuite/gdb.tui/basic.exp  | 13 +++++
 gdb/testsuite/gdb.tui/regs-2.c   | 36 ++++++++++++
 gdb/testsuite/gdb.tui/regs-2.exp | 66 ++++++++++++++++++++++
 gdb/testsuite/gdb.tui/source.exp | 59 ++++++++++++++++++++
 gdb/testsuite/lib/tuiterm.exp    | 84 +++++++++++++++++++++-------
 gdb/tui/tui-regs.c               | 49 ++++++++++++++--
 gdb/tui/tui-regs.h               |  4 +-
 gdb/tui/tui-stack.c              | 10 +---
 gdb/tui/tui-win.c                | 95 ++++++++++++++++++++++++++++++++
 gdb/tui/tui-win.h                |  7 +++
 gdb/tui/tui-winsource.c          |  4 +-
 12 files changed, 406 insertions(+), 34 deletions(-)
 create mode 100644 gdb/testsuite/gdb.tui/regs-2.c
 create mode 100644 gdb/testsuite/gdb.tui/regs-2.exp
 create mode 100644 gdb/testsuite/gdb.tui/source.exp

base-commit: b10f2cd3f3c3b25c71e50a342fb46f9eb9eba792