gdb can style its output on a capable terminal. This is enabled by default on most systems, but disabled by default when in batch mode (see Mode Options). Various style settings are available; and styles can also be disabled entirely.
set style enabled ‘
on|off’
show style enabled
set style sources ‘
on|off’
list
command, is styled. Note
that source styling only works if styling in general is enabled, and
if gdb was linked with the GNU Source Highlight library. The
default is ‘on’.
show style sources
Subcommands of set style
control specific forms of styling.
These subcommands all follow the same pattern: each style-able object
can be styled with a foreground color, a background color, and an
intensity.
For example, the style of file names can be controlled using the
set style filename
group of commands:
set style filename background
colorset style filename foreground
colorset style filename intensity
valueThe style-able objects are:
filename
function
set style function
family of commands. By default, this
style's foreground color is yellow.
variable
set style variable
family of commands. By default, this style's
foreground color is cyan.
address
set style address
family of commands. By default, this style's
foreground color is blue.