* annotate.h (deprecated_annotate_starting_hook): Remove.
authorTom Tromey <tromey@redhat.com>
Mon, 28 Jul 2008 17:53:52 +0000 (17:53 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 28 Jul 2008 17:53:52 +0000 (17:53 +0000)
(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.

gdb/ChangeLog
gdb/Makefile.in
gdb/annotate.c
gdb/annotate.h
gdb/breakpoint.c
gdb/defs.h
gdb/interps.c
gdb/top.c

index a93bee8..1c0129c 100644 (file)
@@ -1,5 +1,32 @@
 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.
 
 2008-07-27  Daniel Jacobowitz  <dan@codesourcery.com>
index 312a8df..a24e29b 100644 (file)
@@ -1908,7 +1908,7 @@ amd64-tdep.o: amd64-tdep.c $(defs_h) $(arch_utils_h) $(block_h) \
        $(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) \
index 98a37ae..ed608b6 100644 (file)
@@ -23,6 +23,7 @@
 #include "target.h"
 #include "gdbtypes.h"
 #include "breakpoint.h"
+#include "observer.h"
 \f
 
 /* Prototypes for local functions. */
@@ -31,13 +32,11 @@ extern void _initialize_annotate (void);
 
 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;
 
@@ -99,28 +98,15 @@ annotate_watchpoint (int num)
 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;
@@ -131,13 +117,8 @@ annotate_stopped (void)
 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
@@ -578,7 +559,7 @@ annotate_array_section_end (void)
 }
 
 static void
-breakpoint_changed (struct breakpoint *b)
+breakpoint_changed (int bpno)
 {
   breakpoints_changed ();
 }
@@ -588,7 +569,7 @@ _initialize_annotate (void)
 {
   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);
     }
 }
index bbc274f..6fb1954 100644 (file)
@@ -99,8 +99,5 @@ extern void annotate_elt_rep_end (void);
 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);
index 3324f20..5f2404d 100644 (file)
@@ -4890,10 +4890,7 @@ mention (struct breakpoint *b)
   /* 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)
@@ -7213,8 +7210,6 @@ delete_breakpoint (struct breakpoint *bpt)
   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)
@@ -7868,8 +7863,6 @@ disable_breakpoint (struct breakpoint *bpt)
 
   update_global_location_list (0);
 
-  if (deprecated_modify_breakpoint_hook)
-    deprecated_modify_breakpoint_hook (bpt);
   observer_notify_breakpoint_modified (bpt->number);
 }
 
@@ -7993,8 +7986,6 @@ have been allocated for other watchpoints.\n"), 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);
 }
 
index 6e6aa80..cae619e 100644 (file)
@@ -1053,9 +1053,6 @@ extern int (*deprecated_query_hook) (const char *, va_list)
 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;
index 194ac62..3bb7811 100644 (file)
@@ -336,9 +336,6 @@ clear_interpreter_hooks (void)
   /*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;
index 7ef539f..7f46caf 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -246,13 +246,6 @@ void (*deprecated_readline_begin_hook) (char *, ...);
 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. */