aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcall.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/infcall.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/infcall.c')
-rw-r--r--gdb/infcall.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 9242c46..721b32d 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -111,6 +111,12 @@ value_arg_coerce (struct value *arg, struct type *param_type,
if (current_language->la_language == language_ada)
arg = ada_convert_actual (arg, type, sp);
+ /* Force the value to the target if we will need its address. At
+ this point, we could allocate arguments on the stack instead of
+ calling malloc if we knew that their addresses would not be
+ saved by the called function. */
+ arg = value_coerce_to_target (arg);
+
switch (TYPE_CODE (type))
{
case TYPE_CODE_REF: