diff options
author | Michael Snyder <msnyder@vmware.com> | 2003-07-30 20:59:10 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2003-07-30 20:59:10 +0000 |
commit | c48a845bff656d9f07bf53c0004bb0fed62891ae (patch) | |
tree | f82e8f84973942a28a40900c23384acc047d41ae /gdb/values.c | |
parent | f0d8db192735d4610f8a1bd3db8b67bf4b13f906 (diff) | |
download | gdb-c48a845bff656d9f07bf53c0004bb0fed62891ae.zip gdb-c48a845bff656d9f07bf53c0004bb0fed62891ae.tar.gz gdb-c48a845bff656d9f07bf53c0004bb0fed62891ae.tar.bz2 |
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.
Diffstat (limited to 'gdb/values.c')
-rw-r--r-- | gdb/values.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/gdb/values.c b/gdb/values.c index 42395c8..7e7e9b1 100644 --- a/gdb/values.c +++ b/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); |