From 0ed04cce6d6d1d4eaf7f92896c12b18bc284fe17 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 25 Aug 2002 14:44:04 +0000 Subject: 2002-08-25 Andrew Cagney * 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. --- gdb/regcache.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gdb/regcache.c') 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 -- cgit v1.1