aboutsummaryrefslogtreecommitdiff
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
commit08a617dae28e205427036f542e07aef63c51c914 (patch)
tree23848a8da57b2e6c88c14518b580f22cbe05dd62 /gdb/regcache.c
parent4224873a5a61550c3fbdd2aed7b3882ec04928ef (diff)
downloadgdb-08a617dae28e205427036f542e07aef63c51c914.zip
gdb-08a617dae28e205427036f542e07aef63c51c914.tar.gz
gdb-08a617dae28e205427036f542e07aef63c51c914.tar.bz2
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 1bbdb61..b84020e 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