(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>
+
+ * 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.
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
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);
/* 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. */
the exec operation. */
void
-async_enable_stdin (void *dummy)
+async_enable_stdin (void)
{
if (sync_execution)
{
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
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. */
target_async (NULL, 0);
pop_target ();
discard_all_continuations ();
- do_exec_error_cleanups (ALL_CLEANUPS);
+ async_enable_stdin ();
break;
case INF_REG_EVENT:
target_async (NULL, 0);
pop_target ();
discard_all_continuations ();
- do_exec_error_cleanups (ALL_CLEANUPS);
+ async_enable_stdin ();
display_gdb_prompt (0);
}
break;
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 ();
/* 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. */
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
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)
{
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)
discard_my_cleanups (&final_cleanup_chain, 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)