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: RFA: tolerate unavailable struct return values


On Fri, Nov 30, 2001 at 03:49:52PM -0500, Jim Blandy wrote:
> 
> Daniel Jacobowitz <drow@mvista.com> writes:
> > On Thu, Nov 29, 2001 at 05:09:13PM -0500, Jim Blandy wrote:
> > > 
> > > On some architectures, it's impossible for GDB to find structs
> > > returned by value.  These shouldn't be failures.  Should they be
> > > passes?
> > 
> > Out of curiousity, which architectures?  And to be pedantic, I suspect
> > that it might be "not always possible" rather than actually
> > impossible.
> 
> The one I have in mind is the S/390, although I'm pretty sure there
> are others.  I've included the bug report I sent to the S/390 GCC
> maintainers below.
> 
> One approach would be to hope that the return buffer's address was
> still there in the register it was passed in.  But there's no way to
> tell when you're wrong.  GDB will just print garbage, and the user
> will think their program is wrong.  Better to simply say, "I can't
> find this information reliably", and let the user, who knows their
> program, find another way to get the info --- setting a breakpoint on
> the return statement, or looking at where the caller put the
> structure.

Hmmmm.  I wonder if MIPS could ever be affected by this?  I don't think
the MIPS ABI specifies that $a0 remains live.  It looks as if the value
of $a0 is always returned in $v0 in such functions, though.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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