This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Add frame_align to d10v.


Aligns the stack frame out to the size of an instruction (so that instructions can be safely pushed onto the stack).

committed,
Andrew
2003-05-01  Andrew Cagney  <cagney@redhat.com>

	* d10v-tdep.c (d10v_frame_align): Replace d10v_stack_align.
	(d10v_gdbarch_init): Set frame_align instead of stack_align.

Index: d10v-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/d10v-tdep.c,v
retrieving revision 1.110
diff -u -r1.110 d10v-tdep.c
--- d10v-tdep.c	30 Apr 2003 22:01:37 -0000	1.110
+++ d10v-tdep.c	1 May 2003 15:36:38 -0000
@@ -107,9 +107,11 @@
 static void d10v_eva_get_trace_data (void);
 
 static CORE_ADDR
-d10v_stack_align (CORE_ADDR len)
+d10v_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
 {
-  return (len + 1) & ~1;
+  /* Align to the size of an instruction (so that they can safely be
+     pushed onto the stack.  */
+  return sp & ~3;
 }
 
 /* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
@@ -1636,7 +1638,7 @@
   set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);
 
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
-  set_gdbarch_stack_align (gdbarch, d10v_stack_align);
+  set_gdbarch_frame_align (gdbarch, d10v_frame_align);
 
   set_gdbarch_register_sim_regno (gdbarch, d10v_register_sim_regno);
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]