aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2008-03-21 15:02:38 +0000
committerDaniel Jacobowitz <drow@false.org>2008-03-21 15:02:38 +0000
commit6309237547d076d68daaf8f4d0cd55c5964e1411 (patch)
treeff4100d106e01c43dd82f47a59d0071d99cae1c6 /gdb/eval.c
parentb21991b00cf16b94e9646a054e786c1fa4d5501a (diff)
downloadgdb-6309237547d076d68daaf8f4d0cd55c5964e1411.zip
gdb-6309237547d076d68daaf8f4d0cd55c5964e1411.tar.gz
gdb-6309237547d076d68daaf8f4d0cd55c5964e1411.tar.bz2
* eval.c (evaluate_subexp_for_address): Clarify error message.
Use value_must_coerce_to_target. * infcall.c (value_arg_coerce): Call value_coerce_to_target. * valops.c (value_assign): Call value_coerce_to_target when assigning to anything but internalvars. Leave GDB-side arrays as arrays when assigning to internalvars. (value_must_coerce_to_target, value_coerce_to_target): New. (value_coerce_array, value_addr): Call value_coerce_to_target. (value_array): Create the array in GDB's memory instead of the inferior's. * value.h (value_must_coerce_to_target, value_coerce_to_target): Declare. * gdb.texinfo (Expressions): Update description of malloced arrays. * gdb.base/printcmds.exp (test_print_array_constants): Do not expect *& to work on created array elements. (Top level): Test print $pc with a file. Test string operations without a target. * gdb.base/ptype.exp: Do not expect *& to work on created array elements.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index efe1dc2..79defeb 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2204,14 +2204,14 @@ evaluate_subexp_for_address (struct expression *exp, int *pos,
{
struct type *type = check_typedef (value_type (x));
- if (VALUE_LVAL (x) == lval_memory)
+ if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
return value_zero (lookup_pointer_type (value_type (x)),
not_lval);
else if (TYPE_CODE (type) == TYPE_CODE_REF)
return value_zero (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
not_lval);
else
- error (_("Attempt to take address of non-lval"));
+ error (_("Attempt to take address of value not located in memory."));
}
return value_addr (x);
}