[rfa?] Add frame_align(); Was: ARM stack alignment on hand called functions

Andrew Cagney ac131313@redhat.com
Thu Nov 28 07:19:00 GMT 2002


>> +/* 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.  I much prefer ~0xf in this case.
> 
> But why so much.  The maximum stack alignment you'll see on an ARM is 8 
> bytes.

The function was lifted from the PPC code.  And, hey, what's a few extra 
bytes between friends? :-)

Does (addr & 0x7) look better?

Andrew




More information about the Gdb-patches mailing list