return general_p;
}
+ if (reg != NULL && (group == save_reggroup || group == restore_reggroup))
+ return reg->save_restore;
+
return default_register_reggroup_p (gdbarch, regnum, reggroup);
}
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
<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{]}/>
@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
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
reg->gdb_regnum = -1;
reg->protocol_number = -1;
reg->bitsize = -1;
- reg->readonly = -1;
reg->save_restore = -1;
for (p = attrs; *p; p += 2)
else if (strcmp (name, "group") == 0)
reg->group = obstrdup (data->obstack, val);
- else if (strcmp (name, "readonly") == 0)
- {
- if (xml_parse_one_boolean (val, ®->readonly) < 0)
- data->unhandled++;
- }
-
else if (strcmp (name, "save-restore") == 0)
{
if (xml_parse_one_boolean (val, ®->save_restore) < 0)
}
/* 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)