2003-07-30 Michael Snyder <msnyder@redhat.com>
* structs.h (value_being_returned): Add a struct_addr argument. * infcall.c (call_function_by_hand): Pass struct_addr to value_being_returned. * infcmd.c (print_return_value): Pass zero as struct_addr. * values.c (value_being_returned): If struct_addr is passed, use it instead of trying to recover it from the inferior.
This commit is contained in:
parent
f0d8db1927
commit
c48a845bff
5 changed files with 54 additions and 33 deletions
47
gdb/values.c
47
gdb/values.c
|
@ -1212,31 +1212,36 @@ value_from_double (struct type *type, DOUBLEST num)
|
|||
/* ARGSUSED */
|
||||
struct value *
|
||||
value_being_returned (struct type *valtype, struct regcache *retbuf,
|
||||
int struct_return)
|
||||
int struct_return, CORE_ADDR struct_addr)
|
||||
{
|
||||
struct value *val;
|
||||
CORE_ADDR addr;
|
||||
|
||||
/* If this is not defined, just use EXTRACT_RETURN_VALUE instead. */
|
||||
if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
|
||||
if (struct_return)
|
||||
{
|
||||
addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
|
||||
if (!addr)
|
||||
error ("Function return value unknown.");
|
||||
return value_at (valtype, addr, NULL);
|
||||
}
|
||||
|
||||
/* If this is not defined, just use EXTRACT_RETURN_VALUE instead. */
|
||||
if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
|
||||
if (struct_return)
|
||||
{
|
||||
char *buf = deprecated_grub_regcache_for_registers (retbuf);
|
||||
addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (buf);
|
||||
if (!addr)
|
||||
error ("Function return value unknown.");
|
||||
return value_at (valtype, addr, NULL);
|
||||
}
|
||||
if (struct_return)
|
||||
{
|
||||
if (struct_addr != 0)
|
||||
{
|
||||
/* Struct return addr supplied by hand_function_call. */
|
||||
return value_at (valtype, struct_addr, NULL);
|
||||
}
|
||||
/* If one of these is not defined, just use EXTRACT_RETURN_VALUE
|
||||
instead. */
|
||||
else if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
|
||||
{
|
||||
addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
|
||||
if (!addr)
|
||||
error ("Function return value unknown.");
|
||||
return value_at (valtype, addr, NULL);
|
||||
}
|
||||
else if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
|
||||
{
|
||||
char *buf = deprecated_grub_regcache_for_registers (retbuf);
|
||||
addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (buf);
|
||||
if (!addr)
|
||||
error ("Function return value unknown.");
|
||||
return value_at (valtype, addr, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
val = allocate_value (valtype);
|
||||
CHECK_TYPEDEF (valtype);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue