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


> OK, but with this change the alignment is being done *after* any arguments
> that have to go onto the stack have been pushed.  It should happen
> *before*.  What happens if you have?
>
> struct f { char a; char b; char c;};
>
> struct f g = {1,2,3};
>
> struct f h (int a, int b, int c, int d, int e)
> {
>   g.c = e;
>   return g;
> }
>
> and then call h from within the debugger.  Is g.c set correctly?
>
> My guess is that it won't, because the integer value for e will have been
> pushed onto the stack incorrectly.
>

Looks like you might be right:  When I 'call h(1,2,3,4,5)', I get:

Breakpoint 2, h (a=1, b=2, c=3, d=1280, e=-31946752) at armstack.c:8

Hmm.... Looks like some further investigation is needed.

Kris


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