From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Schwab To: Mark Kettenis Cc: msnyder@redhat.com, cagney@gnu.org, gdb-patches@sources.redhat.com Subject: Re: [PATCH/RFC/RFA] Print in-memory struct return values Date: Sat, 15 May 2004 22:12:00 -0000 Message-id: References: <200405071707.i47H7kG5071172@elgar.kettenis.dyndns.org> <409C0F30.4090409@gnu.org> <200405081958.i48Jw3dm000345@elgar.kettenis.dyndns.org> <40A26312.7060109@redhat.com> <200405152125.i4FLPr7E000952@elgar.kettenis.dyndns.org> X-SW-Source: 2004-05/msg00451.html Mark Kettenis writes: > Anyway, to what extent are the m68k ABI's documented to return the > structure return address in %d0 and/or %a0? For the > PCC_STATIC_STRUCT_RETURN targets this is clear, but how is this for > the systems where the caller is supposed to pass the memory area. Do > you have access to the m68k SVR4 ABI? What does it say about this? >From the 68000 supplement: Functions Returning Structures or Unions As mentioned above, when a function returns a structure or union, it expects the caller to provide space for the return value and to place its address in register %a0. Having the caller supply the return object's space allows re-entrancy. A function returning a structure or union also sets %a0 to the value it finds in %a0. Thus when the caller receives control again, the address of the returned object resides in register %a0. ... Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."