diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-02-28 17:47:43 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-02-28 17:47:43 +0000 |
commit | 08a617dae28e205427036f542e07aef63c51c914 (patch) | |
tree | 23848a8da57b2e6c88c14518b580f22cbe05dd62 /gdb/regcache.h | |
parent | 4224873a5a61550c3fbdd2aed7b3882ec04928ef (diff) | |
download | gdb-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.h')
-rw-r--r-- | gdb/regcache.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h index 8dfd2e9..ee10505 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 |