[00/14] Cleanups for the TUi register window

Message ID 20231217-tui-regs-cleanup-v1-0-67bd0ea1e8be@tromey.com
Headers
Series Cleanups for the TUi register window |

Message

Tom Tromey Dec. 17, 2023, 7:50 p.m. UTC
  This series is a grab-bag of cleanups to the TUI register window.

I've tried to untangle the code somewhat, with the goal being removing
the extra rerender overload.

This series also fixes the 'exit' bug and removes the hacky and
unnecessary recursion flag from tui-hooks.c.

More cleanups here are possible -- the register window is pretty old
code and pretty ugly.  In particular:

* the layout code is still pretty bad

* it doesn't really make sense for check_register_values to accept a
  frame, because the window can only really ever use the selected
  frame anyway

* there's no horizontal scrolling, but for vector registers this might
  be nice (there's a bug about this)

---
Tom Tromey (14):
      Use pop_back in tui_register_format
      Minor C++ cleanups in tui-regs.c
      Simplify tui_data_window::show_register_group
      Rename tui_data_item_window -> tui_register_info
      Remove tui_register_info::visible
      Move scrollok call in register window
      Simplify update_register_data
      Remove the TUI register window rerender overload
      Simplify tui_data_win::erase_data_content
      Remove tui_refreshing_registers
      Remove redundant check from tui_refresh_frame_and_register_information
      Return void from tui_show_frame_info
      Rename show_registers -> set_register_group
      Update TUI register window when the inferior exits

 gdb/testsuite/gdb.tui/regs.exp |   8 ++
 gdb/tui/tui-hooks.c            |  36 +++----
 gdb/tui/tui-regs.c             | 220 +++++++++++++++--------------------------
 gdb/tui/tui-regs.h             |  47 +++++----
 gdb/tui/tui-stack.c            |  16 ++-
 gdb/tui/tui-stack.h            |   2 +-
 6 files changed, 137 insertions(+), 192 deletions(-)
---
base-commit: 2757c1c65fd6ba10c55ba5cf38d600814cf9dc1b
change-id: 20231217-tui-regs-cleanup-36d8f390a65a

Best regards,
  

Comments

Tom de Vries Dec. 18, 2023, 2:07 p.m. UTC | #1
On 12/17/23 20:50, Tom Tromey wrote:
> This series is a grab-bag of cleanups to the TUI register window.
> 
> I've tried to untangle the code somewhat, with the goal being removing
> the extra rerender overload.
> 
> This series also fixes the 'exit' bug and removes the hacky and
> unnecessary recursion flag from tui-hooks.c.
> 

I've applied the series and tested the TUI test-cases, all looks good.

I've also confirmed that killing an inferior gets us "no registers 
available".

Tested-By: Tom de Vries <tdevries@suse.de>

Thanks,
- Tom

> More cleanups here are possible -- the register window is pretty old
> code and pretty ugly.  In particular:
> 
> * the layout code is still pretty bad
> 
> * it doesn't really make sense for check_register_values to accept a
>    frame, because the window can only really ever use the selected
>    frame anyway
> 
> * there's no horizontal scrolling, but for vector registers this might
>    be nice (there's a bug about this)
> 
> ---
> Tom Tromey (14):
>        Use pop_back in tui_register_format
>        Minor C++ cleanups in tui-regs.c
>        Simplify tui_data_window::show_register_group
>        Rename tui_data_item_window -> tui_register_info
>        Remove tui_register_info::visible
>        Move scrollok call in register window
>        Simplify update_register_data
>        Remove the TUI register window rerender overload
>        Simplify tui_data_win::erase_data_content
>        Remove tui_refreshing_registers
>        Remove redundant check from tui_refresh_frame_and_register_information
>        Return void from tui_show_frame_info
>        Rename show_registers -> set_register_group
>        Update TUI register window when the inferior exits
> 
>   gdb/testsuite/gdb.tui/regs.exp |   8 ++
>   gdb/tui/tui-hooks.c            |  36 +++----
>   gdb/tui/tui-regs.c             | 220 +++++++++++++++--------------------------
>   gdb/tui/tui-regs.h             |  47 +++++----
>   gdb/tui/tui-stack.c            |  16 ++-
>   gdb/tui/tui-stack.h            |   2 +-
>   6 files changed, 137 insertions(+), 192 deletions(-)
> ---
> base-commit: 2757c1c65fd6ba10c55ba5cf38d600814cf9dc1b
> change-id: 20231217-tui-regs-cleanup-36d8f390a65a
> 
> Best regards,
  
Andrew Burgess Dec. 19, 2023, 10:31 a.m. UTC | #2
Tom Tromey <tom@tromey.com> writes:

> This series is a grab-bag of cleanups to the TUI register window.
>
> I've tried to untangle the code somewhat, with the goal being removing
> the extra rerender overload.
>
> This series also fixes the 'exit' bug and removes the hacky and
> unnecessary recursion flag from tui-hooks.c.
>
> More cleanups here are possible -- the register window is pretty old
> code and pretty ugly.  In particular:
>
> * the layout code is still pretty bad
>
> * it doesn't really make sense for check_register_values to accept a
>   frame, because the window can only really ever use the selected
>   frame anyway
>
> * there's no horizontal scrolling, but for vector registers this might
>   be nice (there's a bug about this)

Thanks.  A nice set of improvements.  Read through the series, replied
where I had feedback.

Reviewed-By: Andrew Burgess <aburgess@redhat.com>

Thanks,
Andrew



>
> ---
> Tom Tromey (14):
>       Use pop_back in tui_register_format
>       Minor C++ cleanups in tui-regs.c
>       Simplify tui_data_window::show_register_group
>       Rename tui_data_item_window -> tui_register_info
>       Remove tui_register_info::visible
>       Move scrollok call in register window
>       Simplify update_register_data
>       Remove the TUI register window rerender overload
>       Simplify tui_data_win::erase_data_content
>       Remove tui_refreshing_registers
>       Remove redundant check from tui_refresh_frame_and_register_information
>       Return void from tui_show_frame_info
>       Rename show_registers -> set_register_group
>       Update TUI register window when the inferior exits
>
>  gdb/testsuite/gdb.tui/regs.exp |   8 ++
>  gdb/tui/tui-hooks.c            |  36 +++----
>  gdb/tui/tui-regs.c             | 220 +++++++++++++++--------------------------
>  gdb/tui/tui-regs.h             |  47 +++++----
>  gdb/tui/tui-stack.c            |  16 ++-
>  gdb/tui/tui-stack.h            |   2 +-
>  6 files changed, 137 insertions(+), 192 deletions(-)
> ---
> base-commit: 2757c1c65fd6ba10c55ba5cf38d600814cf9dc1b
> change-id: 20231217-tui-regs-cleanup-36d8f390a65a
>
> Best regards,
> -- 
> Tom Tromey <tom@tromey.com>