This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/RFC/RFA] Print in-memory struct return values


   Date: Sat, 08 May 2004 17:12:21 -0400
   From: Andrew Cagney <cagney@gnu.org>

> Ouch. That's really ugly. I thought RETURN_VALUE_STRUCT_CONVENTION
> was already long enough. I'd really like to avoid thos really long
> names. Hmm what if I use:
> > RETURN_VALUE_ABI_RETURNS_ADDRESS
> RETURN_VALUE_ABI_PRESERVES_ADDRESS


yes.

So I checked in the attached.  The patches also corners
RETURN_VALUE_ABI_PRESERVES_ADDRESS, but doesn't implement it yet.
I'll do that when I touch SPARC again.

The patch induces some PASS->KFAIL changes in the testsuite.  This is
actually a problem with the testsuite.  The tests in question assume
that if "finish" prints a return value, "return" should work.
RETURN_VALUE_ABI_RETURNS_ADDRESS makes this assumption invalid.  We
should probably just remove those tests, but perhaps we can do
something smarter.

How come it doesn't work?


Popping the caller's frame should (assuming the unwind info is correct) restore the struct-return address register to the value that the callee expects. return_value can then use that register value to find the location at which to store the struct?

That cross check is there because, in the past, people decided getting all these edge cases right was too hard and ignored them. If the previous paragraph doesn't hold, something smarter is needed.

Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]