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]

PATCH: S/390: recognize arg reg spills using `stm'



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

	* s390-tdep.c (s390_get_frame_info): Recognize argument register
	spills that use the `stm' instruction.
	(is_arg_reg): New function.

Index: gdb/s390-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/s390-tdep.c,v
retrieving revision 2.27
diff -c -r2.27 s390-tdep.c
*** gdb/s390-tdep.c	2001/12/05 00:21:10	2.27
--- gdb/s390-tdep.c	2001/12/05 22:11:38
***************
*** 180,185 ****
--- 180,193 ----
  }
  
  
+ /* Return true if REGIDX is the number of a register used to pass
+      arguments, false otherwise.  */
+ static int
+ is_arg_reg (int regidx)
+ {
+   return 2 <= regidx && regidx <= 6;
+ }
+ 
  
  /* s390_get_frame_info based on Hartmuts
     prologue definition in
***************
*** 405,411 ****
  	  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
--- 413,419 ----
  	  continue;
  	}
  
!       /* Check for an fp-relative STG, ST, or STM.  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
***************
*** 414,422 ****
            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;
--- 422,435 ----
            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 */
!                && is_arg_reg ((instr[1] >> 4) & 0xf)
!                && ((instr[2] >> 4) & 0xf) == frame_pointer_regidx)
!               || (instr[0] == 0x90 /* stm %rA, %rB, D(%rC) */
!                   && is_arg_reg ((instr[1] >> 4) & 0xf)
!                   && is_arg_reg (instr[1] & 0xf)
!                   && ((instr[2] >> 4) & 0xf) == frame_pointer_regidx)))
          {
            valid_prologue = 1;
            continue;


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