diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-03-10 19:08:47 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-03-10 19:08:47 +0000 |
commit | 5602984a0d461c4205399048c0f4b3f24ae5fc24 (patch) | |
tree | 47acc3d494d1c467b604b241ca95fbcc7a48ccc5 /gdb/regcache.h | |
parent | 0ce1b11887569538cfd0c25c917b64cd9dabccee (diff) | |
download | gdb-5602984a0d461c4205399048c0f4b3f24ae5fc24.zip gdb-5602984a0d461c4205399048c0f4b3f24ae5fc24.tar.gz gdb-5602984a0d461c4205399048c0f4b3f24ae5fc24.tar.bz2 |
2003-03-10 Andrew Cagney <cagney@redhat.com>
* regcache.h (regcache_cooked_read_ftype): Define.
(regcache_save, regcache_restore): Add a cooked_read parameter.
* regcache.c (regcache_save, regcache_restore): Update.
(do_cooked_read): New function.
(regcache_cpy): Pass do_cooked_read to regcache_save and
regcache_restore.
Diffstat (limited to 'gdb/regcache.h')
-rw-r--r-- | gdb/regcache.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h index ee10505..dd62938 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -155,15 +155,19 @@ extern int max_register_size (struct gdbarch *gdbarch); 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 - only save to a read-only cache (default from regcache_xmalloc()) - from a live cache and you can only restore from a read-only cache - to a live cache. */ - -extern void regcache_save (struct regcache *dst, struct regcache *src); -extern void regcache_restore (struct regcache *dst, struct regcache *src); +/* Save/restore a register cache. The set of registers saved / + restored into the DST regcache determined by the save_reggroup / + restore_reggroup respectively. COOKED_READ returns zero iff the + register's value can't be returned. */ + +typedef int (regcache_cooked_read_ftype) (void *src, int regnum, void *buf); + +extern void regcache_save (struct regcache *dst, + regcache_cooked_read_ftype *cooked_read, + void *src); +extern void regcache_restore (struct regcache *dst, + regcache_cooked_read_ftype *cooked_read, + void *src); /* Copy/duplicate the contents of a register cache. By default, the operation is pass-through. Writes to DST and reads from SRC will |