2012-12-10 Paul Koning <paul_koning@dell.com>
[deliverable/binutils-gdb.git] / gdb / std-operator.def
CommitLineData
56c12414
JK
1/* Standard language operator definitions for GDB, the GNU debugger.
2
0b302171
JB
3 Copyright (C) 1986, 1989, 1992, 1994, 2000, 2003, 2005, 2007-2012
4 Free Software Foundation, Inc.
56c12414
JK
5
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21/* Used when it's necessary to pass an opcode which will be ignored,
22 or to catch uninitialized values. */
23OP (OP_NULL)
24
25/* BINOP_... operate on two values computed by following subexpressions,
26replacing them by one result value. They take no immediate arguments. */
27
28OP (BINOP_ADD) /* + */
29OP (BINOP_SUB) /* - */
30OP (BINOP_MUL) /* * */
31OP (BINOP_DIV) /* / */
32OP (BINOP_REM) /* % */
33OP (BINOP_MOD) /* mod (Knuth 1.2.4) */
34OP (BINOP_LSH) /* << */
35OP (BINOP_RSH) /* >> */
36OP (BINOP_LOGICAL_AND) /* && */
37OP (BINOP_LOGICAL_OR) /* || */
38OP (BINOP_BITWISE_AND) /* & */
39OP (BINOP_BITWISE_IOR) /* | */
40OP (BINOP_BITWISE_XOR) /* ^ */
41OP (BINOP_EQUAL) /* == */
42OP (BINOP_NOTEQUAL) /* != */
43OP (BINOP_LESS) /* < */
44OP (BINOP_GTR) /* > */
45OP (BINOP_LEQ) /* <= */
46OP (BINOP_GEQ) /* >= */
47OP (BINOP_REPEAT) /* @ */
48OP (BINOP_ASSIGN) /* = */
49OP (BINOP_COMMA) /* , */
50OP (BINOP_SUBSCRIPT) /* x[y] */
51OP (BINOP_EXP) /* Exponentiation */
52
53/* C++. */
54
55OP (BINOP_MIN) /* <? */
56OP (BINOP_MAX) /* >? */
57
58/* STRUCTOP_MEMBER is used for pointer-to-member constructs.
59 X . * Y translates into X STRUCTOP_MEMBER Y. */
60OP (STRUCTOP_MEMBER)
61
62/* STRUCTOP_MPTR is used for pointer-to-member constructs
63 when X is a pointer instead of an aggregate. */
64OP (STRUCTOP_MPTR)
65
66/* TYPE_INSTANCE is used when the user specifies a specific
67 type instantiation for overloaded methods/functions.
68
69 The format is:
70 TYPE_INSTANCE num_types type0 ... typeN num_types TYPE_INSTANCE. */
71OP (TYPE_INSTANCE)
72
73/* end of C++. */
74
75/* For Modula-2 integer division DIV. */
76OP (BINOP_INTDIV)
77
78/* +=, -=, *=, and so on. The following exp_element is another opcode,
79 a BINOP_, saying how to modify. Then comes another BINOP_ASSIGN_MODIFY,
80 making three exp_elements in total. */
81OP (BINOP_ASSIGN_MODIFY)
82
83/* Modula-2 standard (binary) procedures. */
84OP (BINOP_VAL)
85
86/* Concatenate two operands, such as character strings or bitstrings.
87 If the first operand is a integer expression, then it means concatenate
88 the second operand with itself that many times. */
89OP (BINOP_CONCAT)
90
91/* For (the deleted) Chill and Pascal. */
92OP (BINOP_IN) /* Returns 1 iff ARG1 IN ARG2. */
93
94/* This is the "colon operator" used various places in (the
95 deleted) Chill. */
96OP (BINOP_RANGE)
97
98/* This must be the highest BINOP_ value, for expprint.c. */
99OP (BINOP_END)
100
101/* Operates on three values computed by following subexpressions. */
102OP (TERNOP_COND) /* ?: */
103
104/* A sub-string/sub-array. (the deleted) Chill syntax:
105 OP1(OP2:OP3). Return elements OP2 through OP3 of OP1. */
106OP (TERNOP_SLICE)
107
56c12414
JK
108/* Multidimensional subscript operator, such as Modula-2 x[a,b,...].
109 The dimensionality is encoded in the operator, like the number of
110 function arguments in OP_FUNCALL, I.E. <OP><dimension><OP>.
111 The value of the first following subexpression is subscripted
112 by each of the next following subexpressions, one per dimension. */
113OP (MULTI_SUBSCRIPT)
114
115/* The OP_... series take immediate following arguments.
116 After the arguments come another OP_... (the same one)
117 so that the grouping can be recognized from the end. */
118
119/* OP_LONG is followed by a type pointer in the next exp_element
120 and the long constant value in the following exp_element.
121 Then comes another OP_LONG.
122 Thus, the operation occupies four exp_elements. */
123OP (OP_LONG)
124
125/* OP_DOUBLE is similar but takes a DOUBLEST constant instead of a
126 long. */
127OP (OP_DOUBLE)
128
129/* OP_VAR_VALUE takes one struct block * in the following element,
130 and one struct symbol * in the following exp_element, followed
131 by another OP_VAR_VALUE, making four exp_elements. If the
132 block is non-NULL, evaluate the symbol relative to the
133 innermost frame executing in that block; if the block is NULL
134 use the selected frame. */
135OP (OP_VAR_VALUE)
136
36b11add
JK
137/* OP_VAR_ENTRY_VALUE takes one struct symbol * in the following element,
138 followed by another OP_VAR_ENTRY_VALUE, making three exp_elements.
139 somename@entry may mean parameter value as present at the entry of the
140 current function. Implemented via DW_OP_GNU_entry_value. */
141OP (OP_VAR_ENTRY_VALUE)
142
56c12414
JK
143/* OP_LAST is followed by an integer in the next exp_element.
144 The integer is zero for the last value printed,
145 or it is the absolute number of a history element.
146 With another OP_LAST at the end, this makes three exp_elements. */
147OP (OP_LAST)
148
149/* OP_REGISTER is followed by a string in the next exp_element.
150 This is the name of a register to fetch. */
151OP (OP_REGISTER)
152
153/* OP_INTERNALVAR is followed by an internalvar ptr in the next
154 exp_element. With another OP_INTERNALVAR at the end, this
155 makes three exp_elements. */
156OP (OP_INTERNALVAR)
157
158/* OP_FUNCALL is followed by an integer in the next exp_element.
159 The integer is the number of args to the function call.
160 That many plus one values from following subexpressions
161 are used, the first one being the function.
162 The integer is followed by a repeat of OP_FUNCALL,
163 making three exp_elements. */
164OP (OP_FUNCALL)
165
166/* OP_OBJC_MSGCALL is followed by a string in the next exp_element
167 and then an integer. The string is the selector string. The
168 integer is the number of arguments to the message call. That
169 many plus one values are used, the first one being the object
170 pointer. This is an Objective C message. */
171OP (OP_OBJC_MSGCALL)
172
173/* This is EXACTLY like OP_FUNCALL but is semantically different.
174 In F77, array subscript expressions, substring expressions and
175 function calls are all exactly the same syntactically. They
176 may only be disambiguated at runtime. Thus this operator,
177 which indicates that we have found something of the form
178 <name> ( <stuff> ). */
179OP (OP_F77_UNDETERMINED_ARGLIST)
180
181/* OP_COMPLEX takes a type in the following element, followed by another
182 OP_COMPLEX, making three exp_elements. It is followed by two double
183 args, and converts them into a complex number of the given type. */
184OP (OP_COMPLEX)
185
186/* OP_STRING represents a string constant.
187 Its format is the same as that of a STRUCTOP, but the string
188 data is just made into a string constant when the operation
189 is executed. */
190OP (OP_STRING)
191
56c12414
JK
192/* OP_ARRAY creates an array constant out of the following subexpressions.
193 It is followed by two exp_elements, the first containing an integer
194 that is the lower bound of the array and the second containing another
195 integer that is the upper bound of the array. The second integer is
196 followed by a repeat of OP_ARRAY, making four exp_elements total.
197 The bounds are used to compute the number of following subexpressions
198 to consume, as well as setting the bounds in the created array constant.
199 The type of the elements is taken from the type of the first subexp,
200 and they must all match. */
201OP (OP_ARRAY)
202
203/* UNOP_CAST is followed by a type pointer in the next exp_element.
204 With another UNOP_CAST at the end, this makes three exp_elements.
205 It casts the value of the following subexpression. */
206OP (UNOP_CAST)
207
9eaf6705
TT
208/* Like UNOP_CAST, but the type is a subexpression. */
209OP (UNOP_CAST_TYPE)
210
56c12414
JK
211/* The C++ dynamic_cast operator. */
212OP (UNOP_DYNAMIC_CAST)
213
214/* The C++ reinterpret_cast operator. */
215OP (UNOP_REINTERPRET_CAST)
216
217/* UNOP_MEMVAL is followed by a type pointer in the next exp_element
218 With another UNOP_MEMVAL at the end, this makes three exp_elements.
219 It casts the contents of the word addressed by the value of the
220 following subexpression. */
221OP (UNOP_MEMVAL)
222
223/* UNOP_MEMVAL_TLS is followed by a `struct objfile' pointer in the next
224 exp_element and a type pointer in the following exp_element.
225 With another UNOP_MEMVAL_TLS at the end, this makes four exp_elements.
226 It casts the contents of the word offsetted by the value of the
227 following subexpression from the TLS specified by `struct objfile'. */
228OP (UNOP_MEMVAL_TLS)
229
9eaf6705
TT
230/* Like UNOP_MEMVAL, but the type is supplied as a subexpression. */
231OP (UNOP_MEMVAL_TYPE)
232
56c12414
JK
233/* UNOP_... operate on one value from a following subexpression
234 and replace it with a result. They take no immediate arguments. */
235
236OP (UNOP_NEG) /* Unary - */
237OP (UNOP_LOGICAL_NOT) /* Unary ! */
238OP (UNOP_COMPLEMENT) /* Unary ~ */
239OP (UNOP_IND) /* Unary * */
240OP (UNOP_ADDR) /* Unary & */
241OP (UNOP_PREINCREMENT) /* ++ before an expression */
242OP (UNOP_POSTINCREMENT) /* ++ after an expression */
243OP (UNOP_PREDECREMENT) /* -- before an expression */
244OP (UNOP_POSTDECREMENT) /* -- after an expression */
245OP (UNOP_SIZEOF) /* Unary sizeof (followed by expression) */
246
247OP (UNOP_PLUS) /* Unary plus */
248
249OP (UNOP_CAP) /* Modula-2 standard (unary) procedures */
250OP (UNOP_CHR)
251OP (UNOP_ORD)
252OP (UNOP_ABS)
253OP (UNOP_FLOAT)
254OP (UNOP_HIGH)
255OP (UNOP_MAX)
256OP (UNOP_MIN)
257OP (UNOP_ODD)
258OP (UNOP_TRUNC)
259
260OP (OP_BOOL) /* Modula-2 builtin BOOLEAN type */
261OP (OP_M2_STRING) /* Modula-2 string constants */
262
263/* STRUCTOP_... operate on a value from a following subexpression
264 by extracting a structure component specified by a string
265 that appears in the following exp_elements (as many as needed).
266 STRUCTOP_STRUCT is used for "." and STRUCTOP_PTR for "->".
267 They differ only in the error message given in case the value is
268 not suitable or the structure component specified is not found.
269
270 The length of the string follows the opcode, followed by
271 BYTES_TO_EXP_ELEM(length) elements containing the data of the
272 string, followed by the length again and the opcode again. */
273
274OP (STRUCTOP_STRUCT)
275OP (STRUCTOP_PTR)
276
277/* C++: OP_THIS is just a placeholder for the class instance variable.
278 It just comes in a tight (OP_THIS, OP_THIS) pair. */
279OP (OP_THIS)
280
56c12414
JK
281/* Objective C: "@selector" pseudo-operator. */
282OP (OP_OBJC_SELECTOR)
283
284/* OP_SCOPE surrounds a type name and a field name. The type
285 name is encoded as one element, but the field name stays as
286 a string, which, of course, is variable length. */
287OP (OP_SCOPE)
288
56c12414
JK
289/* OP_TYPE is for parsing types, and used with the "ptype" command
290 so we can look up types that are qualified by scope, either with
291 the GDB "::" operator, or the Modula-2 '.' operator. */
292OP (OP_TYPE)
293
294/* An un-looked-up identifier. */
295OP (OP_NAME)
296
297/* An Objective C Foundation Class NSString constant. */
298OP (OP_OBJC_NSSTRING)
299
300/* A F90 array range operator (for "exp:exp", "exp:", ":exp" and ":"). */
301OP (OP_F90_RANGE)
302
303/* OP_DECFLOAT is followed by a type pointer in the next exp_element
304 and a dec long constant value in the following exp_element.
305 Then comes another OP_DECFLOAT. */
306OP (OP_DECFLOAT)
307
308/* OP_ADL_FUNC specifies that the function is to be looked up in an
309 Argument Dependent manner (Koenig lookup). */
310OP (OP_ADL_FUNC)
608b4967
TT
311
312/* The typeof operator. This has one expression argument, which is
313 evaluated solely for its type. */
314OP (OP_TYPEOF)
315
316/* The decltype operator. This has one expression argument, which is
317 evaluated solely for its type. This is similar to typeof, but has
318 slight different semantics. */
319OP (OP_DECLTYPE)
This page took 0.300865 seconds and 4 git commands to generate.