diff options
Diffstat (limited to 'gdb/eval.c')
-rw-r--r-- | gdb/eval.c | 33 |
1 files changed, 19 insertions, 14 deletions
@@ -212,7 +212,6 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp, int preserve_errors) { struct value *mark, *new_mark, *result; - volatile struct gdb_exception ex; *valp = NULL; if (resultp) @@ -224,11 +223,11 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp, mark = value_mark (); result = NULL; - TRY_CATCH (ex, RETURN_MASK_ALL) + TRY { result = evaluate_subexp (NULL_TYPE, exp, pc, EVAL_NORMAL); } - if (ex.reason < 0) + CATCH (ex, RETURN_MASK_ALL) { /* Ignore memory errors if we want watchpoints pointing at inaccessible memory to still be created; otherwise, throw the @@ -243,6 +242,7 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp, break; } } + END_CATCH new_mark = value_mark (); if (mark == new_mark) @@ -258,13 +258,16 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp, *valp = result; else { - volatile struct gdb_exception except; - TRY_CATCH (except, RETURN_MASK_ERROR) + TRY { value_fetch_lazy (result); *valp = result; } + CATCH (except, RETURN_MASK_ERROR) + { + } + END_CATCH } } @@ -762,16 +765,15 @@ evaluate_subexp_standard (struct type *expect_type, or reference to a base class and print object is on. */ { - volatile struct gdb_exception except; struct value *ret = NULL; - TRY_CATCH (except, RETURN_MASK_ERROR) + TRY { ret = value_of_variable (exp->elts[pc + 2].symbol, exp->elts[pc + 1].block); } - if (except.reason < 0) + CATCH (except, RETURN_MASK_ERROR) { if (noside == EVAL_AVOID_SIDE_EFFECTS) ret = value_zero (SYMBOL_TYPE (exp->elts[pc + 2].symbol), @@ -779,6 +781,7 @@ evaluate_subexp_standard (struct type *expect_type, else throw_exception (except); } + END_CATCH return ret; } @@ -1446,20 +1449,21 @@ evaluate_subexp_standard (struct type *expect_type, operator and continue evaluation. */ while (unop_user_defined_p (op, arg2)) { - volatile struct gdb_exception except; struct value *value = NULL; - TRY_CATCH (except, RETURN_MASK_ERROR) + TRY { value = value_x_unop (arg2, op, noside); } - if (except.reason < 0) + CATCH (except, RETURN_MASK_ERROR) { if (except.error == NOT_FOUND_ERROR) break; else throw_exception (except); } + END_CATCH + arg2 = value; } } @@ -1863,20 +1867,21 @@ evaluate_subexp_standard (struct type *expect_type, arg1 with the value returned by evaluating operator->(). */ while (unop_user_defined_p (op, arg1)) { - volatile struct gdb_exception except; struct value *value = NULL; - TRY_CATCH (except, RETURN_MASK_ERROR) + TRY { value = value_x_unop (arg1, op, noside); } - if (except.reason < 0) + CATCH (except, RETURN_MASK_ERROR) { if (except.error == NOT_FOUND_ERROR) break; else throw_exception (except); } + END_CATCH + arg1 = value; } |