summaryrefslogtreecommitdiff
path: root/gdb/regcache.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-11-13 17:59:40 +0000
committerAndrew Cagney <cagney@redhat.com>2002-11-13 17:59:40 +0000
commitf8f1fcefaac56a81f52bbc743c20b6e15999ac10 (patch)
tree495cd1b37a2fff2a04a4e670e88a65acc292eafe /gdb/regcache.h
parent8870584e7e2fc5a3c87b2474d5bd8ea916081b9c (diff)
downloadgdb-f8f1fcefaac56a81f52bbc743c20b6e15999ac10.tar.gz
2002-11-13 Andrew Cagney <cagney@redhat.com>
* regcache.c (struct regcache): Replace passthough_p with readonly_p. (regcache_xmalloc): Initialize readonly_p. (build_regcache): Initialize readonly_p. (regcache_save): New function. (regcache_restore): New function. (regcache_cpy): Re-implement using regcache_save and regcache_restore. (regcache_raw_read): Update. (regcache_cooked_read): When a read-only cache, checked for cached pseudo register values. (regcache_raw_write): Assert that the cache is not read-only. Remove code handling a non-passthrough cache. * regcache.h (regcache_save): Declare. (regcache_restore): Declare.
Diffstat (limited to 'gdb/regcache.h')
-rw-r--r--gdb/regcache.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h
index ad70298a6b9..a1ea2fadfb5 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -134,6 +134,16 @@ extern int max_register_size (struct gdbarch *gdbarch);
extern char *registers;
+/* 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);
+
/* Copy/duplicate the contents of a register cache. By default, the
operation is pass-through. Writes to DST and reads from SRC will
go through to the target.