Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

Value-Annotations.html 8.2KB

3 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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-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 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.5, 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#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.indentedblock {margin-right: 0em}
  28. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  29. blockquote.smallquotation {font-size: smaller}
  30. div.display {margin-left: 3.2em}
  31. div.example {margin-left: 3.2em}
  32. div.lisp {margin-left: 3.2em}
  33. div.smalldisplay {margin-left: 3.2em}
  34. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  46. span.roman {font-family: initial; font-weight: normal}
  47. span.sansserif {font-family: sans-serif; font-weight: normal}
  48. ul.no-bullet {list-style: none}
  49. -->
  50. </style>
  51. </head>
  52. <body lang="en">
  53. <a name="Value-Annotations"></a>
  54. <div class="header">
  55. <p>
  56. 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>
  57. </div>
  58. <hr>
  59. <a name="Values"></a>
  60. <h2 class="chapter">5 Values</h2>
  61. <p><em>Value Annotations have been removed. <small>GDB/MI</small> instead provides
  62. Variable Objects.</em>
  63. </p>
  64. <a name="index-annotations-for-values"></a>
  65. <p>When a value is printed in various contexts, <small>GDB</small> uses
  66. annotations to delimit the value from the surrounding text.
  67. </p>
  68. <a name="index-value_002dhistory_002dbegin"></a>
  69. <a name="index-value_002dhistory_002dvalue"></a>
  70. <a name="index-value_002dhistory_002dend"></a>
  71. <p>If a value is printed using <code>print</code> and added to the value history,
  72. the annotation looks like
  73. </p>
  74. <div class="smallexample">
  75. <pre class="smallexample">^Z^Zvalue-history-begin <var>history-number</var> <var>value-flags</var>
  76. <var>history-string</var>
  77. ^Z^Zvalue-history-value
  78. <var>the-value</var>
  79. ^Z^Zvalue-history-end
  80. </pre></div>
  81. <p>where <var>history-number</var> is the number it is getting in the value
  82. history, <var>history-string</var> is a string, such as &lsquo;<samp>$5 = </samp>&rsquo;, which
  83. introduces the value to the user, <var>the-value</var> is the output
  84. corresponding to the value itself, and <var>value-flags</var> is &lsquo;<samp>*</samp>&rsquo; for
  85. a value which can be dereferenced and &lsquo;<samp>-</samp>&rsquo; for a value which cannot.
  86. </p>
  87. <a name="index-value_002dbegin"></a>
  88. <a name="index-value_002dend"></a>
  89. <p>If the value is not added to the value history (it is an invalid float
  90. or it is printed with the <code>output</code> command), the annotation is similar:
  91. </p>
  92. <div class="smallexample">
  93. <pre class="smallexample">^Z^Zvalue-begin <var>value-flags</var>
  94. <var>the-value</var>
  95. ^Z^Zvalue-end
  96. </pre></div>
  97. <a name="index-arg_002dbegin"></a>
  98. <a name="index-arg_002dname_002dend"></a>
  99. <a name="index-arg_002dvalue"></a>
  100. <a name="index-arg_002dend"></a>
  101. <p>When <small>GDB</small> prints an argument to a function (for example, in the output
  102. from the <code>backtrace</code> command), it annotates it as follows:
  103. </p>
  104. <div class="smallexample">
  105. <pre class="smallexample">^Z^Zarg-begin
  106. <var>argument-name</var>
  107. ^Z^Zarg-name-end
  108. <var>separator-string</var>
  109. ^Z^Zarg-value <var>value-flags</var>
  110. <var>the-value</var>
  111. ^Z^Zarg-end
  112. </pre></div>
  113. <p>where <var>argument-name</var> is the name of the argument,
  114. <var>separator-string</var> is text which separates the name from the value
  115. for the user&rsquo;s benefit (such as &lsquo;<samp>=</samp>&rsquo;), and <var>value-flags</var> and
  116. <var>the-value</var> have the same meanings as in a
  117. <code>value-history-begin</code> annotation.
  118. </p>
  119. <a name="index-field_002dbegin"></a>
  120. <a name="index-field_002dname_002dend"></a>
  121. <a name="index-field_002dvalue"></a>
  122. <a name="index-field_002dend"></a>
  123. <p>When printing a structure, <small>GDB</small> annotates it as follows:
  124. </p>
  125. <div class="smallexample">
  126. <pre class="smallexample">^Z^Zfield-begin <var>value-flags</var>
  127. <var>field-name</var>
  128. ^Z^Zfield-name-end
  129. <var>separator-string</var>
  130. ^Z^Zfield-value
  131. <var>the-value</var>
  132. ^Z^Zfield-end
  133. </pre></div>
  134. <p>where <var>field-name</var> is the name of the field, <var>separator-string</var>
  135. is text which separates the name from the value for the user&rsquo;s benefit
  136. (such as &lsquo;<samp>=</samp>&rsquo;), and <var>value-flags</var> and <var>the-value</var> have the
  137. same meanings as in a <code>value-history-begin</code> annotation.
  138. </p>
  139. <p>When printing an array, <small>GDB</small> annotates it as follows:
  140. </p>
  141. <div class="smallexample">
  142. <pre class="smallexample">^Z^Zarray-section-begin <var>array-index</var> <var>value-flags</var>
  143. </pre></div>
  144. <p>where <var>array-index</var> is the index of the first element being
  145. annotated and <var>value-flags</var> has the same meaning as in a
  146. <code>value-history-begin</code> annotation. This is followed by any number
  147. of elements, where is element can be either a single element:
  148. </p>
  149. <a name="index-elt"></a>
  150. <div class="smallexample">
  151. <pre class="smallexample">&lsquo;<samp>,</samp>&rsquo; <var>whitespace</var> ; <span class="roman">omitted for the first element</span>
  152. <var>the-value</var>
  153. ^Z^Zelt
  154. </pre></div>
  155. <p>or a repeated element
  156. </p>
  157. <a name="index-elt_002drep"></a>
  158. <a name="index-elt_002drep_002dend"></a>
  159. <div class="smallexample">
  160. <pre class="smallexample">&lsquo;<samp>,</samp>&rsquo; <var>whitespace</var> ; <span class="roman">omitted for the first element</span>
  161. <var>the-value</var>
  162. ^Z^Zelt-rep <var>number-of-repetitions</var>
  163. <var>repetition-string</var>
  164. ^Z^Zelt-rep-end
  165. </pre></div>
  166. <p>In both cases, <var>the-value</var> is the output for the value of the
  167. element and <var>whitespace</var> can contain spaces, tabs, and newlines. In
  168. the repeated case, <var>number-of-repetitions</var> is the number of
  169. consecutive array elements which contain that value, and
  170. <var>repetition-string</var> is a string which is designed to convey to the
  171. user that repetition is being depicted.
  172. </p>
  173. <a name="index-array_002dsection_002dend"></a>
  174. <p>Once all the array elements have been output, the array annotation is
  175. ended with
  176. </p>
  177. <div class="smallexample">
  178. <pre class="smallexample">^Z^Zarray-section-end
  179. </pre></div>
  180. <hr>
  181. <div class="header">
  182. <p>
  183. 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>
  184. </div>
  185. </body>
  186. </html>