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]

[obvious] frame_align for sh (fixes struct_return)


On the principle that gdbarch-ifications are obvious...
This makes everything pass in structs.exp, for all sh variants.


2003-08-01  Michael Snyder  <msnyder@redhat.com>

	* sh-tdep.c (sh_frame_align): New gdbarch method.
	(sh_gdbarch_init): Set up frame_align method.

Index: sh-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh-tdep.c,v
retrieving revision 1.134
diff -p -r1.134 sh-tdep.c
*** sh-tdep.c	16 Jul 2003 09:45:56 -0000	1.134
--- sh-tdep.c	1 Aug 2003 19:52:06 -0000
*************** sh64_pop_frame (void)
*** 2028,2033 ****
--- 2028,2039 ----
    flush_cached_frames ();
  }
  
+ static CORE_ADDR
+ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
+ {
+   return sp & ~3;
+ }
+ 
  /* Function: push_arguments
     Setup the function arguments for calling a function in the inferior.
  
*************** sh_push_dummy_call (struct gdbarch *gdba
*** 2090,2096 ****
    struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); 
  
    /* first force sp to a 4-byte alignment */
!   sp = sp & ~3;
  
    /* The "struct return pointer" pseudo-argument has its own dedicated 
       register */
--- 2096,2102 ----
    struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); 
  
    /* first force sp to a 4-byte alignment */
!   sp = sh_frame_align (gdbarch, sp);
  
    /* The "struct return pointer" pseudo-argument has its own dedicated 
       register */
*************** sh_gdbarch_init (struct gdbarch_info inf
*** 4356,4361 ****
--- 4362,4368 ----
    set_gdbarch_deprecated_pop_frame (gdbarch, sh_pop_frame);
    set_gdbarch_deprecated_frame_saved_pc (gdbarch, sh_frame_saved_pc);
    set_gdbarch_deprecated_saved_pc_after_call (gdbarch, sh_saved_pc_after_call);
+   set_gdbarch_frame_align (gdbarch, sh_frame_align);
  
    switch (info.bfd_arch_info->mach)
      {

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