aboutsummaryrefslogtreecommitdiff
path: root/gdb/s390-tdep.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2001-11-29 22:24:42 +0000
committerJim Blandy <jimb@codesourcery.com>2001-11-29 22:24:42 +0000
commitc8f9d51ce2e3eb695d8539d5615d0831ff906b3b (patch)
tree341cf684c7d00a33aa95ff2226760e85cb8a5af1 /gdb/s390-tdep.c
parentaf667503bbcea170ccc0c5d98894ea9edb074567 (diff)
downloadgdb-c8f9d51ce2e3eb695d8539d5615d0831ff906b3b.zip
gdb-c8f9d51ce2e3eb695d8539d5615d0831ff906b3b.tar.gz
gdb-c8f9d51ce2e3eb695d8539d5615d0831ff906b3b.tar.bz2
Tighten up GDB's support for returning structs by value.
* s390-tdep.c (s390_use_struct_convention): New function. (s390_gdbarch_init): Register it as the S/390's USE_STRUCT_CONVENTION method. Register generic_cannot_extract_struct_value_address as our EXTRACT_STRUCT_VALUE_ADDRESS method. * arch-utils.c (generic_cannot_extract_struct_value_address): New function. * arch-utils.h: Add corresponding prototype.
Diffstat (limited to 'gdb/s390-tdep.c')
-rw-r--r--gdb/s390-tdep.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 465780f..4ec129c 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1592,6 +1592,17 @@ s390_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
return sp;
}
+
+static int
+s390_use_struct_convention (int gcc_p, struct type *value_type)
+{
+ enum type_code code = TYPE_CODE (value_type);
+
+ return (code == TYPE_CODE_STRUCT
+ || code == TYPE_CODE_UNION);
+}
+
+
/* Return the GDB type object for the "standard" data type
of data in register N. */
struct type *
@@ -1735,12 +1746,14 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_cannot_fetch_register (gdbarch, s390_cannot_fetch_register);
set_gdbarch_cannot_store_register (gdbarch, s390_cannot_fetch_register);
set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
- set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention);
+ set_gdbarch_use_struct_convention (gdbarch, s390_use_struct_convention);
set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_register_name (gdbarch, s390_register_name);
set_gdbarch_stab_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
set_gdbarch_dwarf_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
+ set_gdbarch_extract_struct_value_address
+ (gdbarch, generic_cannot_extract_struct_value_address);
/* Parameters for inferior function calls. */
set_gdbarch_call_dummy_p (gdbarch, 1);
@@ -1756,7 +1769,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
- set_gdbarch_extract_struct_value_address (gdbarch, 0);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_push_return_address (gdbarch, s390_push_return_address);
set_gdbarch_sizeof_call_dummy_words (gdbarch,