This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: ARM stack alignment on hand called functions
- From: "Kris Warkentin" <kewarken at qnx dot com>
- To: <gdb at sources dot redhat dot com>
- Date: Wed, 27 Nov 2002 16:13:33 -0500
- Subject: Re: ARM stack alignment on hand called functions
- References: <200211272021.PAA04606@hub.ott.qnx.com>
> Forwarded From: Richard Earnshaw <rearnsha@arm.com>
> > > Can I suggest downloading a current GDB snap and find out if the
problem
> > > is still present (and if it isn't, follow through with a patch)?
> > > Otherwize this will slip through the cracks, only to re-bite you (and
> > > others) later :-(
> > >
> > > Andrew
> > >
> > >
> >
> > I can see no evidence that the current code is correct either, so
perhaps
> > we should file a PR with all this info.
> >
> > R.
Sorry about the late reply...I had missed this in purging my email. I used
the arm_push_arguments() : arm-tdep.c from your head branch in isolation and
observed the same problem. When I forced an sp alignment at the top of
arm_push_arguments(), it worked fine. Now I wonder, however, if " sp =
(sp - 3) & ~3 " is too simplistic of a fix? Can we assume that arm will
always have 4 byte alignment? 2) Can we assume that arm stacks will always
grow downward? I'm thinking yes to the direction but no to the alignment so
perhaps we should do a
#define STACK_ALIGN_SIZE 4
in tm-arm.h and then do:
sp = (sp - STACK_ALIGN_SIZE + 1) & ~(STACK_ALIGN_SIZE - 1);
????
Kris