1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- Copyright (C) 1988-2021 Free Software Foundation, Inc.
4
5Permission is granted to copy, distribute and/or modify this document
6under the terms of the GNU Free Documentation License, Version 1.3 or
7any later version published by the Free Software Foundation; with the
8Invariant Sections being "Free Software" and "Free Software Needs
9Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
10and with the Back-Cover Texts as in (a) below.
11
12(a) The FSF's Back-Cover Text is: "You are free to copy and modify
13this GNU Manual.  Buying copies from GNU Press supports the FSF in
14developing GNU and promoting software freedom." -->
15<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
16<head>
17<title>Debugging with GDB: Output Styling</title>
18
19<meta name="description" content="Debugging with GDB: Output Styling">
20<meta name="keywords" content="Debugging with GDB: Output Styling">
21<meta name="resource-type" content="document">
22<meta name="distribution" content="global">
23<meta name="Generator" content="makeinfo">
24<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25<link href="index.html#Top" rel="start" title="Top">
26<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
27<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
28<link href="Controlling-GDB.html#Controlling-GDB" rel="up" title="Controlling GDB">
29<link href="Numbers.html#Numbers" rel="next" title="Numbers">
30<link href="Screen-Size.html#Screen-Size" rel="previous" title="Screen Size">
31<style type="text/css">
32<!--
33a.summary-letter {text-decoration: none}
34blockquote.smallquotation {font-size: smaller}
35div.display {margin-left: 3.2em}
36div.example {margin-left: 3.2em}
37div.indentedblock {margin-left: 3.2em}
38div.lisp {margin-left: 3.2em}
39div.smalldisplay {margin-left: 3.2em}
40div.smallexample {margin-left: 3.2em}
41div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
42div.smalllisp {margin-left: 3.2em}
43kbd {font-style:oblique}
44pre.display {font-family: inherit}
45pre.format {font-family: inherit}
46pre.menu-comment {font-family: serif}
47pre.menu-preformatted {font-family: serif}
48pre.smalldisplay {font-family: inherit; font-size: smaller}
49pre.smallexample {font-size: smaller}
50pre.smallformat {font-family: inherit; font-size: smaller}
51pre.smalllisp {font-size: smaller}
52span.nocodebreak {white-space:nowrap}
53span.nolinebreak {white-space:nowrap}
54span.roman {font-family:serif; font-weight:normal}
55span.sansserif {font-family:sans-serif; font-weight:normal}
56ul.no-bullet {list-style: none}
57-->
58</style>
59
60
61</head>
62
63<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
64<a name="Output-Styling"></a>
65<div class="header">
66<p>
67Next: <a href="Numbers.html#Numbers" accesskey="n" rel="next">Numbers</a>, Previous: <a href="Screen-Size.html#Screen-Size" accesskey="p" rel="previous">Screen Size</a>, Up: <a href="Controlling-GDB.html#Controlling-GDB" accesskey="u" rel="up">Controlling GDB</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
68</div>
69<hr>
70<a name="Output-Styling-1"></a>
71<h3 class="section">22.5 Output Styling</h3>
72<a name="index-styling"></a>
73<a name="index-colors"></a>
74
75<a name="index-set-style"></a>
76<a name="index-show-style"></a>
77<p><small>GDB</small> can style its output on a capable terminal.  This is
78enabled by default on most systems, but disabled by default when in
79batch mode (see <a href="Mode-Options.html#Mode-Options">Mode Options</a>).  Various style settings are available;
80and styles can also be disabled entirely.
81</p>
82<dl compact="compact">
83<dt><code>set style enabled &lsquo;<samp>on|off</samp>&rsquo;</code></dt>
84<dd><p>Enable or disable all styling.  The default is host-dependent, with
85most hosts defaulting to &lsquo;<samp>on</samp>&rsquo;.
86</p>
87</dd>
88<dt><code>show style enabled</code></dt>
89<dd><p>Show the current state of styling.
90</p>
91</dd>
92<dt><code>set style sources &lsquo;<samp>on|off</samp>&rsquo;</code></dt>
93<dd><p>Enable or disable source code styling.  This affects whether source
94code, such as the output of the <code>list</code> command, is styled.  Note
95that source styling only works if styling in general is enabled, and
96if <small>GDB</small> was linked with the GNU Source Highlight library.  The
97default is &lsquo;<samp>on</samp>&rsquo;.
98</p>
99</dd>
100<dt><code>show style sources</code></dt>
101<dd><p>Show the current state of source code styling.
102</p></dd>
103</dl>
104
105<p>Subcommands of <code>set style</code> control specific forms of styling.
106These subcommands all follow the same pattern: each style-able object
107can be styled with a foreground color, a background color, and an
108intensity.
109</p>
110<p>For example, the style of file names can be controlled using the
111<code>set style filename</code> group of commands:
112</p>
113<dl compact="compact">
114<dt><code>set style filename background <var>color</var></code></dt>
115<dd><p>Set the background to <var>color</var>.  Valid colors are &lsquo;<samp>none</samp>&rsquo;
116(meaning the terminal&rsquo;s default color), &lsquo;<samp>black</samp>&rsquo;, &lsquo;<samp>red</samp>&rsquo;,
117&lsquo;<samp>green</samp>&rsquo;, &lsquo;<samp>yellow</samp>&rsquo;, &lsquo;<samp>blue</samp>&rsquo;, &lsquo;<samp>magenta</samp>&rsquo;, &lsquo;<samp>cyan</samp>&rsquo;,
118and&lsquo;<samp>white</samp>&rsquo;.
119</p>
120</dd>
121<dt><code>set style filename foreground <var>color</var></code></dt>
122<dd><p>Set the foreground to <var>color</var>.  Valid colors are &lsquo;<samp>none</samp>&rsquo;
123(meaning the terminal&rsquo;s default color), &lsquo;<samp>black</samp>&rsquo;, &lsquo;<samp>red</samp>&rsquo;,
124&lsquo;<samp>green</samp>&rsquo;, &lsquo;<samp>yellow</samp>&rsquo;, &lsquo;<samp>blue</samp>&rsquo;, &lsquo;<samp>magenta</samp>&rsquo;, &lsquo;<samp>cyan</samp>&rsquo;,
125and&lsquo;<samp>white</samp>&rsquo;.
126</p>
127</dd>
128<dt><code>set style filename intensity <var>value</var></code></dt>
129<dd><p>Set the intensity to <var>value</var>.  Valid intensities are &lsquo;<samp>normal</samp>&rsquo;
130(the default), &lsquo;<samp>bold</samp>&rsquo;, and &lsquo;<samp>dim</samp>&rsquo;.
131</p></dd>
132</dl>
133
134<p>The <code>show style</code> command and its subcommands are styling
135a style name in their output using its own style.
136So, use <code>show style</code> to see the complete list of styles,
137their characteristics and the visual aspect of each style.
138</p>
139<p>The style-able objects are:
140</p><dl compact="compact">
141<dt><code>filename</code></dt>
142<dd><p>Control the styling of file names.  By default, this style&rsquo;s
143foreground color is green.
144</p>
145</dd>
146<dt><code>function</code></dt>
147<dd><p>Control the styling of function names.  These are managed with the
148<code>set style function</code> family of commands.  By default, this
149style&rsquo;s foreground color is yellow.
150</p>
151</dd>
152<dt><code>variable</code></dt>
153<dd><p>Control the styling of variable names.  These are managed with the
154<code>set style variable</code> family of commands.  By default, this style&rsquo;s
155foreground color is cyan.
156</p>
157</dd>
158<dt><code>address</code></dt>
159<dd><p>Control the styling of addresses.  These are managed with the
160<code>set style address</code> family of commands.  By default, this style&rsquo;s
161foreground color is blue.
162</p>
163</dd>
164<dt><code>title</code></dt>
165<dd><p>Control the styling of titles.  These are managed with the
166<code>set style title</code> family of commands.  By default, this style&rsquo;s
167intensity is bold.  Commands are using the title style to improve
168the readability of large output.  For example, the commands
169<code>apropos</code> and <code>help</code> are using the title style
170for the command names.
171</p>
172</dd>
173<dt><code>highlight</code></dt>
174<dd><p>Control the styling of highlightings.  These are managed with the
175<code>set style highlight</code> family of commands.  By default, this style&rsquo;s
176foreground color is red.  Commands are using the highlight style to draw
177the user attention to some specific parts of their output.  For example,
178the command <code>apropos -v REGEXP</code> uses the highlight style to
179mark the documentation parts matching <var>regexp</var>.
180</p>
181</dd>
182<dt><code>tui-border</code></dt>
183<dd><p>Control the styling of the TUI border.  Note that, unlike other
184styling options, only the color of the border can be controlled via
185<code>set style</code>.  This was done for compatibility reasons, as TUI
186controls to set the border&rsquo;s intensity predated the addition of
187general styling to <small>GDB</small>.  See <a href="TUI-Configuration.html#TUI-Configuration">TUI Configuration</a>.
188</p>
189</dd>
190<dt><code>tui-active-border</code></dt>
191<dd><p>Control the styling of the active TUI border; that is, the TUI window
192that has the focus.
193</p>
194</dd>
195</dl>
196
197<hr>
198<div class="header">
199<p>
200Next: <a href="Numbers.html#Numbers" accesskey="n" rel="next">Numbers</a>, Previous: <a href="Screen-Size.html#Screen-Size" accesskey="p" rel="previous">Screen Size</a>, Up: <a href="Controlling-GDB.html#Controlling-GDB" accesskey="u" rel="up">Controlling GDB</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
201</div>
202
203
204
205</body>
206</html>
207