aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-02-22 11:48:26 -0700
committerTom Tromey <tom@tromey.com>2020-02-22 11:48:33 -0700
commit7c043ba695a3cee067554b1e871e60f7934512b4 (patch)
tree6943c911cf3ad9ad274ead117e0dd60a2de89858 /gdb/doc
parent6bc5664858d6869513b9b98861c813675231e5b5 (diff)
downloadbinutils-7c043ba695a3cee067554b1e871e60f7934512b4.zip
binutils-7c043ba695a3cee067554b1e871e60f7934512b4.tar.gz
binutils-7c043ba695a3cee067554b1e871e60f7934512b4.tar.bz2
Add horizontal splitting to TUI layout
This changes the TUI layout engine to add horizontal splitting. Now, windows can be side-by-side. A horizontal split is defined using the "-horizontal" parameter to "tui new-layout". This also adds the first "winheight" test to the test suite. One open question is whether we want a new "winwidth" command, now that horizontal layouts are possible. This is easily done using the generic layout code. gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> PR tui/17850: * tui/tui-win.c (tui_gen_win_info::max_width): New method. * tui/tui-layout.h (class tui_layout_base) <get_sizes>: Add "height" argument. (class tui_layout_window) <get_sizes>: Likewise. (class tui_layout_split) <tui_layout_split>: Add "vertical" argument. <get_sizes>: Add "height" argument. <m_vertical>: New field. * tui/tui-layout.c (tui_layout_split::clone): Update. (tui_layout_split::get_sizes): Add "height" argument. (tui_layout_split::adjust_size, tui_layout_split::apply): Update. (tui_new_layout_command): Parse "-horizontal". (_initialize_tui_layout): Update help string. (tui_layout_split::specification): Add "-horizontal" when needed. * tui/tui-layout.c (tui_layout_window::get_sizes): Add "height" argument. * tui/tui-data.h (struct tui_gen_win_info) <max_width, min_width>: New methods. gdb/doc/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> PR tui/17850: * gdb.texinfo (TUI Commands): Document horizontal layouts. gdb/testsuite/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> PR tui/17850: * gdb.tui/new-layout.exp: Add horizontal layout and winheight tests. Change-Id: I38b35e504f34698578af86686be03c0fefd954ae
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdb.texinfo31
2 files changed, 32 insertions, 4 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 99f2d93..2b6bbc8 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,5 +1,10 @@
2020-02-22 Tom Tromey <tom@tromey.com>
+ PR tui/17850:
+ * gdb.texinfo (TUI Commands): Document horizontal layouts.
+
+2020-02-22 Tom Tromey <tom@tromey.com>
+
* gdb.texinfo (TUI Overview): Mention user layouts.
(TUI Commands): Document "tui new-layout".
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index c261738..0645fb0 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -27998,11 +27998,23 @@ List and give the size of all displayed windows.
Create a new TUI layout. The new layout will be named @var{name}, and
can be accessed using the @code{layout} command (see below).
-Each @var{window} parameter is the name of a window to display. The
-windows will be displayed from top to bottom in the order listed. The
-names of the windows are the same as the ones given to the
+Each @var{window} parameter is either the name of a window to display,
+or a window description. The windows will be displayed from top to
+bottom in the order listed.
+
+The names of the windows are the same as the ones given to the
@code{focus} command (see below); additional, the @code{status}
-window can be specified.
+window can be specified. Note that, because it is of fixed height,
+the weight assigned to the status window is of no importance. It is
+conventional to use @samp{0} here.
+
+A window description looks a bit like an invocation of @code{tui
+new-layout}, and is of the form
+@{@r{[}@code{-horizontal}@r{]}@var{window} @var{weight} @r{[}@var{window} @var{weight}@dots{}@r{]}@}.
+
+This specifies a sub-layout. If @code{-horizontal} is given, the
+windows in this description will be arranged side-by-side, rather than
+top-to-bottom.
Each @var{weight} is an integer. It is the weight of this window
relative to all the other windows in the layout. These numbers are
@@ -28019,6 +28031,17 @@ and register windows, followed by the status window, and then finally
the command window. The non-status windows all have the same weight,
so the terminal will be split into three roughly equal sections.
+Here is a more complex example, showing a horizontal layout:
+
+@example
+(gdb) tui new-layout example @{-horizontal src 1 asm 1@} 2 status 0 cmd 1
+@end example
+
+This will result in side-by-side source and assembly windows; with the
+status and command window being beneath these, filling the entire
+width of the terminal. Because they have weight 2, the source and
+assembly windows will be twice the height of the command window.
+
@item layout @var{name}
@kindex layout
Changes which TUI windows are displayed. The @var{name} parameter