This is the mail archive of the gdb-patches@sourceware.org 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] Pushing Inferior Function Arguments onto Stack on PowerPC64 machines


> Date: Wed, 4 Oct 2006 15:10:56 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> On Wed, Oct 04, 2006 at 03:00:34PM -0400, janani@linux.ibm.com wrote:
> > I am new to this, so my interpretation might not be completely  
> > accurate, but the way I read the note below ( a snippet from the GNU  
> > GCC Manual about passing function arguments in registers) is that  
> > since PPC64 is big endian, even though the default is to pad downward  
> > (i.e. right align), if the size if greater than the size of an int,  
> > you need to pad upward (left align).

Blindly trusting spftware documentation is a bit... erh, naive ;-).

> You're trying to answer the wrong question :-)
> 
> It's not "what does GCC do", but "what does the platform ABI say we
> should do".  Is GCC conforming to the ABI?  Is the ABI wrong, or out of
> date, or was Andrew's reading of it wrong, or...
> 
> There could be a real problem here, so it's important that we
> understand what is _supposed_ to happen before we make a change.
> If GCC is violating the ABI, then either GCC or the ABI may need to be
> updated.  If GDB is misinterpreting the ABI, then just GDB needs to be
> changed.

Indeed.  GCC has been getting things wrong in this area before.  And
on top of that, some versions of GCC get it right while other versions
get it wrong.  If there are indeed versions of GCC in widespread use
that do not follow the ABI, we should probably try to add a workaround
in GCC.  But if there are also versions of GCC that do follow the ABI,
adding such a workaround might be impossible.

Mark


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