summaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-02-28 17:47:43 +0000
committerAndrew Cagney <cagney@redhat.com>2003-02-28 17:47:43 +0000
commit5eadad1d0c4301cafe30a8fcd78d711230b3f1d3 (patch)
tree7f91d77987fb4084f5921230ca2870b1116885ef /gdb/regcache.c
parent3676d4a498d506aa9173e9da3755a44b92546e69 (diff)
downloadgdb-5eadad1d0c4301cafe30a8fcd78d711230b3f1d3.tar.gz
2003-02-28 Andrew Cagney <cagney@redhat.com>
* regcache.c (register_size): New function. * regcache.h (register_size): Declare * d10v-tdep.c: Use register_size instead of REGISTER_RAW_SIZE, use max_register_size instead of MAX_REGISTER_RAW_SIZE.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 1bbdb61b95f..b84020e073b 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -285,6 +285,18 @@ max_register_size (struct gdbarch *gdbarch)
return descr->max_register_size;
}
+int
+register_size (struct gdbarch *gdbarch, int regnum)
+{
+ struct regcache_descr *descr = regcache_descr (gdbarch);
+ int size;
+ gdb_assert (regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS));
+ size = descr->sizeof_register[regnum];
+ gdb_assert (size == REGISTER_RAW_SIZE (regnum)); /* OK */
+ gdb_assert (size == REGISTER_RAW_SIZE (regnum)); /* OK */
+ return size;
+}
+
/* The register cache for storing raw register values. */
struct regcache