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.

Annotations-Overview.html 6.6KB

3 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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>Annotations Overview (Debugging with GDB)</title>
  17. <meta name="description" content="Annotations Overview (Debugging with GDB)">
  18. <meta name="keywords" content="Annotations Overview (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="Annotations.html#Annotations" rel="up" title="Annotations">
  26. <link href="Server-Prefix.html#Server-Prefix" rel="next" title="Server Prefix">
  27. <link href="Annotations.html#Annotations" rel="prev" title="Annotations">
  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="Annotations-Overview"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Server-Prefix.html#Server-Prefix" accesskey="n" rel="next">Server Prefix</a>, Up: <a href="Annotations.html#Annotations" accesskey="u" rel="up">Annotations</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="What-is-an-Annotation_003f"></a>
  64. <h3 class="section">28.1 What is an Annotation?</h3>
  65. <a name="index-annotations"></a>
  66. <p>Annotations start with a newline character, two &lsquo;<samp>control-z</samp>&rsquo;
  67. characters, and the name of the annotation. If there is no additional
  68. information associated with this annotation, the name of the annotation
  69. is followed immediately by a newline. If there is additional
  70. information, the name of the annotation is followed by a space, the
  71. additional information, and a newline. The additional information
  72. cannot contain newline characters.
  73. </p>
  74. <p>Any output not beginning with a newline and two &lsquo;<samp>control-z</samp>&rsquo;
  75. characters denotes literal output from <small>GDB</small>. Currently there is
  76. no need for <small>GDB</small> to output a newline followed by two
  77. &lsquo;<samp>control-z</samp>&rsquo; characters, but if there was such a need, the
  78. annotations could be extended with an &lsquo;<samp>escape</samp>&rsquo; annotation which
  79. means those three characters as output.
  80. </p>
  81. <p>The annotation <var>level</var>, which is specified using the
  82. <samp>--annotate</samp> command line option (see <a href="Mode-Options.html#Mode-Options">Mode Options</a>), controls
  83. how much information <small>GDB</small> prints together with its prompt,
  84. values of expressions, source lines, and other types of output. Level 0
  85. is for no annotations, level 1 is for use when <small>GDB</small> is run as a
  86. subprocess of <small>GNU</small> Emacs, level 3 is the maximum annotation suitable
  87. for programs that control <small>GDB</small>, and level 2 annotations have
  88. been made obsolete (see <a href="../annotate/Limitations.html#Limitations">Limitations of the Annotation
  89. Interface</a> in <cite>GDB&rsquo;s Obsolete Annotations</cite>).
  90. </p>
  91. <dl compact="compact">
  92. <dd><a name="index-set-annotate"></a>
  93. </dd>
  94. <dt><code>set annotate <var>level</var></code></dt>
  95. <dd><p>The <small>GDB</small> command <code>set annotate</code> sets the level of
  96. annotations to the specified <var>level</var>.
  97. </p>
  98. </dd>
  99. <dt><code>show annotate</code></dt>
  100. <dd><a name="index-show-annotate"></a>
  101. <p>Show the current annotation level.
  102. </p></dd>
  103. </dl>
  104. <p>This chapter describes level 3 annotations.
  105. </p>
  106. <p>A simple example of starting up <small>GDB</small> with annotations is:
  107. </p>
  108. <div class="smallexample">
  109. <pre class="smallexample">$ <kbd>gdb --annotate=3</kbd>
  110. GNU gdb 6.0
  111. Copyright 2003 Free Software Foundation, Inc.
  112. GDB is free software, covered by the GNU General Public License,
  113. and you are welcome to change it and/or distribute copies of it
  114. under certain conditions.
  115. Type &quot;show copying&quot; to see the conditions.
  116. There is absolutely no warranty for GDB. Type &quot;show warranty&quot;
  117. for details.
  118. This GDB was configured as &quot;i386-pc-linux-gnu&quot;
  119. ^Z^Zpre-prompt
  120. (gdb)
  121. ^Z^Zprompt
  122. <kbd>quit</kbd>
  123. ^Z^Zpost-prompt
  124. $
  125. </pre></div>
  126. <p>Here &lsquo;<samp>quit</samp>&rsquo; is input to <small>GDB</small>; the rest is output from
  127. <small>GDB</small>. The three lines beginning &lsquo;<samp>^Z^Z</samp>&rsquo; (where &lsquo;<samp>^Z</samp>&rsquo;
  128. denotes a &lsquo;<samp>control-z</samp>&rsquo; character) are annotations; the rest is
  129. output from <small>GDB</small>.
  130. </p>
  131. <hr>
  132. <div class="header">
  133. <p>
  134. Next: <a href="Server-Prefix.html#Server-Prefix" accesskey="n" rel="next">Server Prefix</a>, Up: <a href="Annotations.html#Annotations" accesskey="u" rel="up">Annotations</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>
  135. </div>
  136. </body>
  137. </html>