diff options
author | Per Bothner <per@bothner.com> | 1995-11-29 22:59:31 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1995-11-29 22:59:31 +0000 |
commit | badefd2800f5ee2dc6a0eef870771af9dc29bba7 (patch) | |
tree | 042d9206d56686bbe7753b3467d91f5ee03ce794 /gdb | |
parent | b00c57ec37e4c971d96b40cf76ce21f8837b84a5 (diff) | |
download | gdb-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')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/ch-lang.c | 4 | ||||
-rw-r--r-- | gdb/eval.c | 12 |
3 files changed, 19 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c78cbc6..1e2654a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ Wed Nov 29 13:35:18 1995 Per Bothner <bothner@kalessin.cygnus.com> + * 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. + * Makefile.in: Clean up so doc stuff stays in doc sub-dir. Wed Nov 29 16:39:50 1995 Michael Meissner <meissner@tiktok.cygnus.com> diff --git a/gdb/ch-lang.c b/gdb/ch-lang.c index f8be814..1e681f5 100644 --- a/gdb/ch-lang.c +++ b/gdb/ch-lang.c @@ -272,6 +272,7 @@ static const struct op_print chill_op_print_tab[] = { {"-", UNOP_NEG, PREC_PREFIX, 0}, {"->", UNOP_IND, PREC_SUFFIX, 1}, {"->", UNOP_ADDR, PREC_PREFIX, 0}, + {":", BINOP_RANGE, PREC_ASSIGN, 0}, {NULL, 0, 0, 0} }; @@ -453,6 +454,9 @@ evaluate_subexp_chill (expect_type, exp, pos, noside) arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, noside); return value_chill_length (arg1); + case BINOP_COMMA: + error ("',' operator used in invalid context"); + default: break; } @@ -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) |