This is the mail archive of the gdb@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: ARM stack alignment on hand called functions


> 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


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