aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-03-01 17:59:12 +0000
committerAndrew Cagney <cagney@redhat.com>2003-03-01 17:59:12 +0000
commit35cac7cfea5ce05bfb0516b9ca11e3cf6561c1d4 (patch)
treefd02efded8c8c4461b78a7a556fc594e0bc60194 /gdb/regcache.c
parent7b83296f2249f4252acecdc5af64595d66daadbd (diff)
downloadgdb-35cac7cfea5ce05bfb0516b9ca11e3cf6561c1d4.zip
gdb-35cac7cfea5ce05bfb0516b9ca11e3cf6561c1d4.tar.gz
gdb-35cac7cfea5ce05bfb0516b9ca11e3cf6561c1d4.tar.bz2
2003-03-01 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (register_type): New function with predicate. (REGISTER_VIRTUAL_TYPE): Change to function with predicate. * gdbarch.h, gdbarch.c: Re-generate. * arch-utils.c (generic_register_byte): Use generic_register_size. (generic_register_size): When available, use gdbarch_register_type. * regcache.c (init_regcache_descr): When available, initialize the register type array using gdbarch_register_type. If the architecture supplies gdbarch_register_type, do not use the legacy regcache layout. * d10v-tdep.c (d10v_register_type): Replace d10v_register_virtual_type. (d10v_gdbarch_init): Set register_type instead of register_virtual_type.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index b84020e..871af1f 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -172,13 +172,20 @@ init_regcache_descr (struct gdbarch *gdbarch)
struct type *);
for (i = 0; i < descr->nr_cooked_registers; i++)
{
- descr->register_type[i] = REGISTER_VIRTUAL_TYPE (i);
+ if (gdbarch_register_type_p (gdbarch))
+ {
+ gdb_assert (!REGISTER_VIRTUAL_TYPE_P ()); /* OK */
+ descr->register_type[i] = gdbarch_register_type (gdbarch, i);
+ }
+ else
+ descr->register_type[i] = REGISTER_VIRTUAL_TYPE (i); /* OK */
}
/* If an old style architecture, fill in the remainder of the
register cache descriptor using the register macros. */
if (!gdbarch_pseudo_register_read_p (gdbarch)
- && !gdbarch_pseudo_register_write_p (gdbarch))
+ && !gdbarch_pseudo_register_write_p (gdbarch)
+ && !gdbarch_register_type_p (gdbarch))
{
descr->legacy_p = 1;
init_legacy_regcache_descr (gdbarch, descr);