aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2011-03-15 14:40:22 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2011-03-15 14:40:22 +0000
commit81b4675a00a6cef0e3e4e965dd70d41d178180e0 (patch)
tree1d57c50dbfadfbed4d66eda9f9725cf7b5985609 /gdb/infcall.c
parentc917473769c83e9779a9e65568a2a9b2acf2fb42 (diff)
downloadgdb-81b4675a00a6cef0e3e4e965dd70d41d178180e0.zip
gdb-81b4675a00a6cef0e3e4e965dd70d41d178180e0.tar.gz
gdb-81b4675a00a6cef0e3e4e965dd70d41d178180e0.tar.bz2
* infcall.c (call_function_by_hand): Function return value is
always a non_lval, even when using struct_return.
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r--gdb/infcall.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 75de56c..d42248e 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -1010,29 +1010,29 @@ When the function is done executing, GDB will silently stop."),
restore_infcall_control_state (inf_status);
/* Figure out the value returned by the function. */
+ retval = allocate_value (values_type);
if (lang_struct_return)
- retval = value_at (values_type, struct_addr);
- else if (TYPE_CODE (target_values_type) == TYPE_CODE_VOID)
+ read_value_memory (retval, 0, 1, struct_addr,
+ value_contents_raw (retval),
+ TYPE_LENGTH (values_type));
+ else if (TYPE_CODE (target_values_type) != TYPE_CODE_VOID)
{
/* If the function returns void, don't bother fetching the
return value. */
- retval = allocate_value (values_type);
- }
- else
- {
switch (gdbarch_return_value (gdbarch, value_type (function),
target_values_type, NULL, NULL, NULL))
{
case RETURN_VALUE_REGISTER_CONVENTION:
case RETURN_VALUE_ABI_RETURNS_ADDRESS:
case RETURN_VALUE_ABI_PRESERVES_ADDRESS:
- retval = allocate_value (values_type);
gdbarch_return_value (gdbarch, value_type (function), values_type,
retbuf, value_contents_raw (retval), NULL);
break;
case RETURN_VALUE_STRUCT_CONVENTION:
- retval = value_at (values_type, struct_addr);
+ read_value_memory (retval, 0, 1, struct_addr,
+ value_contents_raw (retval),
+ TYPE_LENGTH (values_type));
break;
}
}