aboutsummaryrefslogtreecommitdiff
path: root/gdb/expression.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/expression.h')
-rw-r--r--gdb/expression.h45
1 files changed, 32 insertions, 13 deletions
diff --git a/gdb/expression.h b/gdb/expression.h
index 0ef5c4d..8a6cf4b 100644
--- a/gdb/expression.h
+++ b/gdb/expression.h
@@ -20,6 +20,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (EXPRESSION_H)
#define EXPRESSION_H 1
+#ifdef __STDC__
+struct block; /* Forward declaration for prototypes */
+#endif
+
/* Definitions for saved C expressions. */
/* An expression is represented as a vector of union exp_element's.
@@ -50,11 +54,11 @@ enum exp_opcode
BINOP_REM, /* % */
BINOP_LSH, /* << */
BINOP_RSH, /* >> */
- BINOP_AND, /* && */
- BINOP_OR, /* || */
- BINOP_LOGAND, /* & */
- BINOP_LOGIOR, /* | */
- BINOP_LOGXOR, /* ^ */
+ BINOP_LOGICAL_AND, /* && */
+ BINOP_LOGICAL_OR, /* || */
+ BINOP_BITWISE_AND, /* & */
+ BINOP_BITWISE_IOR, /* | */
+ BINOP_BITWISE_XOR, /* ^ */
BINOP_EQUAL, /* == */
BINOP_NOTEQUAL, /* != */
BINOP_LESS, /* < */
@@ -65,7 +69,6 @@ enum exp_opcode
BINOP_ASSIGN, /* = */
BINOP_COMMA, /* , */
BINOP_SUBSCRIPT, /* x[y] */
- BINOP_MULTI_SUBSCRIPT, /* Modula-2 x[a,b,...] */
BINOP_EXP, /* Exponentiation */
/* C++. */
@@ -101,6 +104,14 @@ enum exp_opcode
/* Operates on three values computed by following subexpressions. */
TERNOP_COND, /* ?: */
+/* Multidimensional subscript operator, such as Modula-2 x[a,b,...].
+ The dimensionality is encoded in the operator, like the number of
+ function arguments in OP_FUNCALL, I.E. <OP><dimension><OP>.
+ The value of the first following subexpression is subscripted
+ by each of the next following subexpressions, one per dimension. */
+
+ MULTI_SUBSCRIPT,
+
/* The OP_... series take immediate following arguments.
After the arguments come another OP_... (the same one)
so that the grouping can be recognized from the end. */
@@ -153,8 +164,8 @@ enum exp_opcode
/* UNOP_... operate on one value from a following subexpression
and replace it with a result. They take no immediate arguments. */
UNOP_NEG, /* Unary - */
- UNOP_ZEROP, /* Unary ! */
- UNOP_LOGNOT, /* Unary ~ */
+ UNOP_LOGICAL_NOT, /* Unary ! */
+ UNOP_COMPLEMENT, /* Unary ~ */
UNOP_IND, /* Unary * */
UNOP_ADDR, /* Unary & */
UNOP_PREINCREMENT, /* ++ before an expression */
@@ -186,11 +197,6 @@ enum exp_opcode
They differ only in the error message given in case the value is
not suitable or the structure component specified is not found.
- After the sub-expression and before the string is a (struct type*).
- This is normally NULL, but is used for the TYPE in a C++ qualified
- reference like EXP.TYPE::NAME. (EXP.TYPE1::TYPE2::NAME does
- not work, unfortunately.)
-
The length of the string follows in the next exp_element,
(after the string), followed by another STRUCTOP_... code. */
STRUCTOP_STRUCT,
@@ -251,4 +257,17 @@ print_expression PARAMS ((struct expression *, FILE *));
extern char *
op_string PARAMS ((enum exp_opcode));
+/* To enable dumping of all parsed expressions in a human readable
+ form, define DEBUG_EXPRESSIONS. This is a compile time constant
+ at the moment, since it's not clear that this feature is important
+ enough to include by default. */
+
+#ifdef DEBUG_EXPRESSIONS
+extern void
+dump_expression PARAMS ((struct expression *, FILE *, char *));
+#define DUMP_EXPRESSION(exp,file,note) dump_expression ((exp), (file), (note))
+#else
+#define DUMP_EXPRESSION(exp,file,note) /* Null expansion */
+#endif /* DEBUG_EXPRESSIONS */
+
#endif /* !defined (EXPRESSION_H) */