From 97092415597fbfb41f2c028e95b895966d52996f Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 13 Jun 2004 13:42:33 +0000 Subject: Index: ChangeLog 2004-06-13 Andrew Cagney * gdbarch.sh (RETURN_VALUE_ON_STACK): Delete method. * gdbarch.h, gdbarch.c: Re-generate. * m68hc11-tdep.c (m68hc11_return_value_on_stack): Delete function. (m68hc11_use_struct_convention): Delete function. (m68hc11_extract_struct_value_address): Delete function. (m68hc11_return_value): New function. (m68hc11_gdbarch_init): Instead of store_return_value, extract_return_value, return_value_on_stack, deprecated_extract_struct_value_address and use_struct_convention, set return_value. * values.c (using_struct_return): Do not call RETURN_VALUE_ON_STACK. * arch-utils.h (generic_return_value_on_stack_not): Delete declaration. * arch-utils.c (generic_return_value_on_stack_not): Delete function. Index: doc/ChangeLog 2004-06-13 Andrew Cagney * gdbint.texinfo (Target Architecture Definition): Delete description of RETURN_VALUE_ON_STACK. --- gdb/m68hc11-tdep.c | 48 ++++++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 30 deletions(-) (limited to 'gdb/m68hc11-tdep.c') diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 80480a6611..43fce35787 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1332,31 +1332,24 @@ m68hc11_extract_return_value (struct type *type, struct regcache *regcache, } } -/* Should call_function allocate stack space for a struct return? */ -static int -m68hc11_use_struct_convention (int gcc_p, struct type *type) -{ - return (TYPE_CODE (type) == TYPE_CODE_STRUCT - || TYPE_CODE (type) == TYPE_CODE_UNION - || TYPE_LENGTH (type) > 4); -} - -static int -m68hc11_return_value_on_stack (struct type *type) +enum return_value_convention +m68hc11_return_value (struct gdbarch *gdbarch, struct type *valtype, + struct regcache *regcache, void *readbuf, + const void *writebuf) { - return TYPE_LENGTH (type) > 4; -} - -/* Extract from an array REGBUF containing the (raw) register state - the address in which a function should return its structure value, - as a CORE_ADDR (or an expression that can be used as one). */ -static CORE_ADDR -m68hc11_extract_struct_value_address (struct regcache *regcache) -{ - char buf[M68HC11_REG_SIZE]; - - regcache_cooked_read (regcache, HARD_D_REGNUM, buf); - return extract_unsigned_integer (buf, M68HC11_REG_SIZE); + if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT + || TYPE_CODE (valtype) == TYPE_CODE_UNION + || TYPE_CODE (valtype) == TYPE_CODE_ARRAY + || TYPE_LENGTH (valtype) > 4) + return RETURN_VALUE_STRUCT_CONVENTION; + else + { + if (readbuf != NULL) + m68hc11_extract_return_value (valtype, regcache, readbuf); + if (writebuf != NULL) + m68hc11_store_return_value (valtype, regcache, writebuf); + return RETURN_VALUE_REGISTER_CONVENTION; + } } /* Test whether the ELF symbol corresponds to a function using rtc or @@ -1539,12 +1532,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_push_dummy_call (gdbarch, m68hc11_push_dummy_call); - set_gdbarch_extract_return_value (gdbarch, m68hc11_extract_return_value); - set_gdbarch_return_value_on_stack (gdbarch, m68hc11_return_value_on_stack); - - set_gdbarch_store_return_value (gdbarch, m68hc11_store_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address); - set_gdbarch_use_struct_convention (gdbarch, m68hc11_use_struct_convention); + set_gdbarch_return_value (gdbarch, m68hc11_return_value); set_gdbarch_skip_prologue (gdbarch, m68hc11_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_breakpoint_from_pc (gdbarch, m68hc11_breakpoint_from_pc); -- cgit v1.2.1