Value-Annotations.html 8.3 KB

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