Next: TUI Configuration, Previous: TUI Mouse Support, Up: TUI
The TUI has specific commands to control the text windows. These commands are always available, even when gdb is not in the TUI mode. When gdb is in the standard mode, most of these commands will automatically switch to the TUI mode.
Note that if gdb's stdout
is not connected to a
terminal, or gdb has been started with the machine interface
interpreter (see The gdb/mi Interface), most of
these commands will fail with an error, because it would not be
possible or desirable to enable curses window management.
tui enable
tui disable
info win
tui new-layout
name window weight [window weight...
]layout
command (see below).
Each 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
focus
command (see below); additional, the status
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 `0' here.
A window description looks a bit like an invocation of tui
new-layout
, and is of the form
{[-horizontal
]window weight [window weight...]}.
This specifies a sub-layout. If -horizontal
is given, the
windows in this description will be arranged side-by-side, rather than
top-to-bottom.
Each weight is an integer. It is the weight of this window relative to all the other windows in the layout. These numbers are used to calculate how much of the screen is given to each window.
For example:
(gdb) tui new-layout example src 1 regs 1 status 0 cmd 1
Here, the new layout is called `example'. It shows the source 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:
(gdb) tui new-layout example {-horizontal src 1 asm 1} 2 status 0 cmd 1
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.
layout
nametui new-layout
.
The built-in layouts are as follows:
next
prev
src
asm
split
regs
src
layout display the register, source, and command
windows. When in asm
or split
layout display the
register, assembler, and command windows.
focus
namenext
prev
src
asm
regs
cmd
refresh
tui reg
groupnext
prev
general
float
system
vector
all
update
winheight
name +
countwinheight
name -
count