aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-08-25 14:44:04 +0000
committerAndrew Cagney <cagney@redhat.com>2002-08-25 14:44:04 +0000
commit0ed04cce6d6d1d4eaf7f92896c12b18bc284fe17 (patch)
tree495947a5f6bc8b3aa9df30ad5bad7fa3c5c539ec /gdb/regcache.c
parent46d8b1c3257be46d519b2642615fbc232368afc1 (diff)
downloadgdb-0ed04cce6d6d1d4eaf7f92896c12b18bc284fe17.zip
gdb-0ed04cce6d6d1d4eaf7f92896c12b18bc284fe17.tar.gz
gdb-0ed04cce6d6d1d4eaf7f92896c12b18bc284fe17.tar.bz2
2002-08-25 Andrew Cagney <ac131313@redhat.com>
* regcache.c (max_register_size): New function. (init_legacy_regcache_descr): Ensure that max_register_size is large enough for REGISTER_VIRTUAL_SIZE. * regcache.h (max_register_size): Declare.
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 e483de0..384df40 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -112,6 +112,8 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch)
descr->sizeof_register[i] = REGISTER_RAW_SIZE (i);
if (descr->max_register_size < REGISTER_RAW_SIZE (i))
descr->max_register_size = REGISTER_RAW_SIZE (i);
+ if (descr->max_register_size < REGISTER_VIRTUAL_SIZE (i))
+ descr->max_register_size = REGISTER_VIRTUAL_SIZE (i);
}
/* Come up with the real size of the registers buffer. */
@@ -239,6 +241,16 @@ xfree_regcache_descr (struct gdbarch *gdbarch, void *ptr)
xfree (descr);
}
+/* Utility functions returning useful register attributes stored in
+ the regcache descr. */
+
+int
+max_register_size (struct gdbarch *gdbarch)
+{
+ struct regcache_descr *descr = regcache_descr (gdbarch);
+ return descr->max_register_size;
+}
+
/* The register cache for storing raw register values. */
struct regcache