}
}
+/* Helper for returning a value when handling EVAL_SKIP. */
+
+static value *
+eval_skip_value (expression *exp)
+{
+ return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
+}
+
struct value *
evaluate_subexp_standard (struct type *expect_type,
struct expression *exp, int *pos,
tem = longest_to_int (exp->elts[pc + 2].longconst);
(*pos) += 4 + BYTES_TO_EXP_ELEM (tem + 1);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
arg1 = value_aggregate_elt (exp->elts[pc + 1].type,
&exp->elts[pc + 3].string,
expect_type, 0, noside);
case OP_VAR_VALUE:
(*pos) += 3;
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
/* JYG: We used to just return value_zero of the symbol type
if we're asked to avoid side effects. Otherwise we return
case OP_VAR_ENTRY_VALUE:
(*pos) += 2;
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
{
struct symbol *sym = exp->elts[pc + 1].symbol;
tem = longest_to_int (exp->elts[pc + 1].longconst);
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
type = language_string_char_type (exp->language_defn, exp->gdbarch);
return value_string (&exp->elts[pc + 2].string, tem, type);
tem = longest_to_int (exp->elts[pc + 1].longconst);
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
if (noside == EVAL_SKIP)
- {
- goto nosideret;
- }
+ return eval_skip_value (exp);
return value_nsstring (exp->gdbarch, &exp->elts[pc + 2].string, tem + 1);
case OP_ARRAY:
argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside);
}
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
return value_array (tem2, tem3, argvec);
case TERNOP_SLICE:
= value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
return value_slice (array, lowbound, upper - lowbound + 1);
}
(*pos) += 3 + BYTES_TO_EXP_ELEM (len + 1);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (sel[len] != 0)
sel[len] = 0; /* Make sure it's terminated. */
}
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
argvec[tem] = 0;
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (op == OP_ADL_FUNC)
{
argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside);
argvec[tem] = 0; /* signal end of arglist */
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
goto do_call_it;
default:
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
arg3 = value_struct_elt (&arg1, NULL, &exp->elts[pc + 2].string,
NULL, "structure");
if (noside == EVAL_AVOID_SIDE_EFFECTS)
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
/* Check to see if operator '->' has been overloaded. If so replace
arg1 with the value returned by evaluating operator->(). */
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
type = check_typedef (value_type (arg2));
switch (TYPE_CODE (type))
arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
else
arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
else if (ptrmath_type_p (exp->language_defn, value_type (arg1))
arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
else if (ptrmath_type_p (exp->language_defn, value_type (arg1))
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
else
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
else
if (noside == EVAL_SKIP)
{
if (nargs > 0)
- {
- continue;
- }
- else
- {
- goto nosideret;
- }
+ continue;
+ return eval_skip_value (exp);
}
/* FIXME: EVAL_AVOID_SIDE_EFFECTS handling may not be correct. */
if (noside == EVAL_AVOID_SIDE_EFFECTS)
if (noside == EVAL_SKIP)
{
evaluate_subexp (NULL_TYPE, exp, pos, noside);
- goto nosideret;
+ return eval_skip_value (exp);
}
oldpos = *pos;
if (noside == EVAL_SKIP)
{
evaluate_subexp (NULL_TYPE, exp, pos, noside);
- goto nosideret;
+ return eval_skip_value (exp);
}
oldpos = *pos;
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
{
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
{
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
{
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
{
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
{
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (binop_user_defined_p (op, arg1, arg2))
{
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
type = check_typedef (value_type (arg2));
if (TYPE_CODE (type) != TYPE_CODE_INT
&& TYPE_CODE (type) != TYPE_CODE_ENUM)
case UNOP_PLUS:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (unop_user_defined_p (op, arg1))
return value_x_unop (arg1, op, noside);
else
case UNOP_NEG:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (unop_user_defined_p (op, arg1))
return value_x_unop (arg1, op, noside);
else
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (unop_user_defined_p (UNOP_COMPLEMENT, arg1))
return value_x_unop (arg1, UNOP_COMPLEMENT, noside);
else
case UNOP_LOGICAL_NOT:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (unop_user_defined_p (op, arg1))
return value_x_unop (arg1, op, noside);
else
error (_("Attempt to dereference pointer "
"to member without an object"));
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (unop_user_defined_p (op, arg1))
return value_x_unop (arg1, op, noside);
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
if (noside == EVAL_SKIP)
{
evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- goto nosideret;
+ return eval_skip_value (exp);
}
else
{
if (noside == EVAL_SKIP)
{
evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- goto nosideret;
+ return eval_skip_value (exp);
}
return evaluate_subexp_for_sizeof (exp, pos, noside);
type = exp->elts[pc + 1].type;
arg1 = evaluate_subexp (type, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (type != value_type (arg1))
arg1 = value_cast (type, arg1);
return arg1;
type = value_type (arg1);
arg1 = evaluate_subexp (type, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (type != value_type (arg1))
arg1 = value_cast (type, arg1);
return arg1;
type = value_type (arg1);
arg1 = evaluate_subexp (type, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
return value_dynamic_cast (type, arg1);
case UNOP_REINTERPRET_CAST:
type = value_type (arg1);
arg1 = evaluate_subexp (type, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
return value_reinterpret_cast (type, arg1);
case UNOP_MEMVAL:
(*pos) += 2;
arg1 = evaluate_subexp (expect_type, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (exp->elts[pc + 1].type, lval_memory);
else
type = value_type (arg1);
arg1 = evaluate_subexp (expect_type, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (type, lval_memory);
else
(*pos) += 3;
arg1 = evaluate_subexp (expect_type, exp, pos, noside);
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (exp->elts[pc + 2].type, lval_memory);
else
easier to accommodate expressions that contain types. */
(*pos) += 2;
if (noside == EVAL_SKIP)
- goto nosideret;
+ return eval_skip_value (exp);
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
return allocate_value (exp->elts[pc + 1].type);
else
if (noside == EVAL_SKIP)
{
evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- goto nosideret;
+ return eval_skip_value (exp);
}
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
"evaluate that kind of expression"));
}
-nosideret:
- return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
+ gdb_assert_not_reached ("missed return?");
}
\f
/* Evaluate a subexpression of EXP, at index *POS,