aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-06-20 18:10:14 +0000
committerAndrew Cagney <cagney@redhat.com>2004-06-20 18:10:14 +0000
commit750eb019f10b80dfed775e0062e33326f5a79adb (patch)
tree428eaa7d99873e8068d8c213ad6cbcfd725b0642 /gdb/infcmd.c
parentb5622e8d3cc3ba6ed60cbfee39a9c094074e27a1 (diff)
downloadgdb-750eb019f10b80dfed775e0062e33326f5a79adb.zip
gdb-750eb019f10b80dfed775e0062e33326f5a79adb.tar.gz
gdb-750eb019f10b80dfed775e0062e33326f5a79adb.tar.bz2
2004-06-20 Andrew Cagney <cagney@gnu.org>
* gdbarch.sh (RETURN_VALUE): Default to legacy_return_value. * gdbarch.h, gdbarch.c: Re-generate. * Makefile.in (arch-utils.o): Update dependencies. * values.c (using_struct_return): Move code calling USE_STRUCT_CONVENTION to legacy_return_value, simplify. * stack.c (return_command): Move code calling STORE_RETURN_VALUE to legacy_return_value, simplify. * infcmd.c (print_return_value): Move code calling DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS and EXTRACT_RETURN_VALUE to legacy_return_value, simplify. * infcall.c (call_function_by_hand): Move code calling EXTRACT_RETURN_VALUE to legacy_return_value, simplify. * arch-utils.c: Update copyright. Include "gdbcore.h". (legacy_return_value): New function. * arch-utils.h: Update copyright. (legacy_return_value): Declare.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c40
1 files changed, 12 insertions, 28 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 3aa6e41..46d57be 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1091,36 +1091,20 @@ print_return_value (int struct_return, struct type *value_type)
inferior function call code. In fact, when inferior function
calls are made async, this will likely be made the norm. */
- if (gdbarch_return_value_p (gdbarch))
- {
- switch (gdbarch_return_value (gdbarch, value_type, NULL, NULL, NULL))
- {
- case RETURN_VALUE_REGISTER_CONVENTION:
- case RETURN_VALUE_ABI_RETURNS_ADDRESS:
- value = allocate_value (value_type);
- CHECK_TYPEDEF (value_type);
- gdbarch_return_value (current_gdbarch, value_type, stop_registers,
- VALUE_CONTENTS_RAW (value), NULL);
- break;
- case RETURN_VALUE_STRUCT_CONVENTION:
- value = NULL;
- break;
- default:
- internal_error (__FILE__, __LINE__, "bad switch");
- }
- }
- else if (struct_return && DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
- {
- CORE_ADDR addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (stop_registers);
- if (!addr)
- error ("Function return value unknown.");
- value = value_at (value_type, addr, NULL);
- }
- else
+ switch (gdbarch_return_value (gdbarch, value_type, NULL, NULL, NULL))
{
+ case RETURN_VALUE_REGISTER_CONVENTION:
+ case RETURN_VALUE_ABI_RETURNS_ADDRESS:
value = allocate_value (value_type);
- EXTRACT_RETURN_VALUE (value_type, stop_registers,
- VALUE_CONTENTS_RAW (value));
+ CHECK_TYPEDEF (value_type);
+ gdbarch_return_value (current_gdbarch, value_type, stop_registers,
+ VALUE_CONTENTS_RAW (value), NULL);
+ break;
+ case RETURN_VALUE_STRUCT_CONVENTION:
+ value = NULL;
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
}
if (value)