Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / info / gdb / Values-and-their-Operations.html
blobf0e54802b80124e170201cecb0fdb0e60507a9ff
1 <html lang="en">
2 <head>
3 <title>Debugging with GDB</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="Debugging with GDB">
6 <meta name="generator" content="makeinfo 4.3">
7 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
8 </head>
9 <body>
10 <div class="node">
11 <p>
12 Node:<a name="Values%20and%20their%20Operations">Values and their Operations</a>,
13 Next:<a rel="next" accesskey="n" href="Chill-type-and-range-checks.html#Chill%20type%20and%20range%20checks">Chill type and range checks</a>,
14 Previous:<a rel="previous" accesskey="p" href="Locations.html#Locations">Locations</a>,
15 Up:<a rel="up" accesskey="u" href="Chill.html#Chill">Chill</a>
16 <hr><br>
17 </div>
19 <h5 class="subsubsection">Values and their Operations</h5>
21 <p>Values are used to alter locations, to investigate complex structures in
22 more detail or to filter relevant information out of a large amount of
23 data. There are several (mode dependent) operations defined which enable
24 such investigations. These operations are not only applicable to
25 constant values but also to locations, which can become quite useful
26 when debugging complex structures. During parsing the command line
27 (e.g. evaluating an expression) GDB treats location names as
28 the values behind these locations.
30 <p>This section describes how values have to be specified and which
31 operations are legal to be used with such values.
33 <dl>
34 <dt><code>Literal Values</code>
35 <dd>Literal values are specified in the same manner as in <small>GNU</small> Chill programs.
36 For detailed specification refer to the <small>GNU</small> Chill implementation Manual
37 chapter 1.5.
39 <br><dt><code>Tuple Values</code>
40 <dd>A tuple is specified by <code>&lt;mode name&gt;[&lt;tuple&gt;]</code>, where <code>&lt;mode
41 name&gt;</code> can be omitted if the mode of the tuple is unambiguous. This
42 unambiguity is derived from the context of a evaluated expression.
43 <code>&lt;tuple&gt;</code> can be one of the following:
45 <ul>
46 <li><em>Powerset Tuple</em>
47 <li><em>Array Tuple</em>
48 <li><em>Structure Tuple</em>
49 Powerset tuples, array tuples and structure tuples are specified in the
50 same manner as in Chill programs refer to z200/88 chpt 5.2.5.
51 </ul>
53 <br><dt><code>String Element Value</code>
54 <dd>A string element value is specified by
55 <pre class="smallexample"> <code>&lt;string value&gt;(&lt;index&gt;)</code>
56 </pre>
57 where <code>&lt;index&gt;</code> is a integer expression. It delivers a character
58 value which is equivalent to the character indexed by <code>&lt;index&gt;</code> in
59 the string.
61 <br><dt><code>String Slice Value</code>
62 <dd>A string slice value is specified by <code>&lt;string value&gt;(&lt;slice
63 spec&gt;)</code>, where <code>&lt;slice spec&gt;</code> can be either a range of integer
64 expressions or specified by <code>&lt;start expr&gt; up &lt;size&gt;</code>.
65 <code>&lt;size&gt;</code> denotes the number of elements which the slice contains.
66 The delivered value is a string value, which is part of the specified
67 string.
69 <br><dt><code>Array Element Values</code>
70 <dd>An array element value is specified by <code>&lt;array value&gt;(&lt;expr&gt;)</code> and
71 delivers a array element value of the mode of the specified array.
73 <br><dt><code>Array Slice Values</code>
74 <dd>An array slice is specified by <code>&lt;array value&gt;(&lt;slice spec&gt;)</code>, where
75 <code>&lt;slice spec&gt;</code> can be either a range specified by expressions or by
76 <code>&lt;start expr&gt; up &lt;size&gt;</code>. <code>&lt;size&gt;</code> denotes the number of
77 arrayelements the slice contains. The delivered value is an array value
78 which is part of the specified array.
80 <br><dt><code>Structure Field Values</code>
81 <dd>A structure field value is derived by <code>&lt;structure value&gt;.&lt;field
82 name&gt;</code>, where <code>&lt;field name&gt;</code> indicates the name of a field specified
83 in the mode definition of the structure. The mode of the delivered value
84 corresponds to this mode definition in the structure definition.
86 <br><dt><code>Procedure Call Value</code>
87 <dd>The procedure call value is derived from the return value of the
88 procedure<a rel="footnote" href="#fn-1"><sup>1</sup></a>.
90 <p>Values of duration mode locations are represented by <code>ULONG</code> literals.
92 <p>Values of time mode locations appear as
93 <pre class="smallexample"> <code>TIME(&lt;secs&gt;:&lt;nsecs&gt;)</code>
94 </pre>
96 <br><dt><code>Zero-adic Operator Value</code>
97 <dd>The zero-adic operator value is derived from the instance value for the
98 current active process.
100 <br><dt><code>Expression Values</code>
101 <dd>The value delivered by an expression is the result of the evaluation of
102 the specified expression. If there are error conditions (mode
103 incompatibility, etc.) the evaluation of expressions is aborted with a
104 corresponding error message. Expressions may be parenthesised which
105 causes the evaluation of this expression before any other expression
106 which uses the result of the parenthesised expression. The following
107 operators are supported by GDB:
109 <dl>
110 <dt><code>OR, ORIF, XOR</code>
111 <dd><dt><code>AND, ANDIF</code>
112 <dd><dt><code>NOT</code>
113 <dd>Logical operators defined over operands of boolean mode.
115 <br><dt><code>=, /=</code>
116 <dd>Equality and inequality operators defined over all modes.
118 <br><dt><code>&gt;, &gt;=</code>
119 <dd><dt><code>&lt;, &lt;=</code>
120 <dd>Relational operators defined over predefined modes.
122 <br><dt><code>+, -</code>
123 <dd><dt><code>*, /, MOD, REM</code>
124 <dd>Arithmetic operators defined over predefined modes.
126 <br><dt><code>-</code>
127 <dd>Change sign operator.
129 <br><dt><code>//</code>
130 <dd>String concatenation operator.
132 <br><dt><code>()</code>
133 <dd>String repetition operator.
135 <br><dt><code>-&gt;</code>
136 <dd>Referenced location operator which can be used either to take the
137 address of a location (<code>-&gt;loc</code>), or to dereference a reference
138 location (<code>loc-&gt;</code>).
140 <br><dt><code>OR, XOR</code>
141 <dd><dt><code>AND</code>
142 <dd><dt><code>NOT</code>
143 <dd>Powerset and bitstring operators.
145 <br><dt><code>&gt;, &gt;=</code>
146 <dd><dt><code>&lt;, &lt;=</code>
147 <dd>Powerset inclusion operators.
149 <br><dt><code>IN</code>
150 <dd>Membership operator.
151 </dl>
152 </dl>
154 <div class="footnote">
155 <hr>
156 <h4>Footnotes</h4>
157 <ol type="1">
158 <li><a name="fn-1"></a>
159 <p>If a procedure call is used for instance in an
160 expression, then this procedure is called with all its side
161 effects. This can lead to confusing results if used carelessly.</p>
163 </ol><hr></div>
165 </body></html>