This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[m68k] align stack
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Andreas Schwab <schwab at suse dot de>
- Date: Fri, 09 Jun 2006 13:18:08 +0100
- Subject: [m68k] align stack
Following Andreas's suggestion, this patch aligns the stack using the gdb
provided interface. I'll break appart my return value patch for easier review.
ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2006-06-09 Nathan Sidwell <nathan@codesourcery.com>
gdb/
* m68k-tdep.c (m68k_frame_align): New.
(m68k_gdbarch_init): Set frame_align here.
Index: gdb/m68k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68k-tdep.c,v
retrieving revision 1.105.2.6
diff -c -3 -p -r1.105.2.6 m68k-tdep.c
*** gdb/m68k-tdep.c 8 Jun 2006 07:23:04 -0000 1.105.2.6
--- gdb/m68k-tdep.c 9 Jun 2006 12:10:15 -0000
*************** m68k_svr4_return_value (struct gdbarch *
*** 485,490 ****
--- 485,500 ----
}
+ /* Always align the frame to a 4-byte boundary. This is required on
+ some platforms and harmless on the rest. */
+
+ static CORE_ADDR
+ m68k_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
+ {
+ /* Align the stack to four bytes. */
+ return sp & ~3;
+ }
+
static CORE_ADDR
m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
*************** m68k_gdbarch_init (struct gdbarch_info i
*** 1249,1254 ****
--- 1256,1262 ----
/* Stack grows down. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+ set_gdbarch_frame_align (gdbarch, m68k_frame_align);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_decr_pc_after_break (gdbarch, 2);