PATCH: S/390: recognize arg reg spills in prologues

Jim Blandy jimb@zwingli.cygnus.com
Tue Dec 4 16:21:00 GMT 2001


2001-12-04  Jim Blandy  <jimb@redhat.com>

	* s390-tdep.c (s390_get_frame_info): Recognize spills of reg
	arguments into their stack slots.

Index: gdb/s390-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/s390-tdep.c,v
retrieving revision 2.26
diff -c -r2.26 s390-tdep.c
*** gdb/s390-tdep.c	2001/12/05 00:08:23	2.26
--- gdb/s390-tdep.c	2001/12/05 00:19:12
***************
*** 405,410 ****
--- 405,427 ----
  	  continue;
  	}
  
+       /* Check for an fp-relative STG or ST.  This is probably
+           spilling an argument from a register out into a stack slot.
+           This could be a user instruction, but if we haven't included
+           any other suspicious instructions in the prologue, this
+           could only be an initializing store, which isn't too bad to
+           skip.  The consequences of not including arg-to-stack spills
+           are more serious, though --- you don't see the proper values
+           of the arguments.  */
+       if ((save_link_state == 3 || save_link_state == 4)
+           && instr[0] == 0x50      /* st %rA, D(%rX,%rB) */
+           && (instr[1] & 0xf) == 0 /* %rX is zero, no index reg */
+           && ((instr[2] >> 4) & 0xf) == frame_pointer_regidx)
+         {
+           valid_prologue = 1;
+           continue;
+         }
+ 
        /* check for STD */
        if (instr[0] == 0x60 && (instr[2] >> 4) == 0xf)
  	{



More information about the Gdb-patches mailing list