diff options
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/sparc-tdep.c | 8 | ||||
-rw-r--r-- | gdb/sparc64-tdep.c | 8 |
3 files changed, 23 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7e7ceb3..3162717 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2010-10-01 Joel Brobecker <brobecker@adacore.com> + + * sparc-tdep.c (sparc32_frame_align): New function. + (sparc32_gdbarch_init): Set the frame_align gdbarch method. + * sparc64-tdep.c (sparc64_frame_align): New function. + (sparc64_gdbarch_init): Set the frame_align gdbarch method. + 2010-09-30 H.J. Lu <hongjiu.lu@intel.com> * defs.h (MAX_REGISTER_SIZE): Set to 64. diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 29a12cf..fd70783 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -399,6 +399,13 @@ sparc32_pseudo_register_write (struct gdbarch *gdbarch, static CORE_ADDR +sparc32_frame_align (struct gdbarch *gdbarch, CORE_ADDR address) +{ + /* The ABI requires double-word alignment. */ + return address & ~0x7; +} + +static CORE_ADDR sparc32_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funcaddr, struct value **args, int nargs, @@ -1407,6 +1414,7 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fp0_regnum (gdbarch, SPARC_F0_REGNUM); /* %f0 */ /* Call dummy code. */ + set_gdbarch_frame_align (gdbarch, sparc32_frame_align); set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_push_dummy_code (gdbarch, sparc32_push_dummy_code); set_gdbarch_push_dummy_call (gdbarch, sparc32_push_dummy_call); diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index 3cd6109..ca89b8c 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -938,6 +938,13 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, } static CORE_ADDR +sparc64_frame_align (struct gdbarch *gdbarch, CORE_ADDR address) +{ + /* The ABI requires 16-byte alignment. */ + return address & ~0xf; +} + +static CORE_ADDR sparc64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, @@ -1136,6 +1143,7 @@ sparc64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_pc_regnum (gdbarch, SPARC64_PC_REGNUM); /* %pc */ /* Call dummy code. */ + set_gdbarch_frame_align (gdbarch, sparc64_frame_align); set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_push_dummy_code (gdbarch, NULL); set_gdbarch_push_dummy_call (gdbarch, sparc64_push_dummy_call); |