diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2009-01-15 15:38:07 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2009-01-15 15:38:07 +0000 |
commit | 61212c0fb13d0a54f12748dcc56a41c15a91d12a (patch) | |
tree | d006b77357adb211693a534f9f5d25e962e128cb /gdb/eval.c | |
parent | cc2420d5bbb6f8ebfc231b80e87e9987585a7549 (diff) | |
download | gdb-61212c0fb13d0a54f12748dcc56a41c15a91d12a.zip gdb-61212c0fb13d0a54f12748dcc56a41c15a91d12a.tar.gz gdb-61212c0fb13d0a54f12748dcc56a41c15a91d12a.tar.bz2 |
* value.h (address_of_variable): Add prototype.
(locate_var_value): Remove prototype.
* findvar.c (read_var_value): Do not attempt to default frame
to selected frame.
(locate_var_value): Remove function.
* valops.c (value_of_variable): Retrieve selected frame for
symbols that require a frame when called with NULL block.
* valops.c (address_of_variable): New function.
* eval.c (evaluate_subexp_for_address): Call address_of_variable
instead of calling locate_var_value.
(evaluate_subexp_with_coercion): Likewise.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r-- | gdb/eval.c | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -2560,13 +2560,8 @@ evaluate_subexp_for_address (struct expression *exp, int *pos, return value_zero (type, not_lval); } - else if (symbol_read_needs_frame (var)) - return - locate_var_value - (var, - block_innermost_frame (exp->elts[pc + 1].block)); else - return locate_var_value (var, NULL); + return address_of_variable (var, exp->elts[pc + 1].block); case OP_SCOPE: tem = longest_to_int (exp->elts[pc + 2].longconst); @@ -2620,6 +2615,7 @@ evaluate_subexp_with_coercion (struct expression *exp, int pc; struct value *val; struct symbol *var; + struct type *type; pc = (*pos); op = exp->elts[pc].opcode; @@ -2628,14 +2624,13 @@ evaluate_subexp_with_coercion (struct expression *exp, { case OP_VAR_VALUE: var = exp->elts[pc + 2].symbol; - if (TYPE_CODE (check_typedef (SYMBOL_TYPE (var))) == TYPE_CODE_ARRAY + type = check_typedef (SYMBOL_TYPE (var)); + if (TYPE_CODE (type) == TYPE_CODE_ARRAY && CAST_IS_CONVERSION) { (*pos) += 4; - val = - locate_var_value - (var, block_innermost_frame (exp->elts[pc + 1].block)); - return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (check_typedef (SYMBOL_TYPE (var)))), + val = address_of_variable (var, exp->elts[pc + 1].block); + return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), val); } /* FALLTHROUGH */ |