* 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>
+
+ * 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>:
$(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) \
$(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) \
$(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)
#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);
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
{
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",
#include "gdb_assert.h"
#include "gdb_string.h"
#include "gdbcmd.h" /* For maintenanceprintlist. */
+#include "observer.h"
/*
* DATA STRUCTURE
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
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)");
#include "gdb_string.h"
#include "gdb_assert.h"
#include "cp-support.h"
+#include "observer.h"
extern int overload_debug;
/* Local functions. */
if (deprecated_register_changed_hook)
deprecated_register_changed_hook (-1);
target_changed_event ();
+ observer_notify_target_changed (¤t_target);
break;
}