Value-Annotations.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1994-2023 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 no
  7. Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
  8. Texts. A copy of the license is included in the section entitled "GNU
  9. Free Documentation License". -->
  10. <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
  11. <head>
  12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  13. <title>Value Annotations (GDB&rsquo;s Obsolete Annotations)</title>
  14. <meta name="description" content="Value Annotations (GDB&rsquo;s Obsolete Annotations)">
  15. <meta name="keywords" content="Value Annotations (GDB&rsquo;s Obsolete Annotations)">
  16. <meta name="resource-type" content="document">
  17. <meta name="distribution" content="global">
  18. <meta name="Generator" content="makeinfo">
  19. <link href="index.html" rel="start" title="Top">
  20. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  21. <link href="index.html" rel="up" title="Top">
  22. <link href="Frame-Annotations.html" rel="next" title="Frame Annotations">
  23. <link href="Server-Prefix.html" rel="prev" title="Server Prefix">
  24. <style type="text/css">
  25. <!--
  26. a.summary-letter {text-decoration: none}
  27. blockquote.indentedblock {margin-right: 0em}
  28. div.display {margin-left: 3.2em}
  29. div.example {margin-left: 3.2em}
  30. div.lisp {margin-left: 3.2em}
  31. kbd {font-style: oblique}
  32. pre.display {font-family: inherit}
  33. pre.format {font-family: inherit}
  34. pre.menu-comment {font-family: serif}
  35. pre.menu-preformatted {font-family: serif}
  36. span.nolinebreak {white-space: nowrap}
  37. span.roman {font-family: initial; font-weight: normal}
  38. span.sansserif {font-family: sans-serif; font-weight: normal}
  39. ul.no-bullet {list-style: none}
  40. -->
  41. </style>
  42. </head>
  43. <body lang="en">
  44. <span id="Value-Annotations"></span><div class="header">
  45. <p>
  46. Next: <a href="Frame-Annotations.html" accesskey="n" rel="next">Frame Annotations</a>, Previous: <a href="Server-Prefix.html" accesskey="p" rel="prev">Server Prefix</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
  47. </div>
  48. <hr>
  49. <span id="Values"></span><h2 class="chapter">5 Values</h2>
  50. <p><em>Value Annotations have been removed. <small>GDB/MI</small> instead provides
  51. Variable Objects.</em>
  52. </p>
  53. <span id="index-annotations-for-values"></span>
  54. <p>When a value is printed in various contexts, <small>GDB</small> uses
  55. annotations to delimit the value from the surrounding text.
  56. </p>
  57. <span id="index-value_002dhistory_002dbegin"></span>
  58. <span id="index-value_002dhistory_002dvalue"></span>
  59. <span id="index-value_002dhistory_002dend"></span>
  60. <p>If a value is printed using <code>print</code> and added to the value history,
  61. the annotation looks like
  62. </p>
  63. <div class="example">
  64. <pre class="example">^Z^Zvalue-history-begin <var>history-number</var> <var>value-flags</var>
  65. <var>history-string</var>
  66. ^Z^Zvalue-history-value
  67. <var>the-value</var>
  68. ^Z^Zvalue-history-end
  69. </pre></div>
  70. <p>where <var>history-number</var> is the number it is getting in the value
  71. history, <var>history-string</var> is a string, such as &lsquo;<samp>$5 = </samp>&rsquo;, which
  72. introduces the value to the user, <var>the-value</var> is the output
  73. corresponding to the value itself, and <var>value-flags</var> is &lsquo;<samp>*</samp>&rsquo; for
  74. a value which can be dereferenced and &lsquo;<samp>-</samp>&rsquo; for a value which cannot.
  75. </p>
  76. <span id="index-value_002dbegin"></span>
  77. <span id="index-value_002dend"></span>
  78. <p>If the value is not added to the value history (it is an invalid float
  79. or it is printed with the <code>output</code> command), the annotation is similar:
  80. </p>
  81. <div class="example">
  82. <pre class="example">^Z^Zvalue-begin <var>value-flags</var>
  83. <var>the-value</var>
  84. ^Z^Zvalue-end
  85. </pre></div>
  86. <span id="index-arg_002dbegin"></span>
  87. <span id="index-arg_002dname_002dend"></span>
  88. <span id="index-arg_002dvalue"></span>
  89. <span id="index-arg_002dend"></span>
  90. <p>When <small>GDB</small> prints an argument to a function (for example, in the output
  91. from the <code>backtrace</code> command), it annotates it as follows:
  92. </p>
  93. <div class="example">
  94. <pre class="example">^Z^Zarg-begin
  95. <var>argument-name</var>
  96. ^Z^Zarg-name-end
  97. <var>separator-string</var>
  98. ^Z^Zarg-value <var>value-flags</var>
  99. <var>the-value</var>
  100. ^Z^Zarg-end
  101. </pre></div>
  102. <p>where <var>argument-name</var> is the name of the argument,
  103. <var>separator-string</var> is text which separates the name from the value
  104. for the user&rsquo;s benefit (such as &lsquo;<samp>=</samp>&rsquo;), and <var>value-flags</var> and
  105. <var>the-value</var> have the same meanings as in a
  106. <code>value-history-begin</code> annotation.
  107. </p>
  108. <span id="index-field_002dbegin"></span>
  109. <span id="index-field_002dname_002dend"></span>
  110. <span id="index-field_002dvalue"></span>
  111. <span id="index-field_002dend"></span>
  112. <p>When printing a structure, <small>GDB</small> annotates it as follows:
  113. </p>
  114. <div class="example">
  115. <pre class="example">^Z^Zfield-begin <var>value-flags</var>
  116. <var>field-name</var>
  117. ^Z^Zfield-name-end
  118. <var>separator-string</var>
  119. ^Z^Zfield-value
  120. <var>the-value</var>
  121. ^Z^Zfield-end
  122. </pre></div>
  123. <p>where <var>field-name</var> is the name of the field, <var>separator-string</var>
  124. is text which separates the name from the value for the user&rsquo;s benefit
  125. (such as &lsquo;<samp>=</samp>&rsquo;), and <var>value-flags</var> and <var>the-value</var> have the
  126. same meanings as in a <code>value-history-begin</code> annotation.
  127. </p>
  128. <p>When printing an array, <small>GDB</small> annotates it as follows:
  129. </p>
  130. <div class="example">
  131. <pre class="example">^Z^Zarray-section-begin <var>array-index</var> <var>value-flags</var>
  132. </pre></div>
  133. <p>where <var>array-index</var> is the index of the first element being
  134. annotated and <var>value-flags</var> has the same meaning as in a
  135. <code>value-history-begin</code> annotation. This is followed by any number
  136. of elements, where is element can be either a single element:
  137. </p>
  138. <span id="index-elt"></span>
  139. <div class="example">
  140. <pre class="example">&lsquo;<samp>,</samp>&rsquo; <var>whitespace</var> ; <span class="roman">omitted for the first element</span>
  141. <var>the-value</var>
  142. ^Z^Zelt
  143. </pre></div>
  144. <p>or a repeated element
  145. </p>
  146. <span id="index-elt_002drep"></span>
  147. <span id="index-elt_002drep_002dend"></span>
  148. <div class="example">
  149. <pre class="example">&lsquo;<samp>,</samp>&rsquo; <var>whitespace</var> ; <span class="roman">omitted for the first element</span>
  150. <var>the-value</var>
  151. ^Z^Zelt-rep <var>number-of-repetitions</var>
  152. <var>repetition-string</var>
  153. ^Z^Zelt-rep-end
  154. </pre></div>
  155. <p>In both cases, <var>the-value</var> is the output for the value of the
  156. element and <var>whitespace</var> can contain spaces, tabs, and newlines. In
  157. the repeated case, <var>number-of-repetitions</var> is the number of
  158. consecutive array elements which contain that value, and
  159. <var>repetition-string</var> is a string which is designed to convey to the
  160. user that repetition is being depicted.
  161. </p>
  162. <span id="index-array_002dsection_002dend"></span>
  163. <p>Once all the array elements have been output, the array annotation is
  164. ended with
  165. </p>
  166. <div class="example">
  167. <pre class="example">^Z^Zarray-section-end
  168. </pre></div>
  169. <hr>
  170. <div class="header">
  171. <p>
  172. Next: <a href="Frame-Annotations.html" accesskey="n" rel="next">Frame Annotations</a>, Previous: <a href="Server-Prefix.html" accesskey="p" rel="prev">Server Prefix</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
  173. </div>
  174. </body>
  175. </html>