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]

RFC: S/390: provide frame_align function


If an architecture lacks a frame_align function, GDB assumes that it
cannot find structures returned by value from inferior calls.

2003-04-11  Jim Blandy  <jimb at redhat dot com>

	* s390-tdep.c (s390_frame_align): New function.
        (s390_gdbarch_init): Register it with the gdbarch object.

*** gdb/s390-tdep.c.~1~	Thu Mar 27 22:59:40 2003
--- gdb/s390-tdep.c	Thu Mar 27 23:21:42 2003
***************
*** 2450,2455 ****
--- 2450,2465 ----
    return sp;
  }
  
+ 
+ static CORE_ADDR
+ s390_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
+ {
+   /* Both the 32- and 64-bit ABI's say that the stack pointer should
+      always be aligned on an eight-byte boundary.  */
+   return (addr & -8);
+ }
+ 
+ 
  struct gdbarch *
  s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
  {
***************
*** 2534,2539 ****
--- 2544,2550 ----
    set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
    set_gdbarch_call_dummy_start_offset (gdbarch, 0);
    set_gdbarch_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
+   set_gdbarch_frame_align (gdbarch, s390_frame_align);
    set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
    set_gdbarch_push_arguments (gdbarch, s390_push_arguments);
    set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);


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