Output-Styling.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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-2019 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 5.2, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: Output Styling</title>
  16. <meta name="description" content="Debugging with GDB: Output Styling">
  17. <meta name="keywords" content="Debugging with GDB: Output Styling">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="Output-Styling"></a>
  59. <div class="header">
  60. <p>
  61. 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>
  62. </div>
  63. <hr>
  64. <a name="Output-Styling-1"></a>
  65. <h3 class="section">22.5 Output Styling</h3>
  66. <a name="index-styling"></a>
  67. <a name="index-colors"></a>
  68. <a name="index-set-style"></a>
  69. <a name="index-show-style"></a>
  70. <p><small>GDB</small> can style its output on a capable terminal. This is
  71. enabled by default on most systems, but disabled by default when in
  72. batch mode (see <a href="Mode-Options.html#Mode-Options">Mode Options</a>). Various style settings are available;
  73. and styles can also be disabled entirely.
  74. </p>
  75. <dl compact="compact">
  76. <dt><code>set style enabled &lsquo;<samp>on|off</samp>&rsquo;</code></dt>
  77. <dd><p>Enable or disable all styling. The default is host-dependent, with
  78. most hosts defaulting to &lsquo;<samp>on</samp>&rsquo;.
  79. </p>
  80. </dd>
  81. <dt><code>show style enabled</code></dt>
  82. <dd><p>Show the current state of styling.
  83. </p>
  84. </dd>
  85. <dt><code>set style sources &lsquo;<samp>on|off</samp>&rsquo;</code></dt>
  86. <dd><p>Enable or disable source code styling. This affects whether source
  87. code, such as the output of the <code>list</code> command, is styled. Note
  88. that source styling only works if styling in general is enabled, and
  89. if <small>GDB</small> was linked with the GNU Source Highlight library. The
  90. default is &lsquo;<samp>on</samp>&rsquo;.
  91. </p>
  92. </dd>
  93. <dt><code>show style sources</code></dt>
  94. <dd><p>Show the current state of source code styling.
  95. </p></dd>
  96. </dl>
  97. <p>Subcommands of <code>set style</code> control specific forms of styling.
  98. These subcommands all follow the same pattern: each style-able object
  99. can be styled with a foreground color, a background color, and an
  100. intensity.
  101. </p>
  102. <p>For example, the style of file names can be controlled using the
  103. <code>set style filename</code> group of commands:
  104. </p>
  105. <dl compact="compact">
  106. <dt><code>set style filename background <var>color</var></code></dt>
  107. <dd><p>Set the background to <var>color</var>. Valid colors are &lsquo;<samp>none</samp>&rsquo;
  108. (meaning the terminal&rsquo;s default color), &lsquo;<samp>black</samp>&rsquo;, &lsquo;<samp>red</samp>&rsquo;,
  109. &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;,
  110. and&lsquo;<samp>white</samp>&rsquo;.
  111. </p>
  112. </dd>
  113. <dt><code>set style filename foreground <var>color</var></code></dt>
  114. <dd><p>Set the foreground to <var>color</var>. Valid colors are &lsquo;<samp>none</samp>&rsquo;
  115. (meaning the terminal&rsquo;s default color), &lsquo;<samp>black</samp>&rsquo;, &lsquo;<samp>red</samp>&rsquo;,
  116. &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;,
  117. and&lsquo;<samp>white</samp>&rsquo;.
  118. </p>
  119. </dd>
  120. <dt><code>set style filename intensity <var>value</var></code></dt>
  121. <dd><p>Set the intensity to <var>value</var>. Valid intensities are &lsquo;<samp>normal</samp>&rsquo;
  122. (the default), &lsquo;<samp>bold</samp>&rsquo;, and &lsquo;<samp>dim</samp>&rsquo;.
  123. </p></dd>
  124. </dl>
  125. <p>The style-able objects are:
  126. </p><dl compact="compact">
  127. <dt><code>filename</code></dt>
  128. <dd><p>Control the styling of file names. By default, this style&rsquo;s
  129. foreground color is green.
  130. </p>
  131. </dd>
  132. <dt><code>function</code></dt>
  133. <dd><p>Control the styling of function names. These are managed with the
  134. <code>set style function</code> family of commands. By default, this
  135. style&rsquo;s foreground color is yellow.
  136. </p>
  137. </dd>
  138. <dt><code>variable</code></dt>
  139. <dd><p>Control the styling of variable names. These are managed with the
  140. <code>set style variable</code> family of commands. By default, this style&rsquo;s
  141. foreground color is cyan.
  142. </p>
  143. </dd>
  144. <dt><code>address</code></dt>
  145. <dd><p>Control the styling of addresses. These are managed with the
  146. <code>set style address</code> family of commands. By default, this style&rsquo;s
  147. foreground color is blue.
  148. </p></dd>
  149. </dl>
  150. <hr>
  151. <div class="header">
  152. <p>
  153. 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>
  154. </div>
  155. </body>
  156. </html>