[RFC]: SH push_arguments tweak

Michael Snyder msnyder@redhat.com
Mon Dec 18 15:44:00 GMT 2000


Elena, this change produces a bunch of new passes in callfuncs and
elsewhere, but also a couple of new fails in call-ar-st.exp.  You 
might need to stare at it and knock it around a bit.
2000-12-18  Michael Snyder  <msnyder@mvstp600e.cygnus.com>

	* sh-tdep.c (sh_push_arguments): Struct args go on stack AND
	  in register.

Index: sh-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/sh-tdep.c,v
retrieving revision 2.71
diff -c -3 -p -r2.71 sh-tdep.c
*** sh-tdep.c	2000/12/18 05:32:59	2.71
--- sh-tdep.c	2000/12/18 23:29:19
*************** sh_push_arguments (int nargs, struct val
*** 1157,1167 ****
  	odd_sized_struct = 0;
        while (len > 0)
  	{
! 	  if (argreg > ARGLAST_REGNUM || odd_sized_struct)
! 	    {			/* must go on the stack */
  	      write_memory (sp + stack_offset, val, 4);
  	      stack_offset += 4;
  	    }
  	  /* NOTE WELL!!!!!  This is not an "else if" clause!!!
  	     That's because some *&^%$ things get passed on the stack
  	     AND in the registers!   */
--- 1157,1172 ----
  	odd_sized_struct = 0;
        while (len > 0)
  	{
! 	  int type_code = TYPE_CODE (VALUE_TYPE (args[argnum]));
! 
! 	  if (type_code == TYPE_CODE_STRUCT ||
! 	      type_code == TYPE_CODE_UNION  ||
! 	      argreg > ARGLAST_REGNUM)
! 	    {
  	      write_memory (sp + stack_offset, val, 4);
  	      stack_offset += 4;
  	    }
+ 
  	  /* NOTE WELL!!!!!  This is not an "else if" clause!!!
  	     That's because some *&^%$ things get passed on the stack
  	     AND in the registers!   */


More information about the Gdb-patches mailing list