summaryrefslogtreecommitdiff
path: root/gdb/frame.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/frame.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/frame.c')
-rw-r--r--gdb/frame.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index f9384fe5d54..bdb6cb9221c 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",