From: Vladimir Prus Date: Fri, 14 Mar 2008 19:55:51 +0000 (+0000) Subject: * defs.h (do_exec_error_cleanups, discard_exec_error_cleanups) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=712af3be2ee4d593ea25146e056e5d4df065ef97;p=binutils-gdb.git * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9526ba37485..d343e4aa24a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,22 @@ +2008-03-14 Vladimir Prus + + * 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 Async mode fixes. diff --git a/gdb/defs.h b/gdb/defs.h index 3486df8c632..e4344a72a69 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -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); diff --git a/gdb/event-loop.c b/gdb/event-loop.c index ceff6997ff4..b36fefa4e32 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -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. */ diff --git a/gdb/event-top.c b/gdb/event-top.c index 79dd4c32ae5..839e1114665 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -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); } diff --git a/gdb/event-top.h b/gdb/event-top.h index 21831fab2ab..3c6dba715b7 100644 --- a/gdb/event-top.h +++ b/gdb/event-top.h @@ -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. */ diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c index c4fb1111994..cfb80d5deab 100644 --- a/gdb/inf-loop.c +++ b/gdb/inf-loop.c @@ -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 (); diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c index 8a166785272..21e800863f7 100644 --- a/gdb/tui/tui-interp.c +++ b/gdb/tui/tui-interp.c @@ -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. */ diff --git a/gdb/utils.c b/gdb/utils.c index 91c593e682c..594fc733d37 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -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) @@ -364,12 +350,6 @@ discard_final_cleanups (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)