相关命令:
22.1 TUI Overview TUI overview 22.2 TUI Key Bindings TUI key bindings 22.3 TUI Single Key Mode TUI single key mode 22.4 TUI-specific Commands TUI-specific commands 22.5 TUI Configuration Variables TUI configuration variables
The GDB Text User Interface (TUI) 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 mode is supported only on platforms where a suitable version of the curses
library is available.
The TUI mode is enabled by default when you invoke GDB as either `gdbtui' or `gdb -tui'. You can also switch in and out of TUI mode while GDB runs by using various TUI commands and key bindings, such as C-x C-a. See section TUI Key Bindings.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In TUI mode, GDB can display several text windows:
The source and assembly windows show the current program position by highlighting the current line and marking it with a `>' marker. Breakpoints are indicated with two markers. The first marker indicates the breakpoint type:
B
b
H
h
The second marker indicates whether the breakpoint is enabled or not:
+
-
The source, assembly and register windows are updated when the current thread changes, when the frame changes, or when the program counter changes.
These windows are not all visible at the same time. The command window is always visible. The others can be arranged in several layouts:
A status line above the command window shows the following information:
No process
.
??
is displayed.
??
is displayed.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The TUI installs several key bindings in the readline keymaps (see section 27. Command Line Editing). The following key bindings are installed for both TUI mode and the GDB standard mode.
C-x C-a ----->Kuike: C means Ctrl, so C-x means Ctrl+x C-x a C-x AEnter or leave the TUI mode. When leaving the TUI mode, the curses window management stops and GDB operates using its standard mode, writing on the terminal directly. When reentering the TUI mode, control is given back to the curses windows. The screen is then refreshed. --->kuike: gdb command win also can enter TUI mode C-x 1Use a TUI layout with only one window. The layout will either be `source' or `assembly'. When the TUI mode is not active, it will switch to the TUI mode.Think of this key binding as the Emacs C-x 1 binding.
C-x 2Use a TUI layout with at least two windows. When the current layout already has two windows, the next layout with two windows is used. When a new layout is chosen, one window will always be common to the previous layout and the new one.Think of it as the Emacs C-x 2 binding.
C-x oChange the active window. The TUI associates several key bindings (like scrolling and arrow keys) with the active window. This command gives the focus to the next TUI window.Think of it as the Emacs C-x o binding.
C-x sSwitch in and out of the TUI SingleKey mode that binds single keys to GDB commands (see section 22.3 TUI Single Key Mode).The following key bindings only work in the TUI mode:
PgUpScroll the active window one page up. PgDnScroll the active window one page down. UpScroll the active window one line up. DownScroll the active window one line down. LeftScroll the active window one column left. RightScroll the active window one column right. C-LRefresh the screen.Because the arrow keys scroll the active window in the TUI mode, they are not available for their normal use by readline unless the command window has the focus. When another window is active, you must use other readline key bindings such as C-p, C-n, C-b and C-f to control the command window.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The TUI also provides a SingleKey mode, which binds several frequently used GDB commands to single keys. Type C-x s to switch into this mode, where the following key bindings are used:
ccontinue ddown ffinish nnext qexit the SingleKey mode. rrun sstep uup vinfo locals wwhereOther keys temporarily switch to the GDB command prompt. The key that was pressed is inserted in the editing buffer so that it is possible to type most GDB commands without interaction with the TUI SingleKey mode. Once the command is entered the TUI SingleKey mode is restored. The only way to permanently leave this mode is by typing q or C-x s.