[patch/rfc] Finish deprecating REGISTER_VIRTUAL_TYPE

Andrew Cagney
2003-09-28T01:05:19Z

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]

Hello.

More closure. This finishing deprecating register_virtual_type. It's
been replaced by register_type.

I'll commit in a few days,
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 11001 bytes --]

2003-09-27 Andrew Cagney <cagney@redhat.com>

* gdbarch.sh (DEPRECATED_REGISTER_VIRTUAL_TYPE): Rename
DEPRECATED_REGISTER_VIRTUAL_TYPE.
* gdbarch.h, gdbarch.c: Regenerate.
* arch-utils.c, hppa-tdep.c, regcache.c, regcache.h: Update.
* sh64-tdep.c, sparc-tdep.c: Update.

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

* gdbint.texinfo (Target Architecture Definition): Rename
REGISTER_VIRTUAL_TYPE to DEPRECATED_REGISTER_VIRTUAL_TYPE.

Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.95
diff -u -r1.95 arch-utils.c
--- arch-utils.c 27 Sep 2003 15:51:02 -0000 1.95
+++ arch-utils.c 27 Sep 2003 19:44:17 -0000
@@ -294,7 +294,7 @@
/* FIXME: cagney/2003-03-01: Once all architectures implement
gdbarch_register_type(), this entire function can go away. It
is made obsolete by register_size(). */
- return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (regnum)); /* OK */
+ return TYPE_LENGTH (DEPRECATED_REGISTER_VIRTUAL_TYPE (regnum)); /* OK */
}

/* Assume all registers are adjacent. */
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 19:49:52 -0000
@@ -467,10 +467,10 @@
f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0
f::REGISTER_NAME:const char *:register_name:int regnr:regnr

-# REGISTER_TYPE is a direct replacement for REGISTER_VIRTUAL_TYPE.
+# REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE.
M:2:REGISTER_TYPE:struct type *:register_type:int reg_nr:reg_nr
-# REGISTER_TYPE is a direct replacement for REGISTER_VIRTUAL_TYPE.
-F:2:REGISTER_VIRTUAL_TYPE:struct type *:deprecated_register_virtual_type:int reg_nr:reg_nr
+# REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE.
+F:2:DEPRECATED_REGISTER_VIRTUAL_TYPE:struct type *:deprecated_register_virtual_type:int reg_nr:reg_nr
# DEPRECATED_REGISTER_BYTES can be deleted. The value is computed
# from REGISTER_TYPE.
v::DEPRECATED_REGISTER_BYTES:int:deprecated_register_bytes
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.99
diff -u -r1.99 hppa-tdep.c
--- hppa-tdep.c 25 Sep 2003 20:44:01 -0000 1.99
+++ hppa-tdep.c 27 Sep 2003 19:50:35 -0000
@@ -2986,7 +2986,7 @@
print_spaces_filtered (8 - strlen (REGISTER_NAME (i)), gdb_stdout);
fputs_filtered ("(single precision) ", gdb_stdout);

- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, gdb_stdout, 0,
+ val_print (DEPRECATED_REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, gdb_stdout, 0,
1, 0, Val_pretty_default);
printf_filtered ("\n");

@@ -3045,7 +3045,7 @@
}
else
{
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, stream, 0,
+ val_print (DEPRECATED_REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, stream, 0,
1, 0, Val_pretty_default);
}

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 19:50:52 -0000
@@ -171,7 +171,7 @@
descr->register_type[i] = gdbarch_register_type (gdbarch, i);
}
else
- descr->register_type[i] = REGISTER_VIRTUAL_TYPE (i); /* OK */
+ descr->register_type[i] = DEPRECATED_REGISTER_VIRTUAL_TYPE (i); /* OK */
}

/* Construct a strictly RAW register cache. Don't allow pseudo's
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 19:50:52 -0000
@@ -117,9 +117,9 @@
value stored in a table.

NOTE: cagney/2002-08-17: The original macro was called
- REGISTER_VIRTUAL_TYPE. This was because the register could have
- different raw and cooked (nee virtual) representations. The
- CONVERTABLE methods being used to convert between the two
+ DEPRECATED_REGISTER_VIRTUAL_TYPE. This was because the register
+ could have different raw and cooked (nee virtual) representations.
+ The CONVERTABLE methods being used to convert between the two
representations. Current code does not do this. Instead, the
first [0..NUM_REGS) registers are 1:1 raw:cooked, and the type
exactly describes the register's representation. Consequently, the
Index: sh64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh64-tdep.c,v
retrieving revision 1.8
diff -u -r1.8 sh64-tdep.c
--- sh64-tdep.c 27 Sep 2003 15:51:02 -0000 1.8
+++ sh64-tdep.c 27 Sep 2003 19:51:08 -0000
@@ -2158,7 +2158,7 @@
+ REGISTER_RAW_SIZE (base_regnum) * portion));

/* We must pay attention to the endiannes. */
- sh_sh64_register_convert_to_virtual (reg_nr, REGISTER_VIRTUAL_TYPE (reg_nr),
+ sh_sh64_register_convert_to_virtual (reg_nr, DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr),
temp_buffer, buffer);

}
@@ -2228,7 +2228,7 @@
+ REGISTER_RAW_SIZE (base_regnum) * portion));

/* We must pay attention to the endiannes. */
- sh_sh64_register_convert_to_virtual (reg_nr, REGISTER_VIRTUAL_TYPE (reg_nr),
+ sh_sh64_register_convert_to_virtual (reg_nr, DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr),
temp_buffer, buffer);
}

@@ -2314,7 +2314,7 @@
{
base_regnum = dr_reg_base_num (reg_nr);
/* We must pay attention to the endiannes. */
- sh_sh64_register_convert_to_raw (REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
+ sh_sh64_register_convert_to_raw (DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
buffer, temp_buffer);

@@ -2385,7 +2385,7 @@
for (portion = 0; portion < 2; portion++)
{
/* We must pay attention to the endiannes. */
- sh_sh64_register_convert_to_raw (REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
+ sh_sh64_register_convert_to_raw (DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
buffer, temp_buffer);

regcache_raw_write (regcache, base_regnum + portion,
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 19:51:09 -0000
@@ -2032,9 +2032,9 @@
{
if (!print_all)
{
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
+ if (TYPE_CODE (DEPRECATED_REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
continue;
- if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)))
+ if (TYPE_VECTOR (DEPRECATED_REGISTER_VIRTUAL_TYPE (i)))
continue;
}
}
@@ -2063,11 +2063,11 @@

/* If virtual format is floating, print it that way, and in raw
hex. */
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
+ if (TYPE_CODE (DEPRECATED_REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
{
int j;

- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ val_print (DEPRECATED_REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
file, 0, 1, 0, Val_pretty_default);

fprintf_filtered (file, "\t(raw 0x");
@@ -2085,14 +2085,14 @@
else
{
/* Print the register in hex. */
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ val_print (DEPRECATED_REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
file, 'x', 1, 0, Val_pretty_default);
/* If not a vector register, print it also according to its
natural format. */
- if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0)
+ if (TYPE_VECTOR (DEPRECATED_REGISTER_VIRTUAL_TYPE (i)) == 0)
{
fprintf_filtered (file, "\t");
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ val_print (DEPRECATED_REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
file, 0, 1, 0, Val_pretty_default);
}
}
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 19:56:34 -0000
@@ -2778,7 +2778,7 @@
register's value.
@end deftypefn

-@deftypefn {Target Macro} struct type *REGISTER_VIRTUAL_TYPE (int @var{reg})
+@deftypefn {Target Macro} struct type *DEPRECATED_REGISTER_VIRTUAL_TYPE (int @var{reg})
This is the type of the virtual representation of register number
@var{reg}. Note that there is no need for a macro giving a type for the
register's raw form; once the register's value has been obtained, @value{GDBN}
@@ -2787,7 +2787,7 @@

@deftypefn {Target Macro} void REGISTER_CONVERT_TO_VIRTUAL (int @var{reg}, struct type *@var{type}, char *@var{from}, char *@var{to})
Convert the value of register number @var{reg} to @var{type}, which
-should always be @code{REGISTER_VIRTUAL_TYPE (@var{reg})}. The buffer
+should always be @code{DEPRECATED_REGISTER_VIRTUAL_TYPE (@var{reg})}. The buffer
at @var{from} holds the register's value in raw format; the macro should
convert the value to virtual format, and place it at @var{to}.

@@ -2802,7 +2802,7 @@

@deftypefn {Target Macro} void REGISTER_CONVERT_TO_RAW (struct type *@var{type}, int @var{reg}, char *@var{from}, char *@var{to})
Convert the value of register number @var{reg} to @var{type}, which
-should always be @code{REGISTER_VIRTUAL_TYPE (@var{reg})}. The buffer
+should always be @code{DEPRECATED_REGISTER_VIRTUAL_TYPE (@var{reg})}. The buffer
at @var{from} holds the register's value in raw format; the macro should
convert the value to virtual format, and place it at @var{to}.

@@ -3545,7 +3545,7 @@
Return the virtual size of @var{reg}.
@xref{Target Architecture Definition, , Raw and Virtual Register Representations}.

-@item REGISTER_VIRTUAL_TYPE (@var{reg})
+@item DEPRECATED_REGISTER_VIRTUAL_TYPE (@var{reg})
@findex REGISTER_VIRTUAL_TYPE
Return the virtual type of @var{reg}.
@xref{Target Architecture Definition, , Raw and Virtual Register Representations}.
@@ -3553,7 +3553,7 @@
@item struct type *register_type (@var{gdbarch}, @var{reg})
@findex register_type
If defined, return the type of register @var{reg}. This function
-superseeds @code{REGISTER_VIRTUAL_TYPE}. @xref{Target Architecture
+superseeds @code{DEPRECATED_REGISTER_VIRTUAL_TYPE}. @xref{Target Architecture
Definition, , Raw and Virtual Register Representations}.

@item REGISTER_CONVERT_TO_VIRTUAL(@var{reg}, @var{type}, @var{from}, @var{to})