Re: [RFA] New GDB target iq2000

Daniel Jacobowitz
2005-03-01T22:19:43Z

On Tue, Mar 01, 2005 at 05:11:31PM -0500, Jim Blandy wrote:
> +static enum return_value_convention
> +iq2000_return_value (struct gdbarch *gdbarch, struct type *type,
> + struct regcache *regcache,
> + void *readbuf, const void *writebuf)
> +{
> + if (iq2000_use_struct_convention (type))
> + return RETURN_VALUE_STRUCT_CONVENTION;
> + if (writebuf)
> + iq2000_store_return_value (type, regcache, writebuf);
> + else if (readbuf)
> + iq2000_extract_return_value (type, regcache, readbuf);
> + return RETURN_VALUE_REGISTER_CONVENTION;
> +}
>
> The other return_value implementations I've seen allow one to pass
> both a readbuf and a writebuf, and do the read before the write. I
> can't find any place where it's actually used this way, but it seems
> to be allowed by the interface. In any case, it's easy enough to make
> iq2000_return_value behave like the others.

I'd rather leave it this way, and find somewhere to document that you
mustn't pass both. It doesn't make much sense to have them both...