(deprecated_annotate_stopped_hook): Remove.
(deprecated_annotate_exited_hook): Remove.
* Makefile.in (annotate.o): Depend on observer_h.
* top.c (deprecated_delete_breakpoint_hook): Remove.
(deprecated_create_breakpoint_hook): Likewise.
(deprecated_modify_breakpoint_hook): Likewise.
* interps.c (clear_interpreter_hooks): Update for removed hooks.
* breakpoint.c (mention): Don't call removed hook.
(delete_breakpoint): Likewise.
(disable_breakpoint): Likewise.
(do_enable_breakpoint): Likewise.
* annotate.c: Include observer.h.
(breakpoint_changed): Change type of argument.
(_initialize_annotate): Register observers.
(deprecated_annotate_starting_hook): Remove.
(deprecated_annotate_stopped_hook): Remove.
(deprecated_annotate_exited_hook): Remove.
(annotate_starting): Update for hook removal.
(annotate_stopped): Likewise.
(annotate_exited): Likewise.
* defs.h (deprecated_delete_breakpoint_hook): Remove.
(deprecated_create_breakpoint_hook): Likewise.
(deprecated_modify_breakpoint_hook): Likewise.
+2008-07-28 Tom Tromey <tromey@redhat.com>
+
+ * annotate.h (deprecated_annotate_starting_hook): Remove.
+ (deprecated_annotate_stopped_hook): Remove.
+ (deprecated_annotate_exited_hook): Remove.
+ * Makefile.in (annotate.o): Depend on observer_h.
+ * top.c (deprecated_delete_breakpoint_hook): Remove.
+ (deprecated_create_breakpoint_hook): Likewise.
+ (deprecated_modify_breakpoint_hook): Likewise.
+ * interps.c (clear_interpreter_hooks): Update for removed hooks.
+ * breakpoint.c (mention): Don't call removed hook.
+ (delete_breakpoint): Likewise.
+ (disable_breakpoint): Likewise.
+ (do_enable_breakpoint): Likewise.
+ * annotate.c: Include observer.h.
+ (breakpoint_changed): Change type of argument.
+ (_initialize_annotate): Register observers.
+ (deprecated_annotate_starting_hook): Remove.
+ (deprecated_annotate_stopped_hook): Remove.
+ (deprecated_annotate_exited_hook): Remove.
+ (annotate_starting): Update for hook removal.
+ (annotate_stopped): Likewise.
+ (annotate_exited): Likewise.
+ * defs.h (deprecated_delete_breakpoint_hook): Remove.
+ (deprecated_create_breakpoint_hook): Likewise.
+ (deprecated_modify_breakpoint_hook): Likewise.
+
2008-07-28 Tom Tromey <tromey@redhat.com>
* main.c (captured_main): Don't use BEFORE_MAIN_LOOP_HOOK.
$(regset_h) $(symfile_h) $(gdb_assert_h) $(amd64_tdep_h) \
$(i387_tdep_h)
annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \
- $(gdbtypes_h) $(breakpoint_h)
+ $(gdbtypes_h) $(breakpoint_h) $(observer_h)
arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(buildsym_h) \
$(gdbcmd_h) $(inferior_h) $(gdb_string_h) $(regcache_h) \
$(gdb_assert_h) $(sim_regno_h) $(gdbcore_h) $(osabi_h) $(version_h) \
#include "target.h"
#include "gdbtypes.h"
#include "breakpoint.h"
+#include "observer.h"
\f
/* Prototypes for local functions. */
static void print_value_flags (struct type *);
-static void breakpoint_changed (struct breakpoint *);
+static void breakpoint_changed (int);
+
-void (*deprecated_annotate_starting_hook) (void);
-void (*deprecated_annotate_stopped_hook) (void);
void (*deprecated_annotate_signalled_hook) (void);
void (*deprecated_annotate_signal_hook) (void);
-void (*deprecated_annotate_exited_hook) (void);
static int ignore_count_changed = 0;
void
annotate_starting (void)
{
-
- if (deprecated_annotate_starting_hook)
- deprecated_annotate_starting_hook ();
- else
- {
- if (annotation_level > 1)
- {
- printf_filtered (("\n\032\032starting\n"));
- }
- }
+ if (annotation_level > 1)
+ printf_filtered (("\n\032\032starting\n"));
}
void
annotate_stopped (void)
{
- if (deprecated_annotate_stopped_hook)
- deprecated_annotate_stopped_hook ();
- else
- {
- if (annotation_level > 1)
- printf_filtered (("\n\032\032stopped\n"));
- }
+ if (annotation_level > 1)
+ printf_filtered (("\n\032\032stopped\n"));
if (annotation_level > 1 && ignore_count_changed)
{
ignore_count_changed = 0;
void
annotate_exited (int exitstatus)
{
- if (deprecated_annotate_exited_hook)
- deprecated_annotate_exited_hook ();
- else
- {
- if (annotation_level > 1)
- printf_filtered (("\n\032\032exited %d\n"), exitstatus);
- }
+ if (annotation_level > 1)
+ printf_filtered (("\n\032\032exited %d\n"), exitstatus);
}
void
}
static void
-breakpoint_changed (struct breakpoint *b)
+breakpoint_changed (int bpno)
{
breakpoints_changed ();
}
{
if (annotation_level == 2)
{
- deprecated_delete_breakpoint_hook = breakpoint_changed;
- deprecated_modify_breakpoint_hook = breakpoint_changed;
+ observer_attach_breakpoint_deleted (breakpoint_changed);
+ observer_attach_breakpoint_modified (breakpoint_changed);
}
}
extern void annotate_elt (void);
extern void annotate_array_section_end (void);
-extern void (*deprecated_annotate_starting_hook) (void);
-extern void (*deprecated_annotate_stopped_hook) (void);
extern void (*deprecated_annotate_signalled_hook) (void);
extern void (*deprecated_annotate_signal_hook) (void);
-extern void (*deprecated_annotate_exited_hook) (void);
/* FIXME: This is misplaced; mention() is called by things (like
hitting a watchpoint) other than breakpoint creation. It should
be possible to clean this up and at the same time replace the
- random calls to breakpoint_changed with this hook, as has already
- been done for deprecated_delete_breakpoint_hook and so on. */
- if (deprecated_create_breakpoint_hook)
- deprecated_create_breakpoint_hook (b);
+ random calls to breakpoint_changed with this hook. */
observer_notify_breakpoint_created (b->number);
if (b->ops != NULL && b->ops->print_mention != NULL)
if (bpt->type == bp_none)
return;
- if (deprecated_delete_breakpoint_hook)
- deprecated_delete_breakpoint_hook (bpt);
observer_notify_breakpoint_deleted (bpt->number);
if (breakpoint_chain == bpt)
update_global_location_list (0);
- if (deprecated_modify_breakpoint_hook)
- deprecated_modify_breakpoint_hook (bpt);
observer_notify_breakpoint_modified (bpt->number);
}
update_global_location_list (1);
breakpoints_changed ();
- if (deprecated_modify_breakpoint_hook)
- deprecated_modify_breakpoint_hook (bpt);
observer_notify_breakpoint_modified (bpt->number);
}
extern void (*deprecated_warning_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
extern void (*deprecated_flush_hook) (struct ui_file * stream);
-extern void (*deprecated_create_breakpoint_hook) (struct breakpoint * b);
-extern void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt);
-extern void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt);
extern void (*deprecated_interactive_hook) (void);
extern void (*deprecated_readline_begin_hook) (char *, ...)
ATTRIBUTE_FPTR_PRINTF_1;
/*print_frame_more_info_hook = 0; */
deprecated_query_hook = 0;
deprecated_warning_hook = 0;
- deprecated_create_breakpoint_hook = 0;
- deprecated_delete_breakpoint_hook = 0;
- deprecated_modify_breakpoint_hook = 0;
deprecated_interactive_hook = 0;
deprecated_readline_begin_hook = 0;
deprecated_readline_hook = 0;
char *(*deprecated_readline_hook) (char *);
void (*deprecated_readline_end_hook) (void);
-/* Called as appropriate to notify the interface of the specified breakpoint
- conditions. */
-
-void (*deprecated_create_breakpoint_hook) (struct breakpoint * bpt);
-void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt);
-void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt);
-
/* Called as appropriate to notify the interface that we have attached
to or detached from an already running process. */