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/rfc] Deprecate REGISTER_VIRTUAL_SIZE


More follow through.

Note that the MIPS, which was a major road block to eliminating register raw/virtual size, now has consistent sizes.

I'll commit in a few days,
Andrew
2003-09-27  Andrew Cagney  <cagney@redhat.com>

	* gdbarch.sh (DEPRECATED_REGISTER_VIRTUAL_SIZE): Rename
	REGISTER_VIRTUAL_SIZE.
	* gdbarch.h, gdbarch.c: Regenerate.
	* vax-tdep.h, sparc-tdep.c, regcache.h: Update.
	* regcache.c, mn10300-tdep.c, mips-tdep.c: Update.
	* infcmd.c, frame.c, findvar.c, cris-tdep.c: Update.

Index: doc/ChangeLog
2003-09-22  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Rename
	REGISTER_VIRTUAL_SIZE to DEPRECATED_REGISTER_VIRTUAL_SIZE.
	(Target Architecture Definition): 

Index: mi/ChangeLog
2003-09-22  Andrew Cagney  <cagney@redhat.com>

	* mi-main.c: Rename REGISTER_VIRTUAL_SIZE to
	DEPRECATED_REGISTER_VIRTUAL_SIZE.

Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.88
diff -u -r1.88 cris-tdep.c
--- cris-tdep.c	27 Sep 2003 15:51:02 -0000	1.88
+++ cris-tdep.c	27 Sep 2003 18:43:36 -0000
@@ -4245,7 +4245,7 @@
   /* The length of the registers in the program's representation.  */
   set_gdbarch_deprecated_register_virtual_size (gdbarch, cris_register_size);
   
-  /* The largest value REGISTER_VIRTUAL_SIZE can have.  */
+  /* The largest value DEPRECATED_REGISTER_VIRTUAL_SIZE can have.  */
   set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 32);
 
   set_gdbarch_deprecated_register_virtual_type (gdbarch, cris_register_virtual_type);
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.65
diff -u -r1.65 findvar.c
--- findvar.c	16 Sep 2003 18:56:35 -0000	1.65
+++ findvar.c	27 Sep 2003 18:43:38 -0000
@@ -289,7 +289,7 @@
       DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, register_type (current_gdbarch, regnum),
 					      raw_buffer, VALUE_CONTENTS_RAW (reg_val));
     }
-  else if (REGISTER_RAW_SIZE (regnum) == REGISTER_VIRTUAL_SIZE (regnum))
+  else if (REGISTER_RAW_SIZE (regnum) == DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum))
     memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer,
 	    REGISTER_RAW_SIZE (regnum));
   else
@@ -298,7 +298,7 @@
 		    REGISTER_NAME (regnum),
 		    regnum,
 		    REGISTER_RAW_SIZE (regnum),
-		    REGISTER_VIRTUAL_SIZE (regnum));
+		    DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum));
   VALUE_LVAL (reg_val) = lval;
   VALUE_ADDRESS (reg_val) = addr;
   VALUE_REGNO (reg_val) = regnum;
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.142
diff -u -r1.142 frame.c
--- frame.c	25 Sep 2003 20:44:01 -0000	1.142
+++ frame.c	27 Sep 2003 18:43:41 -0000
@@ -629,7 +629,7 @@
 {
   char buf[MAX_REGISTER_SIZE];
   frame_unwind_register (frame, regnum, buf);
-  return extract_signed_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
+  return extract_signed_integer (buf, DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum));
 }
 
 LONGEST
@@ -643,7 +643,7 @@
 {
   char buf[MAX_REGISTER_SIZE];
   frame_unwind_register (frame, regnum, buf);
-  return extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
+  return extract_unsigned_integer (buf, DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum));
 }
 
 ULONGEST
@@ -658,7 +658,7 @@
 {
   char buf[MAX_REGISTER_SIZE];
   frame_unwind_register (frame, regnum, buf);
-  (*val) = extract_signed_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
+  (*val) = extract_signed_integer (buf, DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum));
 }
 
 void
@@ -667,7 +667,7 @@
 {
   char buf[MAX_REGISTER_SIZE];
   frame_unwind_register (frame, regnum, buf);
-  (*val) = extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
+  (*val) = extract_unsigned_integer (buf, DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum));
 }
 
 void
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.272
diff -u -r1.272 gdbarch.sh
--- gdbarch.sh	18 Sep 2003 22:39:21 -0000	1.272
+++ gdbarch.sh	27 Sep 2003 18:50:53 -0000
@@ -491,7 +491,7 @@
 # sizes agree with the value computed from REGISTER_TYPE,
 # DEPRECATED_REGISTER_VIRTUAL_SIZE can be deleted.  See: maint print
 # registers.
-F:2:REGISTER_VIRTUAL_SIZE:int:deprecated_register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size
+F:2:DEPRECATED_REGISTER_VIRTUAL_SIZE:int:deprecated_register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size
 # DEPRECATED_MAX_REGISTER_RAW_SIZE can be deleted.  It has been
 # replaced by the constant MAX_REGISTER_SIZE.
 V:2:DEPRECATED_MAX_REGISTER_RAW_SIZE:int:deprecated_max_register_raw_size
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.91
diff -u -r1.91 infcmd.c
--- infcmd.c	21 Sep 2003 01:26:44 -0000	1.91
+++ infcmd.c	27 Sep 2003 18:50:55 -0000
@@ -1545,7 +1545,7 @@
       else
 	{
 	  memcpy (virtual_buffer, raw_buffer,
-		  REGISTER_VIRTUAL_SIZE (i));
+		  DEPRECATED_REGISTER_VIRTUAL_SIZE (i));
 	}
 
       /* If virtual format is floating, print it that way, and in raw
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.237
diff -u -r1.237 mips-tdep.c
--- mips-tdep.c	25 Sep 2003 20:44:01 -0000	1.237
+++ mips-tdep.c	27 Sep 2003 18:52:47 -0000
@@ -656,7 +656,7 @@
 	 (FP_REGISTER_DOUBLE).  Also, GDB's protocol is defined by a
 	 combination of REGISTER_RAW_SIZE and DEPRECATED_REGISTER_BYTE.  */
       if (mips64_transfers_32bit_regs_p)
-	return REGISTER_VIRTUAL_SIZE (regnum);
+	return DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum);
       else if (regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 32
 	       && FP_REGISTER_DOUBLE)
 	/* For MIPS_ABI_N32 (for example) we need 8 byte floating point
@@ -717,7 +717,7 @@
   if (mips64_transfers_32bit_regs_p)
     return 0;
   else
-    return (REGISTER_RAW_SIZE (reg_nr) > REGISTER_VIRTUAL_SIZE (reg_nr));
+    return (REGISTER_RAW_SIZE (reg_nr) > DEPRECATED_REGISTER_VIRTUAL_SIZE (reg_nr));
 }
 
 static void
@@ -4229,7 +4229,7 @@
     fprintf_filtered (file, ": ");
 
   if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
-    offset = REGISTER_RAW_SIZE (regnum) - REGISTER_VIRTUAL_SIZE (regnum);
+    offset = REGISTER_RAW_SIZE (regnum) - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum);
   else
     offset = 0;
 
@@ -4297,16 +4297,16 @@
       if (!frame_register_read (frame, regnum, raw_buffer))
 	error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum));
       /* pad small registers */
-      for (byte = 0; byte < (MIPS_REGSIZE - REGISTER_VIRTUAL_SIZE (regnum)); byte++)
+      for (byte = 0; byte < (MIPS_REGSIZE - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum)); byte++)
 	printf_filtered ("  ");
       /* Now print the register value in hex, endian order. */
       if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
-	for (byte = REGISTER_RAW_SIZE (regnum) - REGISTER_VIRTUAL_SIZE (regnum);
+	for (byte = REGISTER_RAW_SIZE (regnum) - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum);
 	     byte < REGISTER_RAW_SIZE (regnum);
 	     byte++)
 	  fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[byte]);
       else
-	for (byte = REGISTER_VIRTUAL_SIZE (regnum) - 1;
+	for (byte = DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum) - 1;
 	     byte >= 0;
 	     byte--)
 	  fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[byte]);
Index: mn10300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v
retrieving revision 1.91
diff -u -r1.91 mn10300-tdep.c
--- mn10300-tdep.c	25 Sep 2003 20:44:01 -0000	1.91
+++ mn10300-tdep.c	27 Sep 2003 18:52:51 -0000
@@ -1039,14 +1039,14 @@
       int byte;
       if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
 	{
-	  for (byte = REGISTER_RAW_SIZE (regnum) - REGISTER_VIRTUAL_SIZE (regnum);
+	  for (byte = REGISTER_RAW_SIZE (regnum) - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum);
 	       byte < REGISTER_RAW_SIZE (regnum);
 	       byte++)
 	    printf_filtered ("%02x", (unsigned char) raw_buffer[byte]);
 	}
       else
 	{
-	  for (byte = REGISTER_VIRTUAL_SIZE (regnum) - 1;
+	  for (byte = DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum) - 1;
 	       byte >= 0;
 	       byte--)
 	    printf_filtered ("%02x", (unsigned char) raw_buffer[byte]);
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.100
diff -u -r1.100 regcache.c
--- regcache.c	21 Sep 2003 01:26:45 -0000	1.100
+++ regcache.c	27 Sep 2003 18:52:53 -0000
@@ -114,7 +114,7 @@
       descr->register_offset[i] = DEPRECATED_REGISTER_BYTE (i);
       descr->sizeof_register[i] = REGISTER_RAW_SIZE (i);
       gdb_assert (MAX_REGISTER_SIZE >= REGISTER_RAW_SIZE (i));
-      gdb_assert (MAX_REGISTER_SIZE >= REGISTER_VIRTUAL_SIZE (i));
+      gdb_assert (MAX_REGISTER_SIZE >= DEPRECATED_REGISTER_VIRTUAL_SIZE (i));
     }
 
   /* Compute the real size of the register buffer.  Start out by
@@ -243,7 +243,7 @@
 	gdb_assert (descr->register_offset[i] == DEPRECATED_REGISTER_BYTE (i));
 #if 0
       gdb_assert (descr->sizeof_register[i] == REGISTER_RAW_SIZE (i));
-      gdb_assert (descr->sizeof_register[i] == REGISTER_VIRTUAL_SIZE (i));
+      gdb_assert (descr->sizeof_register[i] == DEPRECATED_REGISTER_VIRTUAL_SIZE (i));
 #endif
     }
   /* gdb_assert (descr->sizeof_raw_registers == DEPRECATED_REGISTER_BYTES (i));  */
@@ -1545,7 +1545,7 @@
 	  if ((regcache->descr->sizeof_register[regnum]
 	       != REGISTER_RAW_SIZE (regnum))
 	      || (regcache->descr->sizeof_register[regnum]
-		  != REGISTER_VIRTUAL_SIZE (regnum))
+		  != DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum))
 	      || (regcache->descr->sizeof_register[regnum]
 		  != TYPE_LENGTH (register_type (regcache->descr->gdbarch,
 						 regnum)))
@@ -1615,7 +1615,7 @@
 	      regcache_cooked_read (regcache, regnum, buf);
 	      fprintf_unfiltered (file, "0x");
 	      dump_endian_bytes (file, TARGET_BYTE_ORDER, buf,
-				 REGISTER_VIRTUAL_SIZE (regnum));
+				 DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum));
 	    }
 	}
 
Index: regcache.h
===================================================================
RCS file: /cvs/src/src/gdb/regcache.h,v
retrieving revision 1.36
diff -u -r1.36 regcache.h
--- regcache.h	29 Aug 2003 09:59:28 -0000	1.36
+++ regcache.h	27 Sep 2003 18:52:54 -0000
@@ -143,8 +143,8 @@
 
    Anyway, the up-shot is that, until that mess is fixed, core code
    can end up being very confused - should the RAW or VIRTUAL size be
-   used?  As a rule of thumb, use REGISTER_VIRTUAL_SIZE in cooked
-   code, but with the comment:
+   used?  As a rule of thumb, use DEPRECATED_REGISTER_VIRTUAL_SIZE in
+   cooked code, but with the comment:
 
    OK: REGISTER_VIRTUAL_SIZE
 
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.128
diff -u -r1.128 sparc-tdep.c
--- sparc-tdep.c	18 Sep 2003 22:39:21 -0000	1.128
+++ sparc-tdep.c	27 Sep 2003 18:52:55 -0000
@@ -2059,7 +2059,7 @@
 	  continue;
 	}
 
-      memcpy (virtual_buffer, raw_buffer, REGISTER_VIRTUAL_SIZE (i));
+      memcpy (virtual_buffer, raw_buffer, DEPRECATED_REGISTER_VIRTUAL_SIZE (i));
 
       /* If virtual format is floating, print it that way, and in raw
          hex.  */
Index: vax-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/vax-tdep.h,v
retrieving revision 1.3
diff -u -r1.3 vax-tdep.h
--- vax-tdep.h	4 Jan 2003 23:38:46 -0000	1.3
+++ vax-tdep.h	27 Sep 2003 18:52:55 -0000
@@ -36,7 +36,7 @@
 /* Largest value REGISTER_RAW_SIZE can have.  */
 #define VAX_MAX_REGISTER_RAW_SIZE 4
 
-/* Largest value REGISTER_VIRTUAL_SIZE can have.  */
+/* Largest value DEPRECATED_REGISTER_VIRTUAL_SIZE can have.  */
 #define VAX_MAX_REGISTER_VIRTUAL_SIZE 4
 
 /* Register numbers of various important registers.
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.167
diff -u -r1.167 gdbint.texinfo
--- doc/gdbint.texinfo	22 Sep 2003 23:20:54 -0000	1.167
+++ doc/gdbint.texinfo	27 Sep 2003 18:54:33 -0000
@@ -2772,7 +2772,7 @@
 remote protocol packet.
 @end deftypefn
 
-@deftypefn {Target Macro} int REGISTER_VIRTUAL_SIZE (int @var{reg})
+@deftypefn {Target Macro} int DEPRECATED_REGISTER_VIRTUAL_SIZE (int @var{reg})
 The size of register number @var{reg}'s value, in its virtual format.
 This is the size a @code{struct value}'s buffer will have, holding that
 register's value.
@@ -3538,8 +3538,8 @@
 Any register with a valid name.
 @end table
 
-@item REGISTER_VIRTUAL_SIZE (@var{reg})
-@findex REGISTER_VIRTUAL_SIZE
+@item DEPRECATED_REGISTER_VIRTUAL_SIZE (@var{reg})
+@findex DEPRECATED_REGISTER_VIRTUAL_SIZE
 Return the virtual size of @var{reg}; defaults to the size of the
 register's virtual type.
 Return the virtual size of @var{reg}.
Index: mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.54
diff -u -r1.54 mi-main.c
--- mi/mi-main.c	20 Sep 2003 17:50:28 -0000	1.54
+++ mi/mi-main.c	27 Sep 2003 19:03:33 -0000
@@ -544,7 +544,7 @@
 				   raw_buffer, virtual_buffer);
     }
   else
-    memcpy (virtual_buffer, raw_buffer, REGISTER_VIRTUAL_SIZE (regnum));
+    memcpy (virtual_buffer, raw_buffer, DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum));
 
   if (format == 'r')
     {

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