The gdb Text User Interface, TUI in short,
is a terminal interface which uses the curses library
to show the source file, the assembly output, the program registers
and gdb commands in separate text windows.
The TUI is available only when gdb is configured
with the -enable-tui configure option (refer to Section B.3 configure options).
24.1. TUI overview
The TUI has two display modes that can be switched while
gdb runs:
In the TUI mode, gdb can display several text window
on the terminal:
- command
This window is the gdb command window with the gdb
prompt and the gdb outputs. The gdb input is still
managed using readline but through the TUI. The command
window is always visible.
- source
The source window shows the source file of the program. The current
line as well as active breakpoints are displayed in this window.
- assembly
The assembly window shows the disassembly output of the program.
- register
This window shows the processor registers. It detects when
a register is changed and when this is the case, registers that have
changed are highlighted.
The source and assembly windows show the current program position
by highlighting the current line and marking them with the > marker.
Breakpoints are also indicated with two markers. A first one
indicates the breakpoint type:
- B
Breakpoint which was hit at least once.
- b
Breakpoint which was never hit.
- H
Hardware breakpoint which was hit at least once.
- h
Hardware breakpoint which was never hit.
The second marker indicates whether the breakpoint is enabled or not:
- +
Breakpoint is enabled.
- -
Breakpoint is disabled.
The source, assembly and register windows are attached to the thread
and the frame position. They are updated when the current thread
changes, when the frame changes or when the program counter changes.
These three windows are arranged by the TUI according to several
layouts. The layout defines which of these three windows are visible.
The following layouts are available:
source
assembly
source and assembly
source and registers
assembly and registers
On top of the command window a status line gives various information
concerning the current process begin debugged. The status line is
updated when the information it shows changes. The following fields
are displayed:
- target
Indicates the current gdb target
(refer to Chapter 18 Specifying a Debugging Target).
- process
Gives information about the current process or thread number.
When no process is being debugged, this field is set to No process.
- function
Gives the current function name for the selected frame.
The name is demangled if demangling is turned on (refer to Section 10.7 Print settings).
When there is no symbol corresponding to the current program counter
the string ?? is displayed.
- line
Indicates the current line number for the selected frame.
When the current line number is not known the string ?? is displayed.
- pc
Indicates the current program counter address.