[RFC] TUI windows for locals/display/threads/frames/memory

Hannes Domani ssbssa@yahoo.de
Sat Mar 6 17:33:55 GMT 2021


This series adds rudimentary mouse support and uses the python TUI window API
to create these windows:
- locals
  Shows the values of the local variables.
- display
  Shows the values of the automatic display variables.
- threads
  Shows the currently known threads.
- frames
  Shows all stack frames of the current thread.
- memory
  Shows the hexadecimal values of some memory, the start address is
  set with the new 'memory' command.

In the variable windows, a left click shows the children of the value on
the clicked line.
A right click on a value with address sets a convenience variable
with the pointer to this value (either $dv (display variable) or
$lv (local variable)).
And a middle click copies the text representation of the value to the
clipboard.

A left click on the threads/frames window selects this thread/frame.

It's also possible to create custom windows with the output of a gdb
command, e.g.:
(gdb) cccw shared-libs "info sharedlibrary"
This creates a window named "shared-libs", and shows the output of
"info sharedlibrary".

This also creates a few TUI layouts, and short aliases for them, e.g.:
(gdb) lldf
This opens the layout locals-display-frames.

Patch 20 changes the pretty printers in gdb-gdb.py to use children()
instead of to_string() for the output of their childs, so they can be
expanded in the variable windows.


This series still needs a lot of cleanup, in particular:
- Add comments.
- Refactor/rewrite VariableWindow::add_val().
- The display window uses the 'info display' output, since there is no
  python API to access the automatic display variables.
- Patches 14/16/18 may be counted as ugly hacks.

Knowing that I still would like some feedback on its current state.


[PATCH 01/22] Initial TUI mouse support
[PATCH 02/22] Create/disable/enable/delete breakpoints in TUI with
[PATCH 03/22] Forward mouse click to python TUI window
[PATCH 04/22] Prevent flickering when redrawing the TUI python window
[PATCH 05/22] Implement locals TUI window
[PATCH 06/22] Implement display TUI window
[PATCH 07/22] Implement threads TUI window
[PATCH 08/22] Implement frames TUI window
[PATCH 09/22] Implement cccw TUI command
[PATCH 10/22] Add optional styled argument to gdb.execute
[PATCH 11/22] Use styled argument of gdb.execute() for cccw command
[PATCH 12/22] Add optional full_window argument to TuiWindow.write
[PATCH 13/22] Use the full_window argument of TuiWindow.write to
[PATCH 14/22] Add set_tui_auto_display python function
[PATCH 15/22] Disable automatic display while the display window is
[PATCH 16/22] Show raw flag in info display
[PATCH 17/22] Use the raw flag of automatic display to disable pretty
[PATCH 18/22] Update the source location with Frame.select
[PATCH 19/22] Refresh the TUI source window when changing the frame
[PATCH 20/22] Use method children instead of to_string in pretty
[PATCH 21/22] Implement memory TUI window
[PATCH 22/22] Copy variable value to clipboard on middle-click



More information about the Gdb-patches mailing list