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">
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>
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.
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
39 <br><dt><code>Tuple Values
</code>
40 <dd>A tuple is specified by
<code><mode name
>[
<tuple
>]
</code>, where
<code><mode
41 name
></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><tuple
></code> can be one of the following:
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.
53 <br><dt><code>String Element Value
</code>
54 <dd>A string element value is specified by
55 <pre class=
"smallexample"> <code><string value
>(
<index
>)
</code>
57 where
<code><index
></code> is a integer expression. It delivers a character
58 value which is equivalent to the character indexed by
<code><index
></code> in
61 <br><dt><code>String Slice Value
</code>
62 <dd>A string slice value is specified by
<code><string value
>(
<slice
63 spec
>)
</code>, where
<code><slice spec
></code> can be either a range of integer
64 expressions or specified by
<code><start expr
> up
<size
></code>.
65 <code><size
></code> denotes the number of elements which the slice contains.
66 The delivered value is a string value, which is part of the specified
69 <br><dt><code>Array Element Values
</code>
70 <dd>An array element value is specified by
<code><array value
>(
<expr
>)
</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><array value
>(
<slice spec
>)
</code>, where
75 <code><slice spec
></code> can be either a range specified by expressions or by
76 <code><start expr
> up
<size
></code>.
<code><size
></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><structure value
>.
<field
82 name
></code>, where
<code><field name
></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(
<secs
>:
<nsecs
>)
</code>
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:
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>>,
>=
</code>
119 <dd><dt><code><,
<=
</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>-
></code>
136 <dd>Referenced location operator which can be used either to take the
137 address of a location (
<code>-
>loc
</code>), or to dereference a reference
138 location (
<code>loc-
></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>>,
>=
</code>
146 <dd><dt><code><,
<=
</code>
147 <dd>Powerset inclusion operators.
149 <br><dt><code>IN
</code>
150 <dd>Membership operator.
154 <div class=
"footnote">
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>