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: <Richard dot Earnshaw at arm dot com>
- Cc: <Richard dot Earnshaw at arm dot com>, <gdb at sources dot redhat dot com>
- Date: Wed, 20 Nov 2002 13:58:59 -0500
- Subject: Re: ARM stack alignment on hand called functions
- References: <200211201837.gAKIbXv25319@pc960.cambridge.arm.com>
> 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