summaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorOrjan Friberg <orjanf@axis.com>2004-04-26 09:49:36 +0000
committerOrjan Friberg <orjanf@axis.com>2004-04-26 09:49:36 +0000
commit4cc64c97479435e007ff50e4bb63575f28625557 (patch)
treec739d3a847ac9eb5cd97593ec7e9c66268431cd8 /gdb/regcache.c
parentb8a2996cc03d05a599c6c2a39d80645e9933440a (diff)
downloadgdb-4cc64c97479435e007ff50e4bb63575f28625557.tar.gz
2004-04-26 Orjan Friberg <orjanf@axis.com>
* frame.c: Include "observer.h". (frame_observer_target_changed): New function. (_initialize_frame): Attach target_changed observer. * regcache.c: Include "observer.h". (regcache_observer_target_changed): New function. (_initialize_regcache): Attach target_changed observer. * valops.c: Include "observer.h". (value_assign): Notify target_changed event when modifying register. * Makefile.in (frame.o, regcache.o, valops.o): Add $(observer_h).
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 91204b8e9a4..e775e4d8c24 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -30,6 +30,7 @@
#include "gdb_assert.h"
#include "gdb_string.h"
#include "gdbcmd.h" /* For maintenanceprintlist. */
+#include "observer.h"
/*
* DATA STRUCTURE
@@ -566,6 +567,14 @@ real_register (int regnum)
return regnum >= 0 && regnum < NUM_REGS;
}
+/* Observer for the target_changed event. */
+
+void
+regcache_observer_target_changed (struct target_ops *target)
+{
+ registers_changed ();
+}
+
/* Low level examining and depositing of registers.
The caller is responsible for making sure that the inferior is
@@ -1697,6 +1706,8 @@ _initialize_regcache (void)
DEPRECATED_REGISTER_GDBARCH_SWAP (deprecated_register_valid);
deprecated_register_gdbarch_swap (NULL, 0, build_regcache);
+ observer_attach_target_changed (regcache_observer_target_changed);
+
add_com ("flushregs", class_maintenance, reg_flush_command,
"Force gdb to flush its register cache (maintainer command)");