diff options
author | Orjan Friberg <orjanf@axis.com> | 2004-04-26 09:49:36 +0000 |
---|---|---|
committer | Orjan Friberg <orjanf@axis.com> | 2004-04-26 09:49:36 +0000 |
commit | f4c5303c32d8fda229d182d9d7db4ceb64bf9e02 (patch) | |
tree | 1019d06d4acf0538f5f116d80bcfd0c9f867d287 /gdb/regcache.c | |
parent | 79346bcbc0a0cc4086e810f116a1fcd39c7cd2ef (diff) | |
download | gdb-f4c5303c32d8fda229d182d9d7db4ceb64bf9e02.zip gdb-f4c5303c32d8fda229d182d9d7db4ceb64bf9e02.tar.gz gdb-f4c5303c32d8fda229d182d9d7db4ceb64bf9e02.tar.bz2 |
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.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c index 91204b8..e775e4d 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)"); |