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: rs6000: remove some uses of DEPRECATED_REGISTER_BYTE


2004-05-20  Jim Blandy  <jimb@redhat.com>

	* rs6000-tdep.c (rs6000_push_dummy_call): Remove uses of
	DEPRECATED_REGISTER_BYTE and deprecated_registers.

Index: gdb/rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.207
diff -c -p -r1.207 rs6000-tdep.c
*** gdb/rs6000-tdep.c	20 May 2004 18:49:37 -0000	1.207
--- gdb/rs6000-tdep.c	20 May 2004 19:31:08 -0000
*************** rs6000_push_dummy_call (struct gdbarch *
*** 1305,1315 ****
--- 1305,1318 ----
    for (argno = 0, argbytes = 0; argno < nargs && ii < 8; ++ii)
      {
        int reg_size = DEPRECATED_REGISTER_RAW_SIZE (ii + 3);
+       unsigned char buf[MAX_REGISTER_SIZE];
  
        arg = args[argno];
        type = check_typedef (VALUE_TYPE (arg));
        len = TYPE_LENGTH (type);
  
+       memset (buf, 0, sizeof (buf));
+ 
        if (TYPE_CODE (type) == TYPE_CODE_FLT)
  	{
  
*************** rs6000_push_dummy_call (struct gdbarch *
*** 1321,1330 ****
  	    printf_unfiltered ("Fatal Error: a floating point parameter "
                                 "#%d with a size > 8 is found!\n", argno);
  
! 	  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE
!                                         (tdep->ppc_fp0_regnum + 1 + f_argno)],
! 		  VALUE_CONTENTS (arg),
! 		  len);
  	  ++f_argno;
  	}
  
--- 1324,1333 ----
  	    printf_unfiltered ("Fatal Error: a floating point parameter "
                                 "#%d with a size > 8 is found!\n", argno);
  
!           memcpy (buf, VALUE_CONTENTS (arg), len);
!           regcache_cooked_write (regcache,
!                                  tdep->ppc_fp0_regnum + 1 + f_argno,
!                                  buf);
  	  ++f_argno;
  	}
  
*************** rs6000_push_dummy_call (struct gdbarch *
*** 1334,1345 ****
  	  /* Argument takes more than one register.  */
  	  while (argbytes < len)
  	    {
! 	      memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0,
! 		      reg_size);
! 	      memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)],
! 		      ((char *) VALUE_CONTENTS (arg)) + argbytes,
! 		      (len - argbytes) > reg_size
! 		        ? reg_size : len - argbytes);
  	      ++ii, argbytes += reg_size;
  
  	      if (ii >= 8)
--- 1337,1346 ----
  	  /* Argument takes more than one register.  */
  	  while (argbytes < len)
  	    {
!               memcpy (buf,
!                       ((char *) VALUE_CONTENTS (arg)) + argbytes,
!                       min (len - argbytes, reg_size));
!               regcache_cooked_write (regcache, ii + 3, buf);
  	      ++ii, argbytes += reg_size;
  
  	      if (ii >= 8)
*************** rs6000_push_dummy_call (struct gdbarch *
*** 1352,1360 ****
  	{
  	  /* Argument can fit in one register.  No problem.  */
  	  int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0;
! 	  memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0, reg_size);
! 	  memcpy ((char *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)] + adj, 
! 	          VALUE_CONTENTS (arg), len);
  	}
        ++argno;
      }
--- 1353,1360 ----
  	{
  	  /* Argument can fit in one register.  No problem.  */
  	  int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0;
!           memcpy (buf + adj, VALUE_CONTENTS (arg), len);
!           regcache_cooked_write (regcache, ii + 3, buf);
  	}
        ++argno;
      }
*************** ran_out_of_registers_for_arguments:
*** 1420,1445 ****
        /* Push the rest of the arguments into stack.  */
        for (; argno < nargs; ++argno)
  	{
- 
  	  arg = args[argno];
  	  type = check_typedef (VALUE_TYPE (arg));
  	  len = TYPE_LENGTH (type);
  
- 
  	  /* Float types should be passed in fpr's, as well as in the
               stack.  */
  	  if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13)
  	    {
  
  	      if (len > 8)
  		printf_unfiltered ("Fatal Error: a floating point parameter"
                                     " #%d with a size > 8 is found!\n", argno);
  
! 	      memcpy (&(deprecated_registers
!                         [DEPRECATED_REGISTER_BYTE
!                          (tdep->ppc_fp0_regnum + 1 + f_argno)]),
! 		      VALUE_CONTENTS (arg),
! 		      len);
  	      ++f_argno;
  	    }
  
--- 1420,1444 ----
        /* Push the rest of the arguments into stack.  */
        for (; argno < nargs; ++argno)
  	{
  	  arg = args[argno];
  	  type = check_typedef (VALUE_TYPE (arg));
  	  len = TYPE_LENGTH (type);
  
  	  /* Float types should be passed in fpr's, as well as in the
               stack.  */
  	  if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13)
  	    {
+               unsigned char buf[MAX_REGISTER_SIZE];
  
  	      if (len > 8)
  		printf_unfiltered ("Fatal Error: a floating point parameter"
                                     " #%d with a size > 8 is found!\n", argno);
  
!               memset (buf, 0, sizeof (buf));
!               memcpy (buf, VALUE_CONTENTS (arg), len);
!               regcache_cooked_write (regcache,
!                                      tdep->ppc_fp0_regnum + 1 + f_argno,
!                                      buf);
  	      ++f_argno;
  	    }
  


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