ARM stack alignment on hand called functions
Kris Warkentin
kewarken@qnx.com
Wed Nov 20 10:59:00 GMT 2002
> 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
More information about the Gdb
mailing list