* defs.h (do_exec_error_cleanups, discard_exec_error_cleanups)
authorVladimir Prus <vladimir@codesourcery.com>
Fri, 14 Mar 2008 19:55:51 +0000 (19:55 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Fri, 14 Mar 2008 19:55:51 +0000 (19:55 +0000)
(make_exec_error_cleanup): Remove declarations.
* utils.c (exec_error_cleanup_chain): Remove.
(do_exec_error_cleanups, discard_exec_error_cleanups)
(make_exec_error_cleanup): Remove.
* event-loop.c (start_event_loop): Adjust call to
async_enable_stdin.
* event-top.c (async_enable_stdin): Remove the paramater dummy.
(async_disable_stdin): Don't register async_enable_stdin via
cleanup.
* inf-loop.c (inferior_event_handler): Don't
call do_exec_error_cleanups.  Call async_enable_stdin instead.
* event-loop.c (start_event_loop): Adjust call to
async_enable_stdin.
* tui/tui-interp.c (tui_command_loop): Adjust call to
async_enable_stdin.

gdb/ChangeLog
gdb/defs.h
gdb/event-loop.c
gdb/event-top.c
gdb/event-top.h
gdb/inf-loop.c
gdb/tui/tui-interp.c
gdb/utils.c

index 9526ba3..d343e4a 100644 (file)
@@ -1,5 +1,24 @@
 2008-03-14  Vladimir Prus  <vladimir@codesourcery.com>
 
+       * defs.h (do_exec_error_cleanups, discard_exec_error_cleanups)
+       (make_exec_error_cleanup): Remove declarations.
+       * utils.c (exec_error_cleanup_chain): Remove.
+       (do_exec_error_cleanups, discard_exec_error_cleanups)
+       (make_exec_error_cleanup): Remove.
+       * event-loop.c (start_event_loop): Adjust call to
+       async_enable_stdin.
+       * event-top.c (async_enable_stdin): Remove the paramater dummy.
+       (async_disable_stdin): Don't register async_enable_stdin via
+       cleanup.
+       * inf-loop.c (inferior_event_handler): Don't
+       call do_exec_error_cleanups.  Call async_enable_stdin instead.
+       * event-loop.c (start_event_loop): Adjust call to
+       async_enable_stdin.
+       * tui/tui-interp.c (tui_command_loop): Adjust call to
+       async_enable_stdin.
+
+2008-03-14  Vladimir Prus  <vladimir@codesourcery.com>
+
        Async mode fixes.
         * Makefile.in (infcmd.o, inf-loop.o): Update dependencies.
         * breakpoint.c (bpstat_do_actions): In async mode,
index 3486df8..e4344a7 100644 (file)
@@ -319,11 +319,9 @@ extern char *safe_strerror (int);
 extern void do_cleanups (struct cleanup *);
 extern void do_final_cleanups (struct cleanup *);
 extern void do_exec_cleanups (struct cleanup *);
-extern void do_exec_error_cleanups (struct cleanup *);
 
 extern void discard_cleanups (struct cleanup *);
 extern void discard_final_cleanups (struct cleanup *);
-extern void discard_exec_error_cleanups (struct cleanup *);
 extern void discard_my_cleanups (struct cleanup **, struct cleanup *);
 
 /* NOTE: cagney/2000-03-04: This typedef is strictly for the
@@ -354,7 +352,6 @@ extern struct cleanup *make_my_cleanup (struct cleanup **,
                                        make_cleanup_ftype *, void *);
 
 extern struct cleanup *make_exec_cleanup (make_cleanup_ftype *, void *);
-extern struct cleanup *make_exec_error_cleanup (make_cleanup_ftype *, void *);
 
 extern struct cleanup *save_cleanups (void);
 extern struct cleanup *save_final_cleanups (void);
index ceff699..b36fefa 100644 (file)
@@ -414,7 +414,7 @@ start_event_loop (void)
          /* If any exception escaped to here, we better enable
             stdin.  Otherwise, any command that calls async_disable_stdin,
             and then throws, will leave stdin inoperable.  */
-         async_enable_stdin ((void *) 0);
+         async_enable_stdin ();
          /* FIXME: this should really be a call to a hook that is
             interface specific, because interfaces can display the
             prompt in their own way. */
index 79dd4c3..839e111 100644 (file)
@@ -435,7 +435,7 @@ stdin_event_handler (int error, gdb_client_data client_data)
    the exec operation. */
 
 void
-async_enable_stdin (void *dummy)
+async_enable_stdin (void)
 {
   if (sync_execution)
     {
@@ -463,11 +463,6 @@ async_disable_stdin (void)
      sync/async mode) is refined, the duplicate calls can be
      eliminated (Here or in infcmd.c/infrun.c). */
   target_terminal_inferior ();
-  /* Add the reinstate of stdin to the list of cleanups to be done
-     in case the target errors out and dies. These cleanups are also
-     done in case of normal successful termination of the execution
-     command, by complete_execution(). */
-  make_exec_error_cleanup (async_enable_stdin, NULL);
 }
 \f
 
index 21831fa..3c6dba7 100644 (file)
@@ -103,7 +103,7 @@ extern void mark_async_signal_handler_wrapper (void *token);
 extern void async_request_quit (void *arg);
 extern void stdin_event_handler (int error, void *client_data);
 extern void async_disable_stdin (void);
-extern void async_enable_stdin (void *dummy);
+extern void async_enable_stdin (void);
 
 /* Exported variables from event-top.c.
    FIXME: these should really go into top.h.  */
index c4fb111..cfb80d5 100644 (file)
@@ -51,7 +51,7 @@ inferior_event_handler (enum inferior_event_type event_type,
       target_async (NULL, 0);
       pop_target ();
       discard_all_continuations ();
-      do_exec_error_cleanups (ALL_CLEANUPS);
+      async_enable_stdin ();
       break;
 
     case INF_REG_EVENT:
@@ -65,7 +65,7 @@ inferior_event_handler (enum inferior_event_type event_type,
          target_async (NULL, 0);
          pop_target ();
          discard_all_continuations ();
-         do_exec_error_cleanups (ALL_CLEANUPS);
+         async_enable_stdin ();
          display_gdb_prompt (0);
        }
       break;
@@ -85,13 +85,11 @@ inferior_event_handler (enum inferior_event_type event_type,
       if (target_has_execution)
        target_async (NULL, 0);
 
-      /* Calls to do_exec_error_cleanup below will call async_enable_stdin,
-        and that resets 'sync_execution'.  However, if we were running
-        in sync execution mode, we also need to display the prompt.  */
+      /* The call to async_enable_stdin below resets 'sync_execution'.
+        However, if sync_execution is 1 now, we also need to show the
+        prompt below, so save the current value.  */
       was_sync = sync_execution;
-
-      if (was_sync)
-       do_exec_error_cleanups (ALL_CLEANUPS);
+      async_enable_stdin ();
 
       do_all_continuations ();
 
index 8a16678..21e8008 100644 (file)
@@ -167,7 +167,7 @@ tui_command_loop (void *data)
          /* If any exception escaped to here, we better enable
             stdin.  Otherwise, any command that calls async_disable_stdin,
             and then throws, will leave stdin inoperable.  */
-         async_enable_stdin ((void *) 0);
+         async_enable_stdin ();
          /* FIXME: this should really be a call to a hook that is
             interface specific, because interfaces can display the
             prompt in their own way.  */
index 91c593e..594fc73 100644 (file)
@@ -105,8 +105,6 @@ static int debug_timestamp = 0;
 static struct cleanup *cleanup_chain;  /* cleaned up after a failed command */
 static struct cleanup *final_cleanup_chain;    /* cleaned up when gdb exits */
 static struct cleanup *exec_cleanup_chain;     /* cleaned up on each execution command */
-/* cleaned up on each error from within an execution command */
-static struct cleanup *exec_error_cleanup_chain;
 
 /* Pointer to what is left to do for an execution command after the
    target stops. Used only in asynchronous mode, by targets that
@@ -222,12 +220,6 @@ make_exec_cleanup (make_cleanup_ftype *function, void *arg)
   return make_my_cleanup (&exec_cleanup_chain, function, arg);
 }
 
-struct cleanup *
-make_exec_error_cleanup (make_cleanup_ftype *function, void *arg)
-{
-  return make_my_cleanup (&exec_error_cleanup_chain, function, arg);
-}
-
 static void
 do_freeargv (void *arg)
 {
@@ -330,12 +322,6 @@ do_exec_cleanups (struct cleanup *old_chain)
   do_my_cleanups (&exec_cleanup_chain, old_chain);
 }
 
-void
-do_exec_error_cleanups (struct cleanup *old_chain)
-{
-  do_my_cleanups (&exec_error_cleanup_chain, old_chain);
-}
-
 static void
 do_my_cleanups (struct cleanup **pmy_chain,
                struct cleanup *old_chain)
@@ -365,12 +351,6 @@ discard_final_cleanups (struct cleanup *old_chain)
 }
 
 void
-discard_exec_error_cleanups (struct cleanup *old_chain)
-{
-  discard_my_cleanups (&exec_error_cleanup_chain, old_chain);
-}
-
-void
 discard_my_cleanups (struct cleanup **pmy_chain,
                     struct cleanup *old_chain)
 {