Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Chapter 24. gdb Text User Interface

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:

  • A curses (or TUI) mode in which it displays several text windows on the terminal.

  • A standard mode which corresponds to the gdb configured without the TUI.

In the TUI mode, gdb can display several text window on the terminal:


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.


The source window shows the source file of the program. The current line as well as active breakpoints are displayed in this window.


The assembly window shows the disassembly output of the program.


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:


Breakpoint which was hit at least once.


Breakpoint which was never hit.


Hardware breakpoint which was hit at least once.


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:


Indicates the current gdb target (refer to Chapter 18 Specifying a Debugging Target).


Gives information about the current process or thread number. When no process is being debugged, this field is set to No process.


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.


Indicates the current line number for the selected frame. When the current line number is not known the string ?? is displayed.


Indicates the current program counter address.

  Published under the terms of the GNU General Public License Design by Interspire