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: Fri, 07 May 2004 18:35:28 -0400
   From: Andrew Cagney <cagney@gnu.org>

   > 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


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