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]

[RFA] push_args tweak for mips/o32


This fixes 8 testsuite failures in callfuncs.  

The argument passed in is a negative integer.  So partial-len is 4, 
but since we may be running on an 8-byte machine, MIPS_REGSIZE may
actually be 8.  In which case, the 4-byte negative integer value 
will need to be sign extended before being assigned to a register.
2002-08-12  Michael Snyder  <msnyder@redhat.com>

	* mips-tdep.c (mips_push_arguments): Use extract_signed_integer
	to get the value to be placed in an integer arg register.
	Need sign extension, because MIPS_SAVED_REGSIZE may be 4
	while MIPS_REGSIZE is 8.

Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.99
diff -p -r1.99 mips-tdep.c
*** mips-tdep.c	10 Aug 2002 01:09:10 -0000	1.99
--- mips-tdep.c	13 Aug 2002 01:53:06 -0000
*************** mips_push_arguments (int nargs,
*** 2707,2713 ****
  	      if (argreg <= MIPS_LAST_ARG_REGNUM
  		  && !fp_register_arg_p (typecode, arg_type))
  		{
! 		  LONGEST regval = extract_unsigned_integer (val, partial_len);
  
  		  /* A non-floating-point argument being passed in a
  		     general register.  If a struct or union, and if
--- 2707,2715 ----
  	      if (argreg <= MIPS_LAST_ARG_REGNUM
  		  && !fp_register_arg_p (typecode, arg_type))
  		{
! 		  LONGEST regval = extract_signed_integer (val, partial_len);
! 		  /* Value may need to be sign extended, because 
! 		     MIPS_REGSIZE != MIPS_SAVED_REGSIZE.  */
  
  		  /* A non-floating-point argument being passed in a
  		     general register.  If a struct or union, and if

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