Hello, This implements the "return_value" method I proposed earlier this week. It replaces USE_STRUCT_CONVENTION, EXTRACT_RETURN_VALUE, and STORE_RETURN_VALUE. The implementation is fallout from me fixing the ppc64 return code and finding that a single "reurn_value" method lead to more robust code. Several things to note: - The doco contains a number of maintainer notes. The intent is to provide something of a rationale for the current interface. That way future changes will have a reasonable base from which to work from. They are recommended reading. - I've modified the "return small_struct" code so that, when an architecture doesn't implement return_value an internal_error and not an error is reported. With the introduction of return_value, it is possible to handle the "return small_struct" case so failing to do this is an a bug in GDB. Comments. For reference, an implementation of the method looks like: > static enum return_value_convention > ppc64_sysv_abi_return_value (struct type *valtype, struct regcache *regcache, > const void *inval, void *outval) > { > struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); > /* Floats and doubles in F1. */ > if (TYPE_CODE (valtype) == TYPE_CODE_FLT > && TYPE_LENGTH (valtype) <= 8) > { > char regval[MAX_REGISTER_SIZE]; > struct type *regtype = register_type (current_gdbarch, FP0_REGNUM); > if (inval != NULL) > { > convert_typed_floating (inval, valtype, regval, regtype); > regcache_cooked_write (regcache, FP0_REGNUM + 1, regval); > } > if (outval != NULL) > { > regcache_cooked_read (regcache, FP0_REGNUM + 1, regval); > convert_typed_floating (regval, regtype, outval, valtype); > } > return RETURN_VALUE_REGISTER_CONVENTION; > } > if (TYPE_CODE (valtype) == TYPE_CODE_INT > && TYPE_LENGTH (valtype) <= 8) > { > /* Integers in r3. */ > if (inval != NULL) > { > /* Be careful to sign extend the value. */ > regcache_cooked_write_unsigned (regcache, tdep->ppc_gp0_regnum + 3, > unpack_long (valtype, inval)); > } > if (outval != NULL) > { > /* Extract the integer from r3. Since this is truncating the > value, there isn't a sign extension problem. */ > ULONGEST regval; > regcache_cooked_read_unsigned (regcache, tdep->ppc_gp0_regnum + 3, > ®val); > store_unsigned_integer (outval, TYPE_LENGTH (valtype), regval); > } > return RETURN_VALUE_REGISTER_CONVENTION; > } Otherwize, I'll commit early next week. Andrew