From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis To: cagney@gnu.org Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH/RFC/RFA] Print in-memory struct return values Date: Sat, 08 May 2004 19:58:00 -0000 Message-id: <200405081958.i48Jw3dm000345@elgar.kettenis.dyndns.org> References: <200405071707.i47H7kG5071172@elgar.kettenis.dyndns.org> <409C0F30.4090409@gnu.org> X-SW-Source: 2004-05/msg00253.html Date: Fri, 07 May 2004 18:35:28 -0400 From: Andrew Cagney > The current GDB doesn't print the return value when using `finish' for > functions return structures that are not returned in registers. Note > that this is a regression from GDB 6.0 for many systems. Anyway, the > attached patch provides a way to fix this, and adds the necessary > support to the i386 target. > > If there are no comments, I'll check this in in a few days. Eli, is > the doc bit OK? Why not add another member to `enum return_value_convention' so that return_value() can directly differentate between these two cases? I called the new member RETURN_VALUE_ADDRESS_CONVENTION. I'm not really satisfied with that name, but I couldn't think of something better. The implementation is fairly simple, but I took the opportunity to re-arrange the code such that the legacy stuff is separated out, that's why the patch looks a bit more invasive. Andrew, do you have any objections? While implementing this stuff, it occured to me that the return value of gdbarch_return_value() really should be a set of bit flags instead of an enum. We should have flags that indicate: * Whether GDB should allocate some memory to store the return value. * Whether the location of the return value is known when we've just returned from a function. * Whether the location of the return value is known when we're currently executing a function. I think the ABI's I've seen thus far cover at least six of the eight posible combinations. Thoughts? I'd like to check in the attached patch regardless of what we decide. Mark