aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1995-11-29 22:59:31 +0000
committerPer Bothner <per@bothner.com>1995-11-29 22:59:31 +0000
commitbadefd2800f5ee2dc6a0eef870771af9dc29bba7 (patch)
tree042d9206d56686bbe7753b3467d91f5ee03ce794 /gdb/eval.c
parentb00c57ec37e4c971d96b40cf76ce21f8837b84a5 (diff)
downloadgdb-badefd2800f5ee2dc6a0eef870771af9dc29bba7.zip
gdb-badefd2800f5ee2dc6a0eef870771af9dc29bba7.tar.gz
gdb-badefd2800f5ee2dc6a0eef870771af9dc29bba7.tar.bz2
* expression.h (enum exp_opcode): Add BINOP_RANGE.
* expprint.c (dump_expression): Support BINOP_RANGE. * eval.c (evaluate_subexp_standard): Handle BINOP_RANGE (as error). (case MULTI_SUBSCRIPT): Fix broken f77 value->int ad hoc conversion. * ch-lang.c (chill_op_print_tab): Support BINOP_RANGE. (evaluate_subexp_chill): Error on BINOP_COMMA.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 65c9312..05adc90 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -978,6 +978,13 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
else
return value_binop (arg1, arg2, op);
+ case BINOP_RANGE:
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+ error ("':' operator used in invalid context");
+
case BINOP_SUBSCRIPT:
arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
@@ -1087,12 +1094,9 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
/* Evaluate each subscript, It must be a legal integer in F77 */
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
- if (TYPE_CODE (VALUE_TYPE (arg2)) != TYPE_CODE_INT)
- error ("Array subscripts must be of type integer");
-
/* Fill in the subscript and array size arrays */
- subscript_array[i] = (* (unsigned int *) VALUE_CONTENTS(arg2));
+ subscript_array[i] = value_as_long (arg2);
retcode = f77_get_dynamic_upperbound (tmp_type, &upper);
if (retcode == BOUND_FETCH_ERROR)