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