aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/regcache.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-01-28 13:36:32 +0000
committerPedro Alves <palves@redhat.com>2011-01-28 13:36:32 +0000
commit1c79eb8a7d7126b5fcb734fb374be42a717d4373 (patch)
treeb755b132d513e73c122099d1f4ec958ad44f701c /gdb/gdbserver/regcache.h
parent85724a0e6091239d4c901a03659d5b7e8946c5c6 (diff)
downloadgdb-1c79eb8a7d7126b5fcb734fb374be42a717d4373.zip
gdb-1c79eb8a7d7126b5fcb734fb374be42a717d4373.tar.gz
gdb-1c79eb8a7d7126b5fcb734fb374be42a717d4373.tar.bz2
gdb/gdbserver/
* regcache.c (init_register_cache): Initialize regcache->register_status. (free_register_cache): Release regcache->register_status. (regcache_cpy): Copy register_status. (registers_to_string): Print 'x's for unavailable registers. (supply_register): Mark the register's status valid or unavailable, depending on whether a buffer was passed in or not. (supply_register_zeroed): New. (supply_regblock): Mark the registers' status valid or unavailable, depending on whether a buffer was passed in or not. * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines. (struct regcache): New `register_status' field. (supply_register_zeroed): Declare. * i387-fp.c (i387_xsave_to_cache): Zero out registers using supply_register_zeroed, rather than passing a NULL buffer to supply_register. * tracepoint.c (fetch_traceframe_registers): Update comment.
Diffstat (limited to 'gdb/gdbserver/regcache.h')
-rw-r--r--gdb/gdbserver/regcache.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/gdbserver/regcache.h b/gdb/gdbserver/regcache.h
index df3b261..5fe64cb 100644
--- a/gdb/gdbserver/regcache.h
+++ b/gdb/gdbserver/regcache.h
@@ -23,15 +23,31 @@
struct inferior_list_entry;
struct thread_info;
+/* The register exists, it has a value, but we don't know what it is.
+ Used when inspecting traceframes. */
+#define REG_UNAVAILABLE 0
+
+/* We know the register's value (and we have it cached). */
+#define REG_VALID 1
+
/* The data for the register cache. Note that we have one per
inferior; this is primarily for simplicity, as the performance
benefit is minimal. */
struct regcache
{
+ /* Whether the REGISTERS buffer's contents are valid. If false, we
+ haven't fetched the registers from the target yet. Not that this
+ register cache is _not_ pass-through, unlike GDB's. Note that
+ "valid" here is unrelated to whether the registers are available
+ in a traceframe. For that, check REGISTER_STATUS below. */
int registers_valid;
int registers_owned;
unsigned char *registers;
+#ifndef IN_PROCESS_AGENT
+ /* One of REG_UNAVAILBLE or REG_VALID. */
+ unsigned char *register_status;
+#endif
};
struct regcache *init_register_cache (struct regcache *regcache,
@@ -84,6 +100,8 @@ extern const char *gdbserver_xmltarget;
void supply_register (struct regcache *regcache, int n, const void *buf);
+void supply_register_zeroed (struct regcache *regcache, int n);
+
void supply_register_by_name (struct regcache *regcache,
const char *name, const void *buf);