]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove readonly; implement save-restore.
authorDaniel Jacobowitz <drow@false.org>
Fri, 31 Mar 2006 17:24:57 +0000 (17:24 +0000)
committerDaniel Jacobowitz <drow@false.org>
Fri, 31 Mar 2006 17:24:57 +0000 (17:24 +0000)
gdb/available.c
gdb/available.h
gdb/doc/gdb.texinfo
gdb/features/gdb-target.dtd
gdb/parse-avail.c

index 4087e13466b176f8aaa43973245053b7dea08e32..e30a776a8c5447af59355306516509a455850122 100644 (file)
@@ -717,5 +717,8 @@ available_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
        return general_p;
     }
 
+  if (reg != NULL && (group == save_reggroup || group == restore_reggroup))
+    return reg->save_restore;
+
   return default_register_reggroup_p (gdbarch, regnum, reggroup);
 }
index d437c752e70bd67d8ded61756c00804ca8fa01a4..ad756b5af4f9debfaf8a5b6db78a37e2ab9d4db5 100644 (file)
@@ -95,15 +95,8 @@ struct gdb_available_register
      This is a NUL-terminated string.  */
   const char *arch_data;
 
-  /* If this flag is set, GDB should never try to write to this
-     register.  Otherwise, the user may modify the value in the
-     register.  */
-  int readonly;
-
   /* If this flag is set, GDB should save and restore this register
      around calls to an inferior function.  */
-  /* FIXME: Richard Earnshaw proposed an alternate, more thourough
-     categorization.  Should we use that instead?  */
   int save_restore;
 
   /* The name of the register group containing this register.  If this
index b7eec5d73ec3d4aaf8cd2040bb78769c2e2c4d0f..d79933a151180c957d5b7628d51e12145d641e86 100644 (file)
@@ -24992,7 +24992,6 @@ Each @var{reg} has the form:
 <reg name="@var{name}"
      bitsize="@var{size}"
      @r{[}regnum="@var{num}"@r{]}
-     @r{[}readonly="@var{read-only}"@r{]}
      @r{[}save-restore="@var{save-restore}"@r{]}
      @r{[}type="@var{type}"@r{]}
      @r{[}group="@var{group}"@r{]}/>
@@ -25016,10 +25015,6 @@ defaults to zero.  But also see the @code{feature-ref} element's
 @code{base-regnum} attribute, below---these register numbers are relative
 to the @code{base-regnum}.
 
-@item readonly
-Whether the register is read-only or not; this must be either
-@code{yes} or @code{no}.  The default is @code{no}.
-
 @item save-restore
 Whether the register should be preserved across inferior function
 calls; this must be either @code{yes} or @code{no}.  The default is
index 54db394c4bf58feed14182f6cc4d23f68a203c1e..6e01b703fcf69a42eb4cde811eeeab231fdb4826 100644 (file)
      sequential number by default.  When the feature is referenced, register
      numbers are adjusted by the reference's base-regnum.  -->
 <!-- arch_data; see above -->
-<!-- Kill save-restore in favor of a more complete scheme -->
+<!-- TODO: Allow save-restore default to be specified by the feature?
+     Computation coprocessors should generally be saved and restored,
+     but system control coprocessors generally shouldn't.  -->
 <!ELEMENT reg          (description*)>
 <!ATTLIST reg
        name            CDATA   #REQUIRED
        bitsize         CDATA   #REQUIRED
        regnum          CDATA   #IMPLIED
-       readonly        (yes | no) 'no'
        save-restore    (yes | no) 'yes'
        type            CDATA   'int'
        group           CDATA   #IMPLIED
index b20e3ae0e36229681bdd70d69a09120c4fdb3985..b751e00d3dd2836943affd5fe8187d99ccbdbac6 100644 (file)
@@ -267,7 +267,6 @@ xml_start_reg (struct xml_feature_parse_data *data,
   reg->gdb_regnum = -1;
   reg->protocol_number = -1;
   reg->bitsize = -1;
-  reg->readonly = -1;
   reg->save_restore = -1;
 
   for (p = attrs; *p; p += 2)
@@ -299,12 +298,6 @@ xml_start_reg (struct xml_feature_parse_data *data,
       else if (strcmp (name, "group") == 0)
        reg->group = obstrdup (data->obstack, val);
 
-      else if (strcmp (name, "readonly") == 0)
-       {
-         if (xml_parse_one_boolean (val, &reg->readonly) < 0)
-           data->unhandled++;
-       }
-
       else if (strcmp (name, "save-restore") == 0)
        {
          if (xml_parse_one_boolean (val, &reg->save_restore) < 0)
@@ -316,9 +309,8 @@ xml_start_reg (struct xml_feature_parse_data *data,
     }
 
   /* Fill in optional fields with defaults.  */
-  /* FIXME: If we always provide the DTD, we don't need to do this.  */
-  if (reg->readonly == -1)
-    reg->readonly = 0;
+  /* FIXME: Now that we always provide the DTD, we may not need to do
+     this; that would make these into internal errors.  */
   if (reg->save_restore == -1)
     reg->save_restore = 1;
   if (reg->type == NULL)