aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2014-04-15 11:28:15 +0800
committerYao Qi <yao@codesourcery.com>2014-07-21 03:46:37 +0800
commitae8fddda32d161ea0d8606fdd71349230d5b0ad6 (patch)
tree40bd274988386df0867d8fae0a126993c05d051a /gdb/eval.c
parent9c81664074faf6028036d9b3615ab860396b0c81 (diff)
downloadgdb-ae8fddda32d161ea0d8606fdd71349230d5b0ad6.zip
gdb-ae8fddda32d161ea0d8606fdd71349230d5b0ad6.tar.gz
gdb-ae8fddda32d161ea0d8606fdd71349230d5b0ad6.tar.bz2
Remove operator BINOP_RANGE
BINOP_RANGE was added by the following commit for chill language. commit badefd2800f5ee2dc6a0eef870771af9dc29bba7 Author: Per Bothner <per@bothner.com> Date: Wed Nov 29 22:59:31 1995 +0000 * 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. Chill language is no longer supported, so we can remove BINOP_RANGE too. This patch is to remove BINOP_RANGE. gdb: 2014-07-20 Yao Qi <yao@codesourcery.com> * std-operator.def: Remove BINOP_RANGE. * breakpoint.c (watchpoint_exp_is_const): Update. * expprint.c (dump_subexp_body_standard): Likewise. * eval.c (init_array_element): Remove dead code. (evaluate_subexp_standard): Likewise.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c48
1 files changed, 4 insertions, 44 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 949b2f8..f075096 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -369,22 +369,6 @@ init_array_element (struct value *array, struct value *element,
return init_array_element (array, element,
exp, pos, noside, low_bound, high_bound);
}
- else if (exp->elts[*pos].opcode == BINOP_RANGE)
- {
- LONGEST low, high;
-
- (*pos)++;
- low = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
- high = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
- if (low < low_bound || high > high_bound)
- error (_("tuple range index out of range"));
- for (index = low; index <= high; index++)
- {
- memcpy (value_contents_raw (array)
- + (index - low_bound) * element_size,
- value_contents (element), element_size);
- }
- }
else
{
index = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
@@ -903,11 +887,6 @@ evaluate_subexp_standard (struct type *expect_type,
struct value *element;
int index_pc = 0;
- if (exp->elts[*pos].opcode == BINOP_RANGE)
- {
- index_pc = ++(*pos);
- evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- }
element = evaluate_subexp (element_type, exp, pos, noside);
if (value_type (element) != element_type)
element = value_cast (element_type, element);
@@ -958,22 +937,10 @@ evaluate_subexp_standard (struct type *expect_type,
struct type *range_low_type, *range_high_type;
struct value *elem_val;
- if (exp->elts[*pos].opcode == BINOP_RANGE)
- {
- (*pos)++;
- elem_val = evaluate_subexp (element_type, exp, pos, noside);
- range_low_type = value_type (elem_val);
- range_low = value_as_long (elem_val);
- elem_val = evaluate_subexp (element_type, exp, pos, noside);
- range_high_type = value_type (elem_val);
- range_high = value_as_long (elem_val);
- }
- else
- {
- elem_val = evaluate_subexp (element_type, exp, pos, noside);
- range_low_type = range_high_type = value_type (elem_val);
- range_low = range_high = value_as_long (elem_val);
- }
+ elem_val = evaluate_subexp (element_type, exp, pos, noside);
+ range_low_type = range_high_type = value_type (elem_val);
+ range_low = range_high = value_as_long (elem_val);
+
/* Check types of elements to avoid mixture of elements from
different types. Also check if type of element is "compatible"
with element type of powerset. */
@@ -2127,13 +2094,6 @@ evaluate_subexp_standard (struct type *expect_type,
}
}
- case BINOP_RANGE:
- evaluate_subexp (NULL_TYPE, exp, pos, noside);
- 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 (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);