summaryrefslogtreecommitdiff
path: root/gdb/regcache.h
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.h
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.h')
-rw-r--r--gdb/regcache.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 8dfd2e92633..ee105053605 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -129,6 +129,32 @@ extern struct type *register_type (struct gdbarch *gdbarch, int regnum);
extern int max_register_size (struct gdbarch *gdbarch);
+/* Return the size of register REGNUM. All registers should have only
+ one size.
+
+ FIXME: cagney/2003-02-28:
+
+ Unfortunatly, thanks to some legacy architectures, this doesn't
+ hold. A register's cooked (nee virtual) and raw size can differ
+ (see MIPS). Such architectures should be using different register
+ numbers for the different sized views of identical registers.
+
+ Anyway, the up-shot is that, until that mess is fixed, core code
+ can end up being very confused - should the RAW or VIRTUAL size be
+ used? As a rule of thumb, use REGISTER_VIRTUAL_SIZE in cooked
+ code, but with the comment:
+
+ OK: REGISTER_VIRTUAL_SIZE
+
+ or just
+
+ OK
+
+ appended to the end of the line. */
+
+extern int register_size (struct gdbarch *gdbarch, int regnum);
+
+
/* Save/restore a register cache. The registers saved/restored is
determined by the save_reggroup and restore_reggroup (although you
can't restore a register that wasn't saved as well :-). You can