summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-03-31 17:24:57 +0000
committerDaniel Jacobowitz <drow@false.org>2006-03-31 17:24:57 +0000
commite677fc13aa4a44b0f69b3fb48ae7e187f4ed33cf (patch)
tree187f83d201c0760a285c81e021f2603866a0c50b
parent37554d1e7bf15b8c0df23d9986799d17deaa3bd6 (diff)
downloadbinutils-gdb-e677fc13aa4a44b0f69b3fb48ae7e187f4ed33cf.tar.gz
Remove readonly; implement save-restore.
-rw-r--r--gdb/available.c3
-rw-r--r--gdb/available.h7
-rw-r--r--gdb/doc/gdb.texinfo5
-rw-r--r--gdb/features/gdb-target.dtd5
-rw-r--r--gdb/parse-avail.c12
5 files changed, 8 insertions, 24 deletions
diff --git a/gdb/available.c b/gdb/available.c
index 4087e13466b..e30a776a8c5 100644
--- a/gdb/available.c
+++ b/gdb/available.c
@@ -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);
}
diff --git a/gdb/available.h b/gdb/available.h
index d437c752e70..ad756b5af4f 100644
--- a/gdb/available.h
+++ b/gdb/available.h
@@ -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
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index b7eec5d73ec..d79933a1511 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -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
diff --git a/gdb/features/gdb-target.dtd b/gdb/features/gdb-target.dtd
index 54db394c4bf..6e01b703fcf 100644
--- a/gdb/features/gdb-target.dtd
+++ b/gdb/features/gdb-target.dtd
@@ -36,13 +36,14 @@
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
diff --git a/gdb/parse-avail.c b/gdb/parse-avail.c
index b20e3ae0e36..b751e00d3dd 100644
--- a/gdb/parse-avail.c
+++ b/gdb/parse-avail.c
@@ -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)