]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* tui/tui-hooks.c (tui_about_to_proceed): New function.
authorStephane Carrez <stcarrez@nerim.fr>
Thu, 8 Nov 2012 22:54:11 +0000 (22:54 +0000)
committerStephane Carrez <stcarrez@nerim.fr>
Thu, 8 Nov 2012 22:54:11 +0000 (22:54 +0000)
  (tui_target_wait_hook): Remove.
  (tui_install_hooks): Install the about_to_proceed observer.
  (tui_remove_hooks): And remove it here.

gdb/ChangeLog
gdb/tui/tui-hooks.c

index 5a2260bc4c239e4e5fa20dc96058ed15e2c85e62..a74797addbb56c262967625833ce2e0c462e91fd 100644 (file)
@@ -1,3 +1,10 @@
+2012-11-08  Stephane Carrez  <Stephane.Carrez@gmail.com>
+
+       * tui/tui-hooks.c (tui_about_to_proceed): New function.
+       (tui_target_wait_hook): Remove.
+       (tui_install_hooks): Install the about_to_proceed observer.
+       (tui_remove_hooks): And remove it here.
+
 2012-11-08  Tom Tromey  <tromey@redhat.com>
 
        * linux-tdep.c (linux_make_siginfo_note): New function.
index 1a415d162566b88dea2430a36f03cf8c2fd8efa2..310b9edfd60225abe13fc686e46488cb250210a5 100644 (file)
@@ -164,14 +164,11 @@ tui_event_modify_breakpoint (struct breakpoint *b)
   tui_update_all_breakpoint_info ();
 }
 
-/* Called when going to wait for the target.
-   Leave curses mode and setup program mode.  */
-static ptid_t
-tui_target_wait_hook (ptid_t pid, 
-                     struct target_waitstatus *status, int options)
-{
-  ptid_t res;
+/* Called when a command is about to proceed the inferior.  */
 
+static void
+tui_about_to_proceed (void)
+{
   /* Leave tui mode (optional).  */
 #if 0
   if (tui_active)
@@ -182,13 +179,6 @@ tui_target_wait_hook (ptid_t pid,
     }
 #endif
   tui_target_has_run = 1;
-  res = target_wait (pid, status, options);
-
-  if (tui_active)
-    {
-      /* TODO: need to refresh (optional).  */
-    }
-  return res;
 }
 
 /* The selected frame has changed.  This is happens after a target
@@ -262,12 +252,12 @@ static struct observer *tui_bp_created_observer;
 static struct observer *tui_bp_deleted_observer;
 static struct observer *tui_bp_modified_observer;
 static struct observer *tui_inferior_exit_observer;
+static struct observer *tui_about_to_proceed_observer;
 
 /* Install the TUI specific hooks.  */
 void
 tui_install_hooks (void)
 {
-  deprecated_target_wait_hook = tui_target_wait_hook;
   deprecated_selected_frame_level_changed_hook
     = tui_selected_frame_level_changed_hook;
   deprecated_print_frame_info_listing_hook
@@ -284,6 +274,8 @@ tui_install_hooks (void)
     = observer_attach_breakpoint_modified (tui_event_modify_breakpoint);
   tui_inferior_exit_observer
     = observer_attach_inferior_exit (tui_inferior_exit);
+  tui_about_to_proceed_observer
+    = observer_attach_about_to_proceed (tui_about_to_proceed);
 
   deprecated_register_changed_hook = tui_register_changed_hook;
 }
@@ -292,7 +284,6 @@ tui_install_hooks (void)
 void
 tui_remove_hooks (void)
 {
-  deprecated_target_wait_hook = 0;
   deprecated_selected_frame_level_changed_hook = 0;
   deprecated_print_frame_info_listing_hook = 0;
   deprecated_query_hook = 0;
@@ -307,6 +298,8 @@ tui_remove_hooks (void)
   tui_bp_modified_observer = NULL;
   observer_detach_inferior_exit (tui_inferior_exit_observer);
   tui_inferior_exit_observer = NULL;
+  observer_detach_about_to_proceed (tui_about_to_proceed_observer);
+  tui_about_to_proceed_observer = NULL;
 }
 
 void _initialize_tui_hooks (void);