This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa?] Add frame_align(); Was: ARM stack alignment on hand called functions
- From: Andreas Schwab <schwab at suse dot de>
- To: Richard dot Earnshaw at arm dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 28 Nov 2002 11:20:17 +0100
- Subject: Re: [rfa?] Add frame_align(); Was: ARM stack alignment on hand called functions
- References: <200211280926.gAS9QJE06150@pc960.cambridge.arm.com>
Richard Earnshaw <rearnsha@arm.com> writes:
|> > +/* Ensure that the ARM's stack pointer has the correct alignment for a
|> > + new frame. */
|> > +static CORE_ADDR
|> > +arm_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
|> > +{
|> > + return (addr & -16);
|> > +}
|>
|> Yuck, two's complement assumption.
No, -16 is implicitly cast to bfd_vma, which is unsigned, and this
operation is completely defined independent of the representation of
signed integers.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."