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]

Re: [PATCH] Partial de-depricatification of sh64-tdep.c


Elena Zannoni wrote:
Michael Snyder writes:
 > This patch gets rid of at least three deprecated functions or macros.
 > I've tested it as well as I can, given that the current sh64 sim
 > doesn't build.  This compiles without warnings, and it tests out OK
 > on an older branch that I have in which the sim does build.

please split the indent/formatting changes into a separate patch.
It's hard to review this.

Sorry, you're right. Here's the part that isn't comment/whitespace. I also added a couple lines of ChangeLog that I missed the first time.



2003-11-12  Michael Snyder  <msnyder@redhat.com>

	* sh64-tdep.c: 
	(sh_sh64_register_raw_size): Delete.
	(sh_sh64_register_virtual_size): Delete.
	(sh64_extract_return_value): Replace deprecated_store_floating
	with store_typed_floating.
	(sh_sh64_register_convert_to_raw): Replace 
	deprecated_store_floating with store_typed_floating.
	(sh_sh64_register_virtual_type): Convert to sh64_register_type.
	(sh64_frame_chain, sh64_get_saved_pr, sh64_get_saved_register,
	sh64_nofp_frame_init_saved_regs, sh64_push_arguments,
	sh64_extract_struct_value_address, sh64_pop_frame, 
	sh64_extract_return_value, sh64_store_return_value,
	sh_sh64_register_convert_to_virtual, sh64_pseudo_register_read, 
	sh_sh64_register_convert_to_raw, sh_pseudo_register_write):
	Replace DEPRECATED_REGISTER_RAW_SIZE with register_size.
	Replace DEPRECATED_REGISTER_VIRTUAL_TYPE with register_type.
	(sh64_gdbarch_init): Don't set deprecated_register_bytes,
	deprecated_register_virtual_type, deprecated_register_raw_size,
	deprecated_max_register_raw_size, or 
	deprecated_max_register_virtual_size.  Instead, just set
	gdbarch_register_type.

Index: sh64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh64-tdep.c,v
retrieving revision 1.12
diff -p -r1.12 sh64-tdep.c
*** sh64-tdep.c	11 Nov 2003 20:04:52 -0000	1.12
--- sh64-tdep.c	12 Nov 2003 21:52:20 -0000
*************** sh64_frame_chain (struct frame_info *fra
*** 749,755 ****
        if (gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
  	size = 4;
        else
! 	size = DEPRECATED_REGISTER_RAW_SIZE (translate_insn_rn (DEPRECATED_FP_REGNUM, media_mode));
        return read_memory_integer (get_frame_base (frame)
  				  + get_frame_extra_info (frame)->f_offset,
  				  size);
--- 749,757 ----
        if (gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
  	size = 4;
        else
! 	size = register_size (current_gdbarch, 
! 			      translate_insn_rn (DEPRECATED_FP_REGNUM, 
! 						 media_mode));
        return read_memory_integer (get_frame_base (frame)
  				  + get_frame_extra_info (frame)->f_offset,
  				  size);
*************** sh64_get_saved_pr (struct frame_info *fi
*** 783,796 ****
  	    int gdb_reg_num = translate_insn_rn (pr_regnum, media_mode);
  	    int size = ((gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
  			? 4
! 			: DEPRECATED_REGISTER_RAW_SIZE (gdb_reg_num));
  	    return read_memory_integer (deprecated_get_frame_saved_regs (fi)[pr_regnum], size);
  	  }
        }
    return read_register (pr_regnum);
  }
  
! /* For vectors of 4 floating point registers. */
  static int
  fv_reg_base_num (int fv_regnum)
  {
--- 786,799 ----
  	    int gdb_reg_num = translate_insn_rn (pr_regnum, media_mode);
  	    int size = ((gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
  			? 4
! 			: register_size (current_gdbarch, gdb_reg_num));
  	    return read_memory_integer (deprecated_get_frame_saved_regs (fi)[pr_regnum], size);
  	  }
        }
    return read_register (pr_regnum);
  }
  
! /* For vectors of 4 floating point registers.  */
  static int
  fv_reg_base_num (int fv_regnum)
  {
*************** sh64_get_saved_register (char *raw_buffe
*** 1289,1295 ****
  	    memcpy (raw_buffer,
  		    (deprecated_generic_find_dummy_frame (get_frame_pc (frame), get_frame_base (frame))
  		     + DEPRECATED_REGISTER_BYTE (regnum)),
! 		    DEPRECATED_REGISTER_RAW_SIZE (regnum));
  	  return;
  	}
  
--- 1294,1300 ----
  	    memcpy (raw_buffer,
  		    (deprecated_generic_find_dummy_frame (get_frame_pc (frame), get_frame_base (frame))
  		     + DEPRECATED_REGISTER_BYTE (regnum)),
! 		    register_size (current_gdbarch, regnum));
  	  return;
  	}
  
*************** sh64_get_saved_register (char *raw_buffe
*** 1302,1308 ****
  	  if (regnum == SP_REGNUM)
  	    {
  	      if (raw_buffer)	/* SP register treated specially */
! 		store_unsigned_integer (raw_buffer, DEPRECATED_REGISTER_RAW_SIZE (regnum),
  					deprecated_get_frame_saved_regs (frame)[regnum]);
  	    }
  	  else
--- 1307,1315 ----
  	  if (regnum == SP_REGNUM)
  	    {
  	      if (raw_buffer)	/* SP register treated specially */
! 		store_unsigned_integer (raw_buffer, 
! 					register_size (current_gdbarch, 
! 						       regnum),
  					deprecated_get_frame_saved_regs (frame)[regnum]);
  	    }
  	  else
*************** sh64_get_saved_register (char *raw_buffe
*** 1318,1330 ****
  			  || live_regnum == PR_REGNUM))
  		    size = 4;
  		  else
! 		    size = DEPRECATED_REGISTER_RAW_SIZE (live_regnum);
  		  if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
  		    read_memory (deprecated_get_frame_saved_regs (frame)[regnum], raw_buffer, size);
  		  else
  		    read_memory (deprecated_get_frame_saved_regs (frame)[regnum],
  				 raw_buffer
! 				 + DEPRECATED_REGISTER_RAW_SIZE (live_regnum)
  				 - size,
  				 size);
  		}
--- 1325,1337 ----
  			  || live_regnum == PR_REGNUM))
  		    size = 4;
  		  else
! 		    size = register_size (current_gdbarch, live_regnum);
  		  if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
  		    read_memory (deprecated_get_frame_saved_regs (frame)[regnum], raw_buffer, size);
  		  else
  		    read_memory (deprecated_get_frame_saved_regs (frame)[regnum],
  				 raw_buffer
! 				 + register_size (current_gdbarch, live_regnum)
  				 - size,
  				 size);
  		}
*************** static CORE_ADDR
*** 1348,1354 ****
  sh64_extract_struct_value_address (char *regbuf)
  {
    return (extract_unsigned_integer ((regbuf + DEPRECATED_REGISTER_BYTE (STRUCT_RETURN_REGNUM)), 
! 				    DEPRECATED_REGISTER_RAW_SIZE (STRUCT_RETURN_REGNUM)));
  }
  
  static CORE_ADDR
--- 1355,1362 ----
  sh64_extract_struct_value_address (char *regbuf)
  {
    return (extract_unsigned_integer ((regbuf + DEPRECATED_REGISTER_BYTE (STRUCT_RETURN_REGNUM)), 
! 				    register_size (current_gdbarch, 
! 						   STRUCT_RETURN_REGNUM)));
  }
  
  static CORE_ADDR
*************** sh64_pop_frame (void)
*** 1388,1395 ****
  		    || regnum ==  PR_REGNUM))
  	      size = 4;
  	    else
! 	      size = DEPRECATED_REGISTER_RAW_SIZE (translate_insn_rn (regnum,
! 							   media_mode));
  	    write_register (regnum,
  			    read_memory_integer (deprecated_get_frame_saved_regs (frame)[regnum],
  						 size));
--- 1396,1403 ----
  		    || regnum ==  PR_REGNUM))
  	      size = 4;
  	    else
! 	      size = register_size (current_gdbarch, 
! 				    translate_insn_rn (regnum, media_mode));
  	    write_register (regnum,
  			    read_memory_integer (deprecated_get_frame_saved_regs (frame)[regnum],
  						 size));
*************** sh64_push_arguments (int nargs, struct v
*** 1522,1528 ****
        
        if (TYPE_CODE (type) != TYPE_CODE_FLT)
  	{
! 	  argreg_size = DEPRECATED_REGISTER_RAW_SIZE (int_argreg);
  
  	  if (len < argreg_size)
  	    {
--- 1530,1536 ----
        
        if (TYPE_CODE (type) != TYPE_CODE_FLT)
  	{
! 	  argreg_size = register_size (current_gdbarch, int_argreg);
  
  	  if (len < argreg_size)
  	    {
*************** sh64_extract_return_value (struct type *
*** 1686,1692 ****
  	  else
  	    floatformat_to_doublest (&floatformat_ieee_double_big,
  				     (char *) regbuf + offset, &val);
! 	  deprecated_store_floating (valbuf, len, val);
  	}
      }
    else
--- 1694,1700 ----
  	  else
  	    floatformat_to_doublest (&floatformat_ieee_double_big,
  				     (char *) regbuf + offset, &val);
! 	  store_typed_floating (valbuf, type, val);
  	}
      }
    else
*************** sh64_extract_return_value (struct type *
*** 1694,1704 ****
        if (len <= 8)
  	{
  	  /* Result is in register 2. If smaller than 8 bytes, it is padded 
! 	     at the most significant end. */
  	  return_register = DEFAULT_RETURN_REGNUM;
  	  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
  	    offset = DEPRECATED_REGISTER_BYTE (return_register) +
! 	      DEPRECATED_REGISTER_RAW_SIZE (return_register) - len;
  	  else
  	    offset = DEPRECATED_REGISTER_BYTE (return_register);
  	  memcpy (valbuf, (char *) regbuf + offset, len);
--- 1702,1712 ----
        if (len <= 8)
  	{
  	  /* Result is in register 2. If smaller than 8 bytes, it is padded 
! 	     at the most significant end.  */
  	  return_register = DEFAULT_RETURN_REGNUM;
  	  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
  	    offset = DEPRECATED_REGISTER_BYTE (return_register) +
! 	      register_size (current_gdbarch, return_register) - len;
  	  else
  	    offset = DEPRECATED_REGISTER_BYTE (return_register);
  	  memcpy (valbuf, (char *) regbuf + offset, len);
*************** sh64_store_return_value (struct type *ty
*** 1739,1752 ****
        int return_register = DEFAULT_RETURN_REGNUM;
        int offset = 0;
  
!       if (len <= DEPRECATED_REGISTER_RAW_SIZE (return_register))
  	{
! 	  /* Pad with zeros. */
! 	  memset (buf, 0, DEPRECATED_REGISTER_RAW_SIZE (return_register));
  	  if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
! 	    offset = 0; /*DEPRECATED_REGISTER_RAW_SIZE (return_register) - len;*/
  	  else
! 	    offset = DEPRECATED_REGISTER_RAW_SIZE (return_register) - len;
  
  	  memcpy (buf + offset, valbuf, len);
  	  deprecated_write_register_gen (return_register, buf);
--- 1747,1761 ----
        int return_register = DEFAULT_RETURN_REGNUM;
        int offset = 0;
  
!       if (len <= register_size (current_gdbarch, return_register))
  	{
! 	  /* Pad with zeros.  */
! 	  memset (buf, 0, register_size (current_gdbarch, return_register));
  	  if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
! 	    offset = 0; /*register_size (current_gdbarch, 
! 			  return_register) - len;*/
  	  else
! 	    offset = register_size (current_gdbarch, return_register) - len;
  
  	  memcpy (buf + offset, valbuf, len);
  	  deprecated_write_register_gen (return_register, buf);
*************** sh_sh64_register_byte (int reg_nr)
*** 2003,2043 ****
        + (reg_nr - FP0_REGNUM + 1) * 4);
  }
  
- static int
- sh_sh64_register_raw_size (int reg_nr)
- {
-   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); 
- 
-   if ((reg_nr >= DR0_REGNUM 
-        && reg_nr <= DR_LAST_REGNUM)
-       || (reg_nr >= FPP0_REGNUM 
- 	  && reg_nr <= FPP_LAST_REGNUM)
-       || (reg_nr >= DR0_C_REGNUM 
- 	  && reg_nr <= DR_LAST_C_REGNUM)
-       || (reg_nr <= TR7_REGNUM))
-     return 8;
- 
-   else if ((reg_nr >= FV0_REGNUM 
- 	    && reg_nr <= FV_LAST_REGNUM)
- 	   || (reg_nr >= FV0_C_REGNUM 
- 	       && reg_nr <= FV_LAST_C_REGNUM))
-     return 16;
- 
-   else /* this covers also the 32-bit SH compact registers. */
-     return 4;
- }
- 
- /* ??????? FIXME */
- static int
- sh_sh64_register_virtual_size (int reg_nr)
- {
-   if (reg_nr >= FP0_REGNUM
-       && reg_nr <= FP_LAST_REGNUM)
-     return 4;
-   else
-     return 8;
- }
- 
  static struct type *
  sh_sh64_build_float_register_type (int high)
  {
--- 2012,2017 ----
*************** sh_sh64_build_float_register_type (int h
*** 2047,2056 ****
    return create_array_type (NULL, builtin_type_float, temp);
  }
  
  static struct type *
! sh_sh64_register_virtual_type (int reg_nr)
  {
!   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); 
  
    if ((reg_nr >= FP0_REGNUM
         && reg_nr <= FP_LAST_REGNUM)
--- 2021,2032 ----
    return create_array_type (NULL, builtin_type_float, temp);
  }
  
+ /* Return the GDB type object for the "standard" data type
+    of data in register REG_NR.  */
  static struct type *
! sh64_register_type (struct gdbarch *gdbarch, int reg_nr)
  {
!   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    if ((reg_nr >= FP0_REGNUM
         && reg_nr <= FP_LAST_REGNUM)
*************** static void
*** 2083,2094 ****
  sh_sh64_register_convert_to_virtual (int regnum, struct type *type,
  				     char *from, char *to)
  {
!   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); 
  
    if (TARGET_BYTE_ORDER != BFD_ENDIAN_LITTLE)
      {
!       /* It is a no-op. */
!       memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regnum));
        return;
      }
  
--- 2059,2070 ----
  sh_sh64_register_convert_to_virtual (int regnum, struct type *type,
  				     char *from, char *to)
  {
!   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    if (TARGET_BYTE_ORDER != BFD_ENDIAN_LITTLE)
      {
!       /* It is a no-op.  */
!       memcpy (to, from, register_size (current_gdbarch, regnum));
        return;
      }
  
*************** sh_sh64_register_convert_to_virtual (int
*** 2098,2120 ****
  	  && regnum <= DR_LAST_C_REGNUM))
      {
        DOUBLEST val;
!       floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword, from, &val);
!       deprecated_store_floating(to, TYPE_LENGTH(type), val);
      }
    else
!     error("sh_register_convert_to_virtual called with non DR register number");
  }
  
  static void
  sh_sh64_register_convert_to_raw (struct type *type, int regnum,
  				 const void *from, void *to)
  {
!   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); 
  
    if (TARGET_BYTE_ORDER != BFD_ENDIAN_LITTLE)
      {
!       /* It is a no-op. */
!       memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regnum));
        return;
      }
  
--- 2074,2097 ----
  	  && regnum <= DR_LAST_C_REGNUM))
      {
        DOUBLEST val;
!       floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword, 
! 			       from, &val);
!       store_typed_floating(to, type, val);
      }
    else
!     error("sh64_register_convert_to_virtual called with non DR register number");
  }
  
  static void
  sh_sh64_register_convert_to_raw (struct type *type, int regnum,
  				 const void *from, void *to)
  {
!   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  
    if (TARGET_BYTE_ORDER != BFD_ENDIAN_LITTLE)
      {
!       /* It is a no-op.  */
!       memcpy (to, from, register_size (current_gdbarch, regnum));
        return;
      }
  
*************** sh64_pseudo_register_read (struct gdbarc
*** 2138,2160 ****
    int portion;
    int offset = 0;
    char temp_buffer[MAX_REGISTER_SIZE];
!   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); 
  
    if (reg_nr >= DR0_REGNUM 
        && reg_nr <= DR_LAST_REGNUM)
      {
        base_regnum = dr_reg_base_num (reg_nr);
  
!       /* Build the value in the provided buffer. */ 
        /* DR regs are double precision registers obtained by
! 	 concatenating 2 single precision floating point registers. */
        for (portion = 0; portion < 2; portion++)
  	regcache_raw_read (regcache, base_regnum + portion, 
  			   (temp_buffer
! 			    + DEPRECATED_REGISTER_RAW_SIZE (base_regnum) * portion));
  
!       /* We must pay attention to the endiannes. */
!       sh_sh64_register_convert_to_virtual (reg_nr, DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr),
  					   temp_buffer, buffer);
  
      }
--- 2116,2140 ----
    int portion;
    int offset = 0;
    char temp_buffer[MAX_REGISTER_SIZE];
!   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
  
    if (reg_nr >= DR0_REGNUM 
        && reg_nr <= DR_LAST_REGNUM)
      {
        base_regnum = dr_reg_base_num (reg_nr);
  
!       /* Build the value in the provided buffer.  */ 
        /* DR regs are double precision registers obtained by
! 	 concatenating 2 single precision floating point registers.  */
        for (portion = 0; portion < 2; portion++)
  	regcache_raw_read (regcache, base_regnum + portion, 
  			   (temp_buffer
! 			    + register_size (gdbarch, base_regnum) * portion));
  
!       /* We must pay attention to the endianness.  */
!       sh_sh64_register_convert_to_virtual (reg_nr, 
! 					   gdbarch_register_type (gdbarch, 
! 								  reg_nr),
  					   temp_buffer, buffer);
  
      }
*************** sh64_pseudo_register_read (struct gdbarc
*** 2164,2176 ****
      {
        base_regnum = fpp_reg_base_num (reg_nr);
  
!       /* Build the value in the provided buffer. */ 
        /* FPP regs are pairs of single precision registers obtained by
! 	 concatenating 2 single precision floating point registers. */
        for (portion = 0; portion < 2; portion++)
  	regcache_raw_read (regcache, base_regnum + portion, 
  			   ((char *) buffer
! 			    + DEPRECATED_REGISTER_RAW_SIZE (base_regnum) * portion));
      }
  
    else if (reg_nr >= FV0_REGNUM 
--- 2144,2156 ----
      {
        base_regnum = fpp_reg_base_num (reg_nr);
  
!       /* Build the value in the provided buffer.  */ 
        /* FPP regs are pairs of single precision registers obtained by
! 	 concatenating 2 single precision floating point registers.  */
        for (portion = 0; portion < 2; portion++)
  	regcache_raw_read (regcache, base_regnum + portion, 
  			   ((char *) buffer
! 			    + register_size (gdbarch, base_regnum) * portion));
      }
  
    else if (reg_nr >= FV0_REGNUM 
*************** sh64_pseudo_register_read (struct gdbarc
*** 2178,2190 ****
      {
        base_regnum = fv_reg_base_num (reg_nr);
  
!       /* Build the value in the provided buffer. */ 
        /* FV regs are vectors of single precision registers obtained by
! 	 concatenating 4 single precision floating point registers. */
        for (portion = 0; portion < 4; portion++)
  	regcache_raw_read (regcache, base_regnum + portion, 
  			   ((char *) buffer
! 			    + DEPRECATED_REGISTER_RAW_SIZE (base_regnum) * portion));
      }
  
    /* sh compact pseudo registers. 1-to-1 with a shmedia register */
--- 2158,2170 ----
      {
        base_regnum = fv_reg_base_num (reg_nr);
  
!       /* Build the value in the provided buffer.  */ 
        /* FV regs are vectors of single precision registers obtained by
! 	 concatenating 4 single precision floating point registers.  */
        for (portion = 0; portion < 4; portion++)
  	regcache_raw_read (regcache, base_regnum + portion, 
  			   ((char *) buffer
! 			    + register_size (gdbarch, base_regnum) * portion));
      }
  
    /* sh compact pseudo registers. 1-to-1 with a shmedia register */
*************** sh64_pseudo_register_read (struct gdbarc
*** 2217,2230 ****
        base_regnum = sh64_compact_reg_base_num (reg_nr);
  
        /* DR_C regs are double precision registers obtained by
! 	 concatenating 2 single precision floating point registers. */
        for (portion = 0; portion < 2; portion++)
  	regcache_raw_read (regcache, base_regnum + portion, 
  			   (temp_buffer
! 			    + DEPRECATED_REGISTER_RAW_SIZE (base_regnum) * portion));
  
!       /* We must pay attention to the endiannes. */
!       sh_sh64_register_convert_to_virtual (reg_nr, DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr),
  					   temp_buffer, buffer);
      }
  
--- 2197,2212 ----
        base_regnum = sh64_compact_reg_base_num (reg_nr);
  
        /* DR_C regs are double precision registers obtained by
! 	 concatenating 2 single precision floating point registers.  */
        for (portion = 0; portion < 2; portion++)
  	regcache_raw_read (regcache, base_regnum + portion, 
  			   (temp_buffer
! 			    + register_size (gdbarch, base_regnum) * portion));
  
!       /* We must pay attention to the endianness.  */
!       sh_sh64_register_convert_to_virtual (reg_nr, 
! 					   gdbarch_register_type (gdbarch, 
! 								  reg_nr),
  					   temp_buffer, buffer);
      }
  
*************** sh64_pseudo_register_read (struct gdbarc
*** 2233,2245 ****
      {
        base_regnum = sh64_compact_reg_base_num (reg_nr);
  
!       /* Build the value in the provided buffer. */ 
        /* FV_C regs are vectors of single precision registers obtained by
! 	 concatenating 4 single precision floating point registers. */
        for (portion = 0; portion < 4; portion++)
  	regcache_raw_read (regcache, base_regnum + portion, 
  			   ((char *) buffer
! 			    + DEPRECATED_REGISTER_RAW_SIZE (base_regnum) * portion));
      }
  
    else if (reg_nr == FPSCR_C_REGNUM)
--- 2215,2227 ----
      {
        base_regnum = sh64_compact_reg_base_num (reg_nr);
  
!       /* Build the value in the provided buffer.  */ 
        /* FV_C regs are vectors of single precision registers obtained by
! 	 concatenating 4 single precision floating point registers.  */
        for (portion = 0; portion < 4; portion++)
  	regcache_raw_read (regcache, base_regnum + portion, 
  			   ((char *) buffer
! 			    + register_size (gdbarch, base_regnum) * portion));
      }
  
    else if (reg_nr == FPSCR_C_REGNUM)
*************** sh64_pseudo_register_write (struct gdbar
*** 2309,2316 ****
        && reg_nr <= DR_LAST_REGNUM)
      {
        base_regnum = dr_reg_base_num (reg_nr);
!       /* We must pay attention to the endiannes. */
!       sh_sh64_register_convert_to_raw (DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
  				       buffer, temp_buffer);
  	  
  
--- 2291,2299 ----
        && reg_nr <= DR_LAST_REGNUM)
      {
        base_regnum = dr_reg_base_num (reg_nr);
!       /* We must pay attention to the endianness.  */
!       sh_sh64_register_convert_to_raw (gdbarch_register_type (gdbarch, 
! 							      reg_nr), reg_nr,
  				       buffer, temp_buffer);
  	  
  
*************** sh64_pseudo_register_write (struct gdbar
*** 2318,2324 ****
        for (portion = 0; portion < 2; portion++)
  	regcache_raw_write (regcache, base_regnum + portion, 
  			    (temp_buffer
! 			     + DEPRECATED_REGISTER_RAW_SIZE (base_regnum) * portion));
      }
  
    else if (reg_nr >= FPP0_REGNUM 
--- 2301,2308 ----
        for (portion = 0; portion < 2; portion++)
  	regcache_raw_write (regcache, base_regnum + portion, 
  			    (temp_buffer
! 			     + register_size (gdbarch, 
! 					      base_regnum) * portion));
      }
  
    else if (reg_nr >= FPP0_REGNUM 
*************** sh64_pseudo_register_write (struct gdbar
*** 2330,2336 ****
        for (portion = 0; portion < 2; portion++)
  	regcache_raw_write (regcache, base_regnum + portion,
  			    ((char *) buffer
! 			     + DEPRECATED_REGISTER_RAW_SIZE (base_regnum) * portion));
      }
  
    else if (reg_nr >= FV0_REGNUM
--- 2314,2321 ----
        for (portion = 0; portion < 2; portion++)
  	regcache_raw_write (regcache, base_regnum + portion,
  			    ((char *) buffer
! 			     + register_size (gdbarch, 
! 					      base_regnum) * portion));
      }
  
    else if (reg_nr >= FV0_REGNUM
*************** sh64_pseudo_register_write (struct gdbar
*** 2342,2348 ****
        for (portion = 0; portion < 4; portion++)
  	regcache_raw_write (regcache, base_regnum + portion,
  			    ((char *) buffer
! 			     + DEPRECATED_REGISTER_RAW_SIZE (base_regnum) * portion));
      }
  
    /* sh compact general pseudo registers. 1-to-1 with a shmedia
--- 2327,2334 ----
        for (portion = 0; portion < 4; portion++)
  	regcache_raw_write (regcache, base_regnum + portion,
  			    ((char *) buffer
! 			     + register_size (gdbarch, 
! 					      base_regnum) * portion));
      }
  
    /* sh compact general pseudo registers. 1-to-1 with a shmedia
*************** sh64_pseudo_register_write (struct gdbar
*** 2380,2392 ****
        base_regnum = sh64_compact_reg_base_num (reg_nr);
        for (portion = 0; portion < 2; portion++)
  	{
! 	  /* We must pay attention to the endiannes. */
! 	  sh_sh64_register_convert_to_raw (DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
  					   buffer, temp_buffer);
  
  	  regcache_raw_write (regcache, base_regnum + portion,
  			      (temp_buffer
! 			       + DEPRECATED_REGISTER_RAW_SIZE (base_regnum) * portion));
  	}
      }
  
--- 2366,2381 ----
        base_regnum = sh64_compact_reg_base_num (reg_nr);
        for (portion = 0; portion < 2; portion++)
  	{
! 	  /* We must pay attention to the endianness.  */
! 	  sh_sh64_register_convert_to_raw (gdbarch_register_type (gdbarch,
! 								  reg_nr), 
! 					   reg_nr,
  					   buffer, temp_buffer);
  
  	  regcache_raw_write (regcache, base_regnum + portion,
  			      (temp_buffer
! 			       + register_size (gdbarch, 
! 						base_regnum) * portion));
  	}
      }
  
*************** sh64_pseudo_register_write (struct gdbar
*** 2399,2405 ****
  	{
  	  regcache_raw_write (regcache, base_regnum + portion,
  			      ((char *) buffer
! 			       + DEPRECATED_REGISTER_RAW_SIZE (base_regnum) * portion));
  	}
      }
  
--- 2388,2395 ----
  	{
  	  regcache_raw_write (regcache, base_regnum + portion,
  			      ((char *) buffer
! 			       + register_size (gdbarch, 
! 						base_regnum) * portion));
  	}
      }
  
*************** sh64_gdbarch_init (struct gdbarch_info i
*** 2895,2921 ****
    set_gdbarch_fp0_regnum (gdbarch, SIM_SH64_FR0_REGNUM);
    set_gdbarch_pc_regnum (gdbarch, 64);
  
!   /* the number of real registers is the same whether we are in 
!      ISA16(compact) or ISA32(media). */
    set_gdbarch_num_regs (gdbarch, SIM_SH64_NR_REGS);
-   set_gdbarch_deprecated_register_size (gdbarch, 8); /*????*/
    set_gdbarch_deprecated_register_bytes (gdbarch,
  					 ((SIM_SH64_NR_FP_REGS + 1) * 4)
  					 + (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8);
  
    set_gdbarch_register_name (gdbarch, sh_sh64_register_name);
!   set_gdbarch_deprecated_register_virtual_type (gdbarch, sh_sh64_register_virtual_type);
    set_gdbarch_deprecated_store_return_value (gdbarch, sh64_store_return_value);
-   set_gdbarch_deprecated_register_raw_size (gdbarch, sh_sh64_register_raw_size);
-   set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_sh64_register_raw_size);
    set_gdbarch_deprecated_register_byte (gdbarch, sh_sh64_register_byte);
-   /* This seems awfully wrong!*/
-   /*set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);*/
-   /* should include the size of the pseudo regs. */
-   set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4 * 4);
-   /* Or should that go in the virtual_size? */
-   /*set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);*/
-   set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4 * 4);
    set_gdbarch_pseudo_register_read (gdbarch, sh64_pseudo_register_read);
    set_gdbarch_pseudo_register_write (gdbarch, sh64_pseudo_register_write);
  
--- 2884,2900 ----
    set_gdbarch_fp0_regnum (gdbarch, SIM_SH64_FR0_REGNUM);
    set_gdbarch_pc_regnum (gdbarch, 64);
  
!   /* The number of real registers is the same whether we are in 
!      ISA16(compact) or ISA32(media).  */
    set_gdbarch_num_regs (gdbarch, SIM_SH64_NR_REGS);
    set_gdbarch_deprecated_register_bytes (gdbarch,
  					 ((SIM_SH64_NR_FP_REGS + 1) * 4)
  					 + (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8);
  
    set_gdbarch_register_name (gdbarch, sh_sh64_register_name);
!   set_gdbarch_register_type (gdbarch, sh64_register_type);

    set_gdbarch_deprecated_store_return_value (gdbarch, sh64_store_return_value);
    set_gdbarch_deprecated_register_byte (gdbarch, sh_sh64_register_byte);
    set_gdbarch_pseudo_register_read (gdbarch, sh64_pseudo_register_read);
    set_gdbarch_pseudo_register_write (gdbarch, sh64_pseudo_register_write);
  

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