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 | |
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).
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/Makefile.in | 6 | ||||
-rw-r--r-- | gdb/frame.c | 11 | ||||
-rw-r--r-- | gdb/regcache.c | 11 | ||||
-rw-r--r-- | gdb/valops.c | 2 |
5 files changed, 39 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ccc04d2..2b85455 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,17 @@ 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). + +2004-04-26 Orjan Friberg <orjanf@axis.com> + From Paul Koning <pkoning@equallogic.com>: * breakpoint.c (free_valchain): New function. (insert_bp_location, delete_breakpoint): Use free_valchain. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 2e8944e..0262409 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1775,7 +1775,7 @@ frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \ $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(user_regs_h) \ $(gdb_obstack_h) $(dummy_frame_h) $(sentinel_frame_h) $(gdbcore_h) \ $(annotate_h) $(language_h) $(frame_unwind_h) $(frame_base_h) \ - $(command_h) $(gdbcmd_h) + $(command_h) $(gdbcmd_h) $(observer_h) frame-unwind.o: frame-unwind.c $(defs_h) $(frame_h) $(frame_unwind_h) \ $(gdb_assert_h) $(dummy_frame_h) $(gdb_obstack_h) frv-linux-tdep.o: frv-linux-tdep.c $(defs_h) $(target_h) $(frame_h) \ @@ -2190,7 +2190,7 @@ p-valprint.o: p-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ $(language_h) $(target_h) $(annotate_h) $(p_lang_h) $(cp_abi_h) regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(gdbarch_h) \ $(gdbcmd_h) $(regcache_h) $(reggroups_h) $(gdb_assert_h) \ - $(gdb_string_h) $(gdbcmd_h) + $(gdb_string_h) $(gdbcmd_h) $(observer_h) reggroups.o: reggroups.c $(defs_h) $(reggroups_h) $(gdbtypes_h) \ $(gdb_assert_h) $(regcache_h) $(command_h) $(gdbcmd_h) remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \ @@ -2493,7 +2493,7 @@ valops.o: valops.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) $(frame_h) \ $(inferior_h) $(gdbcore_h) $(target_h) $(demangle_h) $(language_h) \ $(gdbcmd_h) $(regcache_h) $(cp_abi_h) $(block_h) $(infcall_h) \ $(dictionary_h) $(cp_support_h) $(gdb_string_h) $(gdb_assert_h) \ - $(cp_support_h) + $(cp_support_h) $(observer_h) valprint.o: valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(language_h) \ $(annotate_h) $(valprint_h) $(floatformat_h) $(doublest_h) diff --git a/gdb/frame.c b/gdb/frame.c index f9384fe..bdb6cb9 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -39,6 +39,7 @@ #include "frame-base.h" #include "command.h" #include "gdbcmd.h" +#include "observer.h" static struct frame_info *get_prev_frame_1 (struct frame_info *this_frame); @@ -1237,6 +1238,14 @@ get_next_frame (struct frame_info *this_frame) return NULL; } +/* Observer for the target_changed event. */ + +void +frame_observer_target_changed (struct target_ops *target) +{ + flush_cached_frames (); +} + /* Flush the entire frame cache. */ void @@ -2356,6 +2365,8 @@ _initialize_frame (void) { obstack_init (&frame_cache_obstack); + observer_attach_target_changed (frame_observer_target_changed); + add_prefix_cmd ("backtrace", class_maintenance, set_backtrace_cmd, "\ Set backtrace specific variables.\n\ Configure backtrace variables such as the backtrace limit", 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)"); diff --git a/gdb/valops.c b/gdb/valops.c index be7dec5..5ab4149 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -42,6 +42,7 @@ #include "gdb_string.h" #include "gdb_assert.h" #include "cp-support.h" +#include "observer.h" extern int overload_debug; /* Local functions. */ @@ -701,6 +702,7 @@ value_assign (struct value *toval, struct value *fromval) if (deprecated_register_changed_hook) deprecated_register_changed_hook (-1); target_changed_event (); + observer_notify_target_changed (¤t_target); break; } |