You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Output-Styling.html 9.1KB

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